add NewSessionWithContext
This commit is contained in:
parent
efa3d0f877
commit
937fb624eb
5
gorm.go
5
gorm.go
@ -1,6 +1,7 @@
|
||||
package gorm
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
@ -46,6 +47,10 @@ func NewSession(db *gorm.DB) *gorm.DB {
|
||||
return db.Session(&gorm.Session{})
|
||||
}
|
||||
|
||||
func NewSessionWithContext(db *gorm.DB, ctx context.Context) *gorm.DB {
|
||||
return db.Session(&gorm.Session{Context: ctx})
|
||||
}
|
||||
|
||||
func DefaultLogger() gormlogger.Interface {
|
||||
return defaultLogger
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user