Documentation
¶
Index ¶
- func Arg(vals ...any) bob.Expression
- func ArgGroup(vals ...any) bob.Expression
- func Not[T bob.Expression, B builder[T]](exp bob.Expression) T
- func OP(operator string, left, right any) bob.Expression
- func Quote(aa ...string) bob.Expression
- func RawQuery(d bob.Dialect, q string, args ...any) bob.BaseQuery[Clause]
- func X[T bob.Expression, B builder[T]](exp bob.Expression, others ...bob.Expression) T
- type Builder
- func (e Builder[T, B]) And(args ...bob.Expression) T
- func (e Builder[T, B]) Arg(vals ...any) T
- func (e Builder[T, B]) ArgGroup(vals ...any) T
- func (e Builder[T, B]) Group(exps ...bob.Expression) T
- func (e Builder[T, B]) Not(exp bob.Expression) T
- func (e Builder[T, B]) Or(args ...bob.Expression) T
- func (e Builder[T, B]) Placeholder(n uint) T
- func (e Builder[T, B]) Quote(aa ...string) T
- func (e Builder[T, B]) Raw(query string, args ...any) T
- func (e Builder[T, B]) S(s string) T
- type Chain
- func (x Chain[T, B]) And(targets ...bob.Expression) T
- func (x Chain[T, B]) As(alias string) bob.Expression
- func (x Chain[T, B]) Between(a, b bob.Expression) T
- func (x Chain[T, B]) Concat(targets ...bob.Expression) T
- func (x Chain[T, B]) EQ(target bob.Expression) T
- func (x Chain[T, B]) GT(target any) T
- func (x Chain[T, B]) GTE(target any) T
- func (x Chain[T, B]) In(vals ...bob.Expression) T
- func (x Chain[T, B]) IsDistinctFrom(exp bob.Expression) T
- func (x Chain[T, B]) IsNotDistinctFrom(exp bob.Expression) T
- func (x Chain[T, B]) IsNotNull() T
- func (x Chain[T, B]) IsNull() T
- func (x Chain[T, B]) LT(target any) T
- func (x Chain[T, B]) LTE(target any) T
- func (x Chain[T, B]) Like(target bob.Expression) T
- func (x Chain[T, B]) Minus(target any) T
- func (x Chain[T, B]) NE(target any) T
- func (x Chain[T, B]) NotBetween(a, b bob.Expression) T
- func (x Chain[T, B]) NotIn(vals ...bob.Expression) T
- func (x Chain[T, B]) Or(targets ...bob.Expression) T
- func (x Chain[T, B]) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error)
- type Clause
- type Join
- type Raw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Arg ¶ added in v0.3.1
func Arg(vals ...any) bob.Expression
func ArgGroup ¶ added in v0.15.0
func ArgGroup(vals ...any) bob.Expression
Like Arg, but wraps in parentheses
func Not ¶
func Not[T bob.Expression, B builder[T]](exp bob.Expression) T
prefix the expression with a NOT
func OP ¶
func OP(operator string, left, right any) bob.Expression
Generic operator between a left and right val
func Quote ¶ added in v0.2.0
func Quote(aa ...string) bob.Expression
func X ¶
func X[T bob.Expression, B builder[T]](exp bob.Expression, others ...bob.Expression) T
Build an expression
Types ¶
type Builder ¶
type Builder[T bob.Expression, B builder[T]] struct{}
To be embedded in query mods T is the chain type, this allows dialects to have custom chain methods F is function type, so that the dialect can change where it accepted. E.g. it can be modified to work as a mod B has a New() method that is used to create a new instance of T
func (Builder[T, B]) ArgGroup ¶ added in v0.15.0
Comma separated list of arguments surrounded by parentheses
func (Builder[T, B]) Group ¶
func (e Builder[T, B]) Group(exps ...bob.Expression) T
Add parentheses around an expressions and separate them by commas
func (Builder[T, B]) Not ¶
func (e Builder[T, B]) Not(exp bob.Expression) T
prefix the expression with a NOT
func (Builder[T, B]) Placeholder ¶
type Chain ¶
type Chain[T bob.Expression, B builder[T]] struct { Base bob.Expression }
func (Chain[T, B]) As ¶
func (x Chain[T, B]) As(alias string) bob.Expression
As does not return a new chain. Should be used at the end of an expression useful for columns
func (Chain[T, B]) Concat ¶
func (x Chain[T, B]) Concat(targets ...bob.Expression) T
Concatenate: ||
func (Chain[T, B]) IsDistinctFrom ¶ added in v0.2.0
func (x Chain[T, B]) IsDistinctFrom(exp bob.Expression) T
IS DISTINCT FROM
func (Chain[T, B]) IsNotDistinctFrom ¶ added in v0.2.0
func (x Chain[T, B]) IsNotDistinctFrom(exp bob.Expression) T
IS NOT DISTINCT FROM
func (Chain[T, B]) Like ¶ added in v0.19.0
func (x Chain[T, B]) Like(target bob.Expression) T
Like operator
func (Chain[T, B]) NotBetween ¶
func (x Chain[T, B]) NotBetween(a, b bob.Expression) T
NOT BETWEEN a AND b
type Clause ¶ added in v0.18.0
type Clause struct {
// contains filtered or unexported fields
}
A Raw Raw with arguments