From dc1584931325989cbe665fc5a77666801c39a66f Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sun, 10 Nov 2013 10:09:57 +0800 Subject: [PATCH] Don't suppose id's value as int --- do.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/do.go b/do.go index ebb5aa78..4548bd93 100644 --- a/do.go +++ b/do.go @@ -93,7 +93,7 @@ func (s *Do) exec(sql ...string) { s.err(err) } -func (s *Do) save() (i int64) { +func (s *Do) save() (i interface{}) { if s.model.primaryKeyZero() { return s.create() } else { @@ -180,7 +180,7 @@ func (s *Do) saveAfterAssociations() { } } -func (s *Do) create() (i int64) { +func (s *Do) create() (i interface{}) { s.err(s.model.callMethod("BeforeCreate")) s.err(s.model.callMethod("BeforeSave")) @@ -188,7 +188,7 @@ func (s *Do) create() (i int64) { s.prepareCreateSql() if !s.hasError() { - var id int64 + var id interface{} if s.driver == "postgres" { s.err(s.db.QueryRow(s.sql, s.sqlVars...).Scan(&id)) } else {