fix tests
This commit is contained in:
parent
e330694e26
commit
9b1ce2b763
@ -152,7 +152,7 @@ func preloadEntryPoint(db *gorm.DB, joins []string, relationships *schema.Relati
|
|||||||
return gorm.ErrInvalidData
|
return gorm.ErrInvalidData
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks, Initialized: true})
|
tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks})
|
||||||
tx.Statement.ReflectValue = db.Statement.ReflectValue
|
tx.Statement.ReflectValue = db.Statement.ReflectValue
|
||||||
tx.Statement.Unscoped = db.Statement.Unscoped
|
tx.Statement.Unscoped = db.Statement.Unscoped
|
||||||
if err := preload(tx, rel, append(preloads[name], associationsConds...), preloadMap[name]); err != nil {
|
if err := preload(tx, rel, append(preloads[name], associationsConds...), preloadMap[name]); err != nil {
|
||||||
|
@ -388,7 +388,7 @@ func (c chainG[T]) Order(value interface{}) ChainInterface[T] {
|
|||||||
func (c chainG[T]) Preload(association string, query func(db PreloadBuilder) error) ChainInterface[T] {
|
func (c chainG[T]) Preload(association string, query func(db PreloadBuilder) error) ChainInterface[T] {
|
||||||
return c.with(func(db *DB) *DB {
|
return c.with(func(db *DB) *DB {
|
||||||
return db.Preload(association, func(tx *DB) *DB {
|
return db.Preload(association, func(tx *DB) *DB {
|
||||||
q := preloadBuilder{db: tx}
|
q := preloadBuilder{db: tx.getInstance()}
|
||||||
if query != nil {
|
if query != nil {
|
||||||
if err := query(q); err != nil {
|
if err := query(q); err != nil {
|
||||||
db.AddError(err)
|
db.AddError(err)
|
||||||
|
@ -11,7 +11,7 @@ require (
|
|||||||
gorm.io/driver/postgres v1.5.11
|
gorm.io/driver/postgres v1.5.11
|
||||||
gorm.io/driver/sqlite v1.5.7
|
gorm.io/driver/sqlite v1.5.7
|
||||||
gorm.io/driver/sqlserver v1.5.4
|
gorm.io/driver/sqlserver v1.5.4
|
||||||
gorm.io/gorm v1.25.12
|
gorm.io/gorm v1.26.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -22,11 +22,11 @@ require (
|
|||||||
github.com/golang-sql/sqlexp v0.1.0 // indirect
|
github.com/golang-sql/sqlexp v0.1.0 // indirect
|
||||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
github.com/jackc/pgx/v5 v5.7.4 // indirect
|
github.com/jackc/pgx/v5 v5.7.5 // indirect
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
||||||
github.com/microsoft/go-mssqldb v1.8.0 // indirect
|
github.com/microsoft/go-mssqldb v1.8.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.12.0 // indirect
|
github.com/rogpeppe/go-internal v1.12.0 // indirect
|
||||||
golang.org/x/crypto v0.38.0 // indirect
|
golang.org/x/crypto v0.38.0 // indirect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user