diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-03-25 22:32:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 16:32:23 +0200 |
commit | 73f5ca70de9254b3a031570de8a8a5f3ca00ed95 (patch) | |
tree | 2fc6a0b797ba58b21873d67dce23db649ae0072c /vendor/xorm.io/xorm/session.go | |
parent | b10cb7b258ec3bb5091a214a2ffeedec06c207ff (diff) | |
download | gitea-73f5ca70de9254b3a031570de8a8a5f3ca00ed95.tar.gz gitea-73f5ca70de9254b3a031570de8a8a5f3ca00ed95.zip |
Upgrade xorm to v1.0.1 and fix start fail with potgres (#10819)
* upgrade xorm to v1.0.1
* fix start fail with postgres
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'vendor/xorm.io/xorm/session.go')
-rw-r--r-- | vendor/xorm.io/xorm/session.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/xorm.io/xorm/session.go b/vendor/xorm.io/xorm/session.go index 4842883b6b..6b8bfbaf59 100644 --- a/vendor/xorm.io/xorm/session.go +++ b/vendor/xorm.io/xorm/session.go @@ -99,7 +99,7 @@ func (session *Session) Init() { session.engine.tagParser, session.engine.DatabaseTZ, ) - + session.db = session.engine.db session.isAutoCommit = true session.isCommitedOrRollbacked = false session.isAutoClose = false @@ -140,6 +140,13 @@ func (session *Session) Close() { } } +func (session *Session) getQueryer() core.Queryer { + if session.tx != nil { + return session.tx + } + return session.db +} + // ContextCache enable context cache or not func (session *Session) ContextCache(context contexts.ContextCache) *Session { session.statement.SetContextCache(context) |