Backport of #25613 Fixes #25564 Fixes #23191 - Api v2 search endpoint should return only the latest version matching the query - Api v3 search endpoint should return `take` packages not package versions
This commit is contained in:
parent
3571cbba34
commit
762d4245fb
6 changed files with 115 additions and 21 deletions
|
@ -20,3 +20,19 @@ func BuildCaseInsensitiveLike(key, value string) builder.Cond {
|
|||
}
|
||||
return builder.Like{"UPPER(" + key + ")", strings.ToUpper(value)}
|
||||
}
|
||||
|
||||
// BuilderDialect returns the xorm.Builder dialect of the engine
|
||||
func BuilderDialect() string {
|
||||
switch {
|
||||
case setting.Database.Type.IsMySQL():
|
||||
return builder.MYSQL
|
||||
case setting.Database.Type.IsSQLite3():
|
||||
return builder.SQLITE
|
||||
case setting.Database.Type.IsPostgreSQL():
|
||||
return builder.POSTGRES
|
||||
case setting.Database.Type.IsMSSQL():
|
||||
return builder.MSSQL
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue