mirror of https://github.com/go-gorm/gorm.git
parent
33a11767ea
commit
bdb30da0a7
1
gorm.go
1
gorm.go
|
@ -117,6 +117,7 @@ func Open(dialector Dialector, config *Config) (db *DB, err error) {
|
||||||
preparedStmt := &PreparedStmtDB{
|
preparedStmt := &PreparedStmtDB{
|
||||||
ConnPool: db.ConnPool,
|
ConnPool: db.ConnPool,
|
||||||
Stmts: map[string]*sql.Stmt{},
|
Stmts: map[string]*sql.Stmt{},
|
||||||
|
Mux: &sync.RWMutex{},
|
||||||
PreparedSQL: make([]string, 0, 100),
|
PreparedSQL: make([]string, 0, 100),
|
||||||
}
|
}
|
||||||
db.cacheStore.Store("preparedStmt", preparedStmt)
|
db.cacheStore.Store("preparedStmt", preparedStmt)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
type PreparedStmtDB struct {
|
type PreparedStmtDB struct {
|
||||||
Stmts map[string]*sql.Stmt
|
Stmts map[string]*sql.Stmt
|
||||||
PreparedSQL []string
|
PreparedSQL []string
|
||||||
Mux sync.RWMutex
|
Mux *sync.RWMutex
|
||||||
ConnPool
|
ConnPool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue