Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidNumberOfArguments = errors.New("invalid number of arguments")
Functions ¶
Types ¶
type Columns ¶ added in v0.0.7
type Columns []string
Columns in a Sqlizer that joins a list of identifiers with ", ".
type Expression ¶
Expression represents a prepared statement.
func Append ¶
func Append(expr ...Sqlizer) Expression
Append builds an Expression by appending Sqlizer's.
func If ¶
func If(condition bool, then Sqlizer) Expression
If returns then if condition is true. If the condition is false, an empty Expression is returned.
func IfElse ¶ added in v0.0.4
func IfElse(condition bool, then, els Sqlizer) Expression
IfElse returns then Sqlizer on true and els on false as Expression.
func Join ¶
func Join(sep string, expr ...Sqlizer) Expression
Join builds an Expression by joining Sqlizer's with a separator.
func SQL ¶
func SQL(template string, expressions ...any) Expression
SQL takes a template with placeholders into which expressions can be compiled. Expressions can be of type Sqlizer or []Sqlizer. []Sqlizer gets joined to an Expression with ", " as separator. All other values will be put into the arguments of a prepared statement. You can escape '?' by using '??'.
func ToExpression ¶ added in v0.0.5
func ToExpression(expr Sqlizer) Expression
ToExpression returns a valid Expression from a Sqlizer.