forked from forgejo/forgejo
Support use nvarchar for all varchar columns when using mssql (#12269)
* Support use nvarchar for all varchar columns when using mssql * fix lint * Change DEFAULT_VARCHAR to nvarchar * Remove the config for default varchar since it's unnecessary
This commit is contained in:
parent
ed8e064f5e
commit
45631083a4
11 changed files with 68 additions and 8 deletions
12
vendor/xorm.io/xorm/session.go
generated
vendored
12
vendor/xorm.io/xorm/session.go
generated
vendored
|
@ -102,12 +102,12 @@ func newSessionID() string {
|
|||
func newSession(engine *Engine) *Session {
|
||||
var ctx context.Context
|
||||
if engine.logSessionID {
|
||||
ctx = context.WithValue(engine.defaultContext, log.SessionIDKey, newSessionID())
|
||||
ctx = context.WithValue(engine.defaultContext, log.SessionIDKey, newSessionID())
|
||||
} else {
|
||||
ctx = engine.defaultContext
|
||||
}
|
||||
|
||||
return &Session{
|
||||
session := &Session{
|
||||
ctx: ctx,
|
||||
engine: engine,
|
||||
tx: nil,
|
||||
|
@ -136,6 +136,10 @@ func newSession(engine *Engine) *Session {
|
|||
|
||||
sessionType: engineSession,
|
||||
}
|
||||
if engine.logSessionID {
|
||||
session.ctx = context.WithValue(session.ctx, log.SessionKey, session)
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
// Close release the connection from pool
|
||||
|
@ -165,6 +169,10 @@ func (session *Session) db() *core.DB {
|
|||
return session.engine.db
|
||||
}
|
||||
|
||||
func (session *Session) Engine() *Engine {
|
||||
return session.engine
|
||||
}
|
||||
|
||||
func (session *Session) getQueryer() core.Queryer {
|
||||
if session.tx != nil {
|
||||
return session.tx
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue