Documentation
¶
Index ¶
- func Agg(name string, exps []builder.Exp) builder.AggExpBuilder
- func And(exps ...builder.Exp) builder.Exp
- func Arg(argument any) builder.Exp
- func Args(argument any, rest ...any) []builder.Exp
- func Array(exps ...builder.Exp) builder.Exp
- func Bind(argName string) builder.Exp
- func Bool(b bool) builder.Exp
- func Build(w builder.SQLWriter) *builder.QueryBuilder
- func Case(exp ...builder.Exp) builder.CaseBuilder
- func Coalesce(exp builder.Exp, rest ...builder.Exp) builder.FuncExp
- func Default() builder.Exp
- func DeleteFrom(tableName string) builder.DeleteBuilder
- func Exists(subquery builder.SelectExp) builder.Exp
- func Exps(exps ...builder.Exp) []builder.Exp
- func Float(f float64) builder.Exp
- func Func(name string, args ...builder.Exp) builder.FuncBuilder
- func Greatest(exp builder.Exp, rest ...builder.Exp) builder.FuncExp
- func InsertInto(tableName string) builder.InsertBuilder
- func Int(s int) builder.Exp
- func Interval(s string) builder.Exp
- func Least(exp builder.Exp, rest ...builder.Exp) builder.FuncExp
- func N(s string) builder.IdentExp
- func Null() builder.Exp
- func NullIf(value1, value2 builder.Exp) builder.FuncExp
- func Or(exps ...builder.Exp) builder.Exp
- func RowsFrom(fn builder.FuncBuilder, fns ...builder.FuncBuilder) builder.RowsFromBuilder
- func Select(exps ...builder.Exp) builder.SelectSelectBuilder
- func SelectJson(obj builder.JsonBuildObjectBuilder) builder.SelectJsonSelectBuilder
- func String(s string) builder.Exp
- func Update(tableName string) builder.UpdateBuilder
- func With(queryName string) builder.WithWithBuilder
- func WithRecursive(queryName string) builder.WithWithBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Agg ¶
func Agg(name string, exps []builder.Exp) builder.AggExpBuilder
Agg builds an aggregate function expression.
func Arg ¶
Arg creates an expression that represents an argument that will be bound to a placeholder with the given value. Each call to Arg will create a new placeholder and emit the argument when writing the query.
func Bind ¶
Bind creates an expression that represents an argument that will be bound to a placeholder with the given value. If Bind is called again with the same name, the same placeholder will be used.
func Build ¶
func Build(w builder.SQLWriter) *builder.QueryBuilder
Build starts a new query builder based on the given SQLWriter. For executing the query, use qrbpgx.Build or qrbsql.Build which can set an executor specific to a driver.
func DeleteFrom ¶
func DeleteFrom(tableName string) builder.DeleteBuilder
func Exps ¶
Exps returns a slice of expressions, just for syntactic sugar. TODO We could use this as a way to express a scalar list of expressions e.g. for IN by using a custom slice type
func Func ¶
func Func(name string, args ...builder.Exp) builder.FuncBuilder
Func is a function call expression.
func InsertInto ¶
func InsertInto(tableName string) builder.InsertBuilder
func N ¶
N writes the given name / identifier.
It will validate the identifier when writing the query, but it will not detect all invalid identifiers that are invalid in PostgreSQL (especially considering reserved keywords).
func RowsFrom ¶
func RowsFrom(fn builder.FuncBuilder, fns ...builder.FuncBuilder) builder.RowsFromBuilder
func Select ¶
func Select(exps ...builder.Exp) builder.SelectSelectBuilder
Select the given output expressions for the select list and start a new SelectBuilder.
func SelectJson ¶
func SelectJson(obj builder.JsonBuildObjectBuilder) builder.SelectJsonSelectBuilder
SelectJson sets the JSON selection for this select builder.
It will always be the first element in the select list. It can be modified later by SelectBuilder.ApplySelectJson.
func Update ¶
func Update(tableName string) builder.UpdateBuilder
func With ¶
func With(queryName string) builder.WithWithBuilder
With starts a new builder with the given WITH query. Call WithBuilder.As to define the query.
func WithRecursive ¶
func WithRecursive(queryName string) builder.WithWithBuilder
WithRecursive starts a new builder with the given WITH RECURSIVE query.
Types ¶
This section is empty.