1
0
Fork 0
forked from forgejo/forgejo

Update xorm and dependencies vendor for feature to dump to other database (#565)

* update xorm and dependencies vendor for feature to dump to other database

* fix golint
This commit is contained in:
Lunny Xiao 2017-01-03 16:20:28 +08:00 committed by GitHub
parent 70900bd167
commit 980dd0bf51
54 changed files with 3135 additions and 2619 deletions

View file

@ -1,11 +1,18 @@
// Copyright 2016 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package builder
import "fmt"
// Incr implements a type used by Eq
type Incr int
// Decr implements a type used by Eq
type Decr int
// Eq defines equals conditions
type Eq map[string]interface{}
var _ Cond = Eq{}
@ -68,18 +75,22 @@ func (eq Eq) opWriteTo(op string, w Writer) error {
return nil
}
// WriteTo writes SQL to Writer
func (eq Eq) WriteTo(w Writer) error {
return eq.opWriteTo(" AND ", w)
}
// And implements And with other conditions
func (eq Eq) And(conds ...Cond) Cond {
return And(eq, And(conds...))
}
// Or implements Or with other conditions
func (eq Eq) Or(conds ...Cond) Cond {
return Or(eq, Or(conds...))
}
// IsValid tests if this Eq is valid
func (eq Eq) IsValid() bool {
return len(eq) > 0
}