use go-ora v2

This commit is contained in:
Charlie 2024-06-04 11:04:14 +08:00
parent 05805630f2
commit 1f6c8a18a3
2 changed files with 6 additions and 8 deletions

6
go.mod
View File

@ -4,17 +4,13 @@ go 1.22
require (
github.com/emirpasic/gods v1.18.1
github.com/godror/godror v0.43.0
github.com/sijms/go-ora/v2 v2.8.19
github.com/thoas/go-funk v0.9.3
gorm.io/gorm v1.25.10
)
require (
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/godror/knownpb v0.1.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
google.golang.org/protobuf v1.34.1 // indirect
)

View File

@ -10,7 +10,8 @@ import (
"gorm.io/gorm/utils"
_ "github.com/godror/godror"
// _ "github.com/godror/godror"
_ "github.com/sijms/go-ora/v2"
"github.com/thoas/go-funk"
"gorm.io/gorm"
"gorm.io/gorm/callbacks"
@ -67,7 +68,8 @@ func (d Dialector) Initialize(db *gorm.DB) (err error) {
DeleteClauses: []string{"DELETE", "FROM", "WHERE", "RETURNING"},
})
d.DriverName = "godror"
// d.DriverName = "godror"
d.DriverName = "oracle"
// godror.Batch
@ -83,7 +85,7 @@ func (d Dialector) Initialize(db *gorm.DB) (err error) {
if err != nil {
return err
}
//log.Println("DBver:" + d.DBVer)
if err = db.Callback().Create().Replace("gorm:create", Create); err != nil {
return
}