From 77c36832c036785d35534d1ebf13142edb2640dd Mon Sep 17 00:00:00 2001 From: Jim Lambert Date: Wed, 12 Feb 2020 14:44:53 -0500 Subject: [PATCH] simply oracle test --- callback_create.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/callback_create.go b/callback_create.go index d570d20c..1d64dd30 100644 --- a/callback_create.go +++ b/callback_create.go @@ -3,7 +3,6 @@ package gorm import ( "database/sql" "fmt" - "sort" "strings" ) @@ -146,10 +145,7 @@ func createCallback(scope *Scope) { return } - // deal with oracle special case handling of last insert id - oraModules := []string{"godror", "oci8", "ora"} // must be an asc sorted slice - insertAt := sort.SearchStrings(oraModules, scope.Dialect().GetName()) - if insertAt < len(oraModules) && oraModules[insertAt] == scope.Dialect().GetName() { + if scope.IsOracle() { var id uint32 scope.SQLVars = append(scope.SQLVars, sql.Out{Dest: &id}) scope.SQL = fmt.Sprintf("%s returning id into :%d", scope.SQL, len(scope.SQLVars))