mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix label count (#8267)
* fix label count * fix vendor * fix import order * update xorm to fix bug * fix tests * fix mssql bug
This commit is contained in:
26
vendor/xorm.io/builder/README.md
generated
vendored
26
vendor/xorm.io/builder/README.md
generated
vendored
@@ -1,13 +1,13 @@
|
||||
# SQL builder
|
||||
|
||||
[](https://gitci.cn/go-xorm/builder) [](https://codecov.io/gh/go-xorm/builder)
|
||||
[](https://goreportcard.com/report/github.com/go-xorm/builder)
|
||||
[](https://drone.gitea.com/xorm/builder) [](http://gocover.io/xorm.io/builder)
|
||||
[](https://goreportcard.com/report/xorm.io/builder)
|
||||
|
||||
Package builder is a lightweight and fast SQL builder for Go and XORM.
|
||||
|
||||
Make sure you have installed Go 1.8+ and then:
|
||||
|
||||
go get github.com/go-xorm/builder
|
||||
go get xorm.io/builder
|
||||
|
||||
# Insert
|
||||
|
||||
@@ -71,7 +71,7 @@ sql, args, err := Select("*").From("a").Where(Eq{"status": "1"}).
|
||||
* `Eq` is a redefine of a map, you can give one or more conditions to `Eq`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Eq{"a":1})
|
||||
// a=? [1]
|
||||
@@ -90,7 +90,7 @@ sql, args, _ := ToSQL(Eq{"b": 1, "c":[]int{2, 3}})
|
||||
* `Neq` is the same to `Eq`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Neq{"a":1})
|
||||
// a<>? [1]
|
||||
@@ -109,7 +109,7 @@ sql, args, _ := ToSQL(Neq{"b": 1, "c":[]int{2, 3}})
|
||||
* `Gt`, `Gte`, `Lt`, `Lte`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Gt{"a", 1}.And(Gte{"b", 2}))
|
||||
// a>? AND b>=? [1, 2]
|
||||
@@ -120,7 +120,7 @@ sql, args, _ := ToSQL(Lt{"a", 1}.Or(Lte{"b", 2}))
|
||||
* `Like`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Like{"a", "c"})
|
||||
// a LIKE ? [%c%]
|
||||
@@ -129,7 +129,7 @@ sql, args, _ := ToSQL(Like{"a", "c"})
|
||||
* `Expr` you can customerize your sql with `Expr`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Expr("a = ? ", 1))
|
||||
// a = ? [1]
|
||||
@@ -140,7 +140,7 @@ sql, args, _ := ToSQL(Eq{"a": Expr("select id from table where c = ?", 1)})
|
||||
* `In` and `NotIn`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(In("a", 1, 2, 3))
|
||||
// a IN (?,?,?) [1,2,3]
|
||||
@@ -153,7 +153,7 @@ sql, args, _ := ToSQL(In("a", Expr("select id from b where c = ?", 1))))
|
||||
* `IsNull` and `NotNull`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(IsNull{"a"})
|
||||
// a IS NULL []
|
||||
@@ -164,7 +164,7 @@ sql, args, _ := ToSQL(NotNull{"b"})
|
||||
* `And(conds ...Cond)`, And can connect one or more condtions via And
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(And(Eq{"a":1}, Like{"b", "c"}, Neq{"d", 2}))
|
||||
// a=? AND b LIKE ? AND d<>? [1, %c%, 2]
|
||||
@@ -173,7 +173,7 @@ sql, args, _ := ToSQL(And(Eq{"a":1}, Like{"b", "c"}, Neq{"d", 2}))
|
||||
* `Or(conds ...Cond)`, Or can connect one or more conditions via Or
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Or(Eq{"a":1}, Like{"b", "c"}, Neq{"d", 2}))
|
||||
// a=? OR b LIKE ? OR d<>? [1, %c%, 2]
|
||||
@@ -184,7 +184,7 @@ sql, args, _ := ToSQL(Or(Eq{"a":1}, And(Like{"b", "c"}, Neq{"d", 2})))
|
||||
* `Between`
|
||||
|
||||
```Go
|
||||
import . "github.com/go-xorm/builder"
|
||||
import . "xorm.io/builder"
|
||||
|
||||
sql, args, _ := ToSQL(Between{"a", 1, 2})
|
||||
// a BETWEEN 1 AND 2
|
||||
|
Reference in New Issue
Block a user