Documentation ¶
Index ¶
- Constants
- func And(left, right stmt.Expr, exprs ...stmt.Expr) *stmt.And
- func AndFromMap(f ConditionalFunc, m map[string]interface{}) stmt.Expr
- func Between(column string, left, right interface{}) *stmt.Condition
- func Eq(column string, value interface{}) *stmt.Condition
- func Ge(column string, value interface{}) *stmt.Condition
- func Gt(column string, value interface{}) *stmt.Condition
- func In(column string, args ...interface{}) *stmt.Condition
- func Le(column string, value interface{}) *stmt.Condition
- func Like(column string, value interface{}) *stmt.Condition
- func Lt(column string, value interface{}) *stmt.Condition
- func Ne(column string, value interface{}) *stmt.Condition
- func NotBetween(column string, left, right interface{}) *stmt.Condition
- func NotIn(column string, args ...interface{}) *stmt.Condition
- func NotLike(column string, value interface{}) *stmt.Condition
- func Op(op, column string, value interface{}) *stmt.Condition
- func Or(left, right stmt.Expr, exprs ...stmt.Expr) *stmt.Or
- func OrFromMap(f ConditionalFunc, m map[string]interface{}) stmt.Expr
- func OrderBy(column string, desc bool) *stmt.OrderBy
- func OrderByList(expr *stmt.OrderBy, exprs ...*stmt.OrderBy) *stmt.OrderBy
- func Paren(expr stmt.Expr) *stmt.Paren
- type Builder
- type Columns
- type ConditionalFunc
- type Limit
- type Numeric
- type Offset
- type Option
- type String
Constants ¶
const ( // Question represents a '?' placeholder parameter. Question = iota // Dollar represents a '$1', '$2'... placeholder parameters. Dollar // AtMark represents a '@1', '@2'... placeholder parameters. AtMark )
There is build logic using placeholder in internal/pool.go.
Variables ¶
This section is empty.
Functions ¶
func And ¶
And creates statement for the AND boolean expression. If you want to know more details, See at stmt.And.
func AndFromMap ¶
func AndFromMap(f ConditionalFunc, m map[string]interface{}) stmt.Expr
AndFromMap Creates a concatenated string of AND boolean expression from a map.
If there is no first argument then occurs panic. If map length is zero it returns nil. If map length is 1 it returns *stmt.Condition created by ConditionalFunc.
func NotBetween ¶
NotBetween creates condition `column NOT BETWEEN ? AND ?`.
func Or ¶
Or creates statement for the OR boolean expression with parentheses. If you want to know more details, See at stmt.Or.
func OrFromMap ¶
func OrFromMap(f ConditionalFunc, m map[string]interface{}) stmt.Expr
OrFromMap Creates a concatenated string of OR boolean expression from a map.
If there is no first argument then occurs panic. If map length is zero it returns nil. If map length is 1 it returns *stmt.Condition created by ConditionalFunc.
func OrderBy ¶ added in v0.0.2
OrderBy Creates an unary expression for ORDER BY. If you want to know more details, See at stmt.OrderBy.
func OrderByList ¶ added in v0.0.2
OrderByList Creates an expression for ORDER BY from multiple *stmt.OrderBy.
This function creates like "<column_name>, <column_name> DESC". The first argument is required. If you want to know more details, See at stmt.OrderBy.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds sql query string.
type ConditionalFunc ¶
ConditionalFunc indicates function of conditional.
type Option ¶ added in v0.0.2
type Option func(b *Builder)
Option represents options to build sql query.
func SetPlaceholder ¶ added in v0.0.2
SetPlaceholder sets placeholder.
Default value is zero uses Question '?' as a placeholder.