h2 insert
This commit is contained in:
snoop 2016-11-08 19:49:52 +09:00
parent 896e8e9850
commit e763dee703
2 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ func createCallback(scope *Scope) {
} else { } else {
if scope.Dialect().GetName() == "h2" { if scope.Dialect().GetName() == "h2" {
_, err := scope.SQLDB().Query(scope.SQL, scope.SQLVars...) _, err := scope.SQLDB().Exec(scope.SQL, scope.SQLVars...)
if scope.Err(err) == nil { if scope.Err(err) == nil {
primaryField.IsBlank = false primaryField.IsBlank = false
scope.db.RowsAffected = 1 scope.db.RowsAffected = 1

View File

@ -114,7 +114,7 @@ func (s h2) CurrentDatabase() (name string) {
func (s h2) LastInsertIDReturningSuffix(tableName, key string) string { func (s h2) LastInsertIDReturningSuffix(tableName, key string) string {
//return fmt.Sprintf("RETURNING %v.%v", tableName, key) //return fmt.Sprintf("RETURNING %v.%v", tableName, key)
return fmt.Sprintf(" ; CALL IDENTITY(); ") return fmt.Sprintf(" ; ")
} }
func (h2) SupportLastInsertID() bool { func (h2) SupportLastInsertID() bool {