1
0
Fork 0
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:
Lunny Xiao 2020-07-21 20:28:27 +08:00 committed by GitHub
parent ed8e064f5e
commit 45631083a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 8 deletions

12
vendor/xorm.io/xorm/session.go generated vendored
View file

@ -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