Skip to content

Commit e5b867e

Browse files
committed
remove unnecessary session-level configuration for prepared statements
1 parent 8c4e8e2 commit e5b867e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

gorm.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ type DB struct {
110110
type Session struct {
111111
DryRun bool
112112
PrepareStmt bool
113-
PrepareStmtMaxSize int
114-
PrepareStmtTTL time.Duration
115113
NewDB bool
116114
Initialized bool
117115
SkipHooks bool
@@ -275,7 +273,7 @@ func (db *DB) Session(config *Session) *DB {
275273
if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok {
276274
preparedStmt = v.(*PreparedStmtDB)
277275
} else {
278-
preparedStmt = NewPreparedStmtDB(db.ConnPool, config.PrepareStmtMaxSize, config.PrepareStmtTTL)
276+
preparedStmt = NewPreparedStmtDB(db.ConnPool, db.PrepareStmtMaxSize, db.PrepareStmtTTL)
279277
db.cacheStore.Store(preparedStmtDBKey, preparedStmt)
280278
}
281279

tests/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ require (
3131
github.com/microsoft/go-mssqldb v1.7.2 // indirect
3232
github.com/pmezard/go-difflib v1.0.0 // indirect
3333
github.com/rogpeppe/go-internal v1.12.0 // indirect
34-
golang.org/x/crypto v0.37.0 // indirect
35-
golang.org/x/text v0.24.0 // indirect
34+
golang.org/x/crypto v0.38.0 // indirect
35+
golang.org/x/text v0.25.0 // indirect
3636
gopkg.in/yaml.v3 v3.0.1 // indirect
3737
)
3838

0 commit comments

Comments
 (0)