add disable version check func (#2197)

Co-authored-by: tyler <tylerthail@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2197
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: tylerthail2019 <tylerthail2019@noreply.gitea.io>
Co-committed-by: tylerthail2019 <tylerthail2019@noreply.gitea.io>
This commit is contained in:
tylerthail2019 2022-11-16 13:22:04 +08:00 committed by Lunny Xiao
parent 3acabdaf26
commit 71a5939c65
1 changed files with 6 additions and 0 deletions

View File

@ -794,3 +794,9 @@ func (session *Session) PingContext(ctx context.Context) error {
session.engine.logger.Infof("PING DATABASE %v", session.engine.DriverName()) session.engine.logger.Infof("PING DATABASE %v", session.engine.DriverName())
return session.DB().PingContext(ctx) return session.DB().PingContext(ctx)
} }
// disable version check
func (session *Session) NoVersionCheck() *Session {
session.statement.CheckVersion = false
return session
}