h2 insert
This commit is contained in:
snoop 2016-11-08 19:46:05 +09:00
parent 6e1d6b9e98
commit 896e8e9850
2 changed files with 2 additions and 2 deletions

View File

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

View File

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