mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
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:
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
|
||||
|
Reference in New Issue
Block a user