simply oracle test
This commit is contained in:
parent
5b26d4ba08
commit
77c36832c0
@ -3,7 +3,6 @@ package gorm
|
|||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -146,10 +145,7 @@ func createCallback(scope *Scope) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// deal with oracle special case handling of last insert id
|
if scope.IsOracle() {
|
||||||
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() {
|
|
||||||
var id uint32
|
var id uint32
|
||||||
scope.SQLVars = append(scope.SQLVars, sql.Out{Dest: &id})
|
scope.SQLVars = append(scope.SQLVars, sql.Out{Dest: &id})
|
||||||
scope.SQL = fmt.Sprintf("%s returning id into :%d", scope.SQL, len(scope.SQLVars))
|
scope.SQL = fmt.Sprintf("%s returning id into :%d", scope.SQL, len(scope.SQLVars))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user