Documentation
¶
Index ¶
- type Clause
- type Condition
- func Between(column string, a, b interface{}) Condition
- func Eq(column string, value interface{}) Condition
- func Gt(column string, value interface{}) Condition
- func GtEq(column string, value interface{}) Condition
- func In(column string, values ...interface{}) Condition
- func Lt(column string, value interface{}) Condition
- func LtEq(column string, value interface{}) Condition
- func NotEq(column string, value interface{}) Condition
- func Null(column string) Condition
- type Dialect
- type Expression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clause ¶
type Clause struct {
// contains filtered or unexported fields
}
Clause is a compound expression.
func And ¶
func And(exp ...Expression) Clause
And combines some expressions into a clause that requires they are all true.
func Or ¶
func Or(exp ...Expression) Clause
Or combines some expressions into a clause that requires that any is true.
func (Clause) And ¶
func (wh Clause) And(exp Expression) Clause
And combines two clauses into a clause that requires they are both true. SQL implementation note: AND has higher precedence than OR.
func (Clause) Or ¶
func (wh Clause) Or(exp Expression) Clause
Or combines two clauses into a clause that requires either is true. SQL implementation note: AND has higher precedence than OR.
type Condition ¶
type Condition struct { Sql string Args []interface{} }
Condition is a simple condition such as an equality test.
func (Condition) And ¶
func (cl Condition) And(c2 Expression) Clause
And combines two conditions into a clause that requires they are both true.
func (Condition) Or ¶
func (cl Condition) Or(c2 Expression) Clause
Or combines two conditions into a clause that requires either is true.
type Dialect ¶
Dialect provides a method to convert named argument placeholders to the dialect needed for the database in use.
type Expression ¶
type Expression interface { Build(dialect Dialect) (string, []interface{}) // contains filtered or unexported methods }
Expression is an element in a WHERE clause. Expressions may be nested in various ways.