forked from forgejo/forgejo
Added test environment for mssql (#4282)
* Added test environment for m$sql * Added template for test environment for m$sql * Fix password * Fix password (again) * Fix password (again again) * Fix db * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Create master database for mssql integration tests Signed-off-by: Jonas Franz <info@jonasfranz.software> * Create database only if master do not exist Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix mssql integration tests by using custom database "gitea" Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved defer * bump xorm * updated xorm * Fixed build
This commit is contained in:
parent
b1f3685015
commit
6db7dbd333
27 changed files with 383 additions and 66 deletions
17
vendor/github.com/go-xorm/xorm/engine.go
generated
vendored
17
vendor/github.com/go-xorm/xorm/engine.go
generated
vendored
|
@ -177,6 +177,14 @@ func (engine *Engine) QuoteStr() string {
|
|||
return engine.dialect.QuoteStr()
|
||||
}
|
||||
|
||||
func (engine *Engine) quoteColumns(columnStr string) string {
|
||||
columns := strings.Split(columnStr, ",")
|
||||
for i := 0; i < len(columns); i++ {
|
||||
columns[i] = engine.Quote(strings.TrimSpace(columns[i]))
|
||||
}
|
||||
return strings.Join(columns, ",")
|
||||
}
|
||||
|
||||
// Quote Use QuoteStr quote the string sql
|
||||
func (engine *Engine) Quote(value string) string {
|
||||
value = strings.TrimSpace(value)
|
||||
|
@ -237,6 +245,11 @@ func (engine *Engine) AutoIncrStr() string {
|
|||
return engine.dialect.AutoIncrStr()
|
||||
}
|
||||
|
||||
// SetConnMaxLifetime sets the maximum amount of time a connection may be reused.
|
||||
func (engine *Engine) SetConnMaxLifetime(d time.Duration) {
|
||||
engine.db.SetConnMaxLifetime(d)
|
||||
}
|
||||
|
||||
// SetMaxOpenConns is only available for go 1.2+
|
||||
func (engine *Engine) SetMaxOpenConns(conns int) {
|
||||
engine.db.SetMaxOpenConns(conns)
|
||||
|
@ -1333,10 +1346,10 @@ func (engine *Engine) DropIndexes(bean interface{}) error {
|
|||
}
|
||||
|
||||
// Exec raw sql
|
||||
func (engine *Engine) Exec(sql string, args ...interface{}) (sql.Result, error) {
|
||||
func (engine *Engine) Exec(sqlorArgs ...interface{}) (sql.Result, error) {
|
||||
session := engine.NewSession()
|
||||
defer session.Close()
|
||||
return session.Exec(sql, args...)
|
||||
return session.Exec(sqlorArgs...)
|
||||
}
|
||||
|
||||
// Query a raw sql and return records as []map[string][]byte
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue