Versions in this module Expand all Collapse all v0 v0.1.1 Oct 11, 2026 v0.1.0 Oct 11, 2026 Changes in this version + const LogicAnd + const OpEq + const OpIn + const OpNotIn + const SortAsc + const SortDesc + var ErrDuplicateAlias = errors.New("sqlb: duplicate table alias in one statement") + var ErrJoinWithoutFrom = errors.New("sqlb: select has joins but no FROM") + var ErrNoAssignments = errors.New("sqlb: statement has no assignments") + var ErrNoColumns = errors.New("sqlb: select has no columns") + var ErrNoReturning = errors.New("sqlb: dialect has no RETURNING; use the two-statement fallback") + var ErrNoTargets = errors.New("sqlb: query has select items without scan targets") + var ErrNoWhere = errors.New("sqlb: update or delete has no WHERE; call All() to affect every row") + var ErrNotAColumn = errors.New("sqlb: assignment target is not a column") + var ErrQueryInUse = errors.New(...) + var ErrRowWidth = errors.New("sqlb: insert row width differs from column list") + var ErrSetOpArity = errors.New("sqlb: set operation branches select different numbers of columns") + var ErrUnknownSlot = errors.New("sqlb: clause asks for a slot this statement does not render") + var ErrUnsupportedDialect = render.ErrUnsupportedDialect + var JoinTypeValues = []JoinType + var SlotValues = []Slot + func DialectName(d Dialect) string + func EngineGuard(a *Args, engine, construct string) bool + func EngineList(a *Args, items []SQLer) string + func QuoteList(d Dialect, names []string) string + func Targets(bs []Binding) []any + type AnyClause interface + Slot func() Slot + WriteSQL func(b *strings.Builder, args *Args) + type AnySelect = Select[render.Dialect] + type Args = render.Args + func NewArgs(d Dialect) *Args + type Assignment struct + func AssignTarget(col string, target func(a *Args) string, value SQLer) Assignment + func SetDefault[T any](col Expr[T]) Assignment + func SetExpr[T any](col Expr[T], e Expr[T]) Assignment + func Set[T any](col Expr[T], v T) Assignment + func (as Assignment) Column() string + func (as Assignment) SQL(a *Args) string + func (as Assignment) ValueSQL(a *Args) string + type Binding interface + ColumnName func() string + SQL func(a *Args) string + Target func() any + type CTE struct + Body Statement + Columns []string + Name string + Prefix SQLer + Suffix SQLer + type Clause interface + ClauseOf func(D, K) + func EngineClause[D render.Dialect, K any](construct string, slot Slot, render func(a *Args) string) Clause[D, K] + type Delete struct + func NewDelete[D render.Dialect](d D) *Delete[D] + func (x *Delete[D]) All() *FilteredDelete[D] + func (x *Delete[D]) Clause(cs ...Clause[D, DeleteKind]) *Delete[D] + func (x *Delete[D]) Clone() *Delete[D] + func (x *Delete[D]) Dialect() Dialect + func (x *Delete[D]) From(t Table) *Delete[D] + func (x *Delete[D]) Where(ps ...Predicate) *FilteredDelete[D] + func (x *Delete[D]) With(name string, body Statement) *Delete[D] + type DeleteKind struct + type Dialect = render.Dialect + type Expr = expr.Expr[T] + func EngineBinOp[R any](engine, construct, op string, l, r SQLer) Expr[R] + func EngineExpr[T any](engine, construct string, render func(a *Args) string) Expr[T] + func EngineFn[R any](engine, construct, name string, args ...SQLer) Expr[R] + func EngineLit[T any](engine, construct, sql string) Expr[T] + func New[T any](f func(a *Args) string) Expr[T] + func Param[T any](v T) Expr[T] + func Subquery[T any, D render.Dialect](s *Select[D]) Expr[*T] + type FilteredDelete struct + func DeleteReturning[D ReturningDialect](s *FilteredDelete[D], bs ...Binding) *FilteredDelete[D] + func (x *FilteredDelete[D]) Build() (Query, error) + func (x *FilteredDelete[D]) Clause(cs ...Clause[D, DeleteKind]) *FilteredDelete[D] + func (x *FilteredDelete[D]) Clone() *FilteredDelete[D] + func (x *FilteredDelete[D]) Dialect() Dialect + func (x *FilteredDelete[D]) Where(ps ...Predicate) *FilteredDelete[D] + func (x *FilteredDelete[D]) With(name string, body Statement) *FilteredDelete[D] + func (x *FilteredDelete[D]) WriteSQL(b *strings.Builder, args *Args) + type FilteredUpdate struct + func UpdateReturning[D ReturningDialect](s *FilteredUpdate[D], bs ...Binding) *FilteredUpdate[D] + func (u *FilteredUpdate[D]) Build() (Query, error) + func (u *FilteredUpdate[D]) Clause(cs ...Clause[D, UpdateKind]) *FilteredUpdate[D] + func (u *FilteredUpdate[D]) Clone() *FilteredUpdate[D] + func (u *FilteredUpdate[D]) Dialect() Dialect + func (u *FilteredUpdate[D]) Set(as ...Assignment) *FilteredUpdate[D] + func (u *FilteredUpdate[D]) Where(ps ...Predicate) *FilteredUpdate[D] + func (u *FilteredUpdate[D]) With(name string, body Statement) *FilteredUpdate[D] + func (u *FilteredUpdate[D]) WriteSQL(b *strings.Builder, args *Args) + type Guard struct + func NewGuard() Guard + type Insert struct + func NewInsert[D render.Dialect](d D) *Insert[D] + func (i *Insert[D]) Body(c Clause[D, InsertKind]) *InsertReady[D] + func (i *Insert[D]) Clause(cs ...Clause[D, InsertKind]) *Insert[D] + func (i *Insert[D]) Clone() *Insert[D] + func (i *Insert[D]) Columns(cols ...SQLer) *Insert[D] + func (i *Insert[D]) Dialect() Dialect + func (i *Insert[D]) Into(t Table) *Insert[D] + func (i *Insert[D]) Row(as ...Assignment) *InsertReady[D] + func (i *Insert[D]) Select(s *Select[D]) *InsertReady[D] + func (i *Insert[D]) With(name string, body Statement) *Insert[D] + type InsertAliasing = render.InsertAliasing + type InsertKind struct + type InsertReady struct + func InsertReturning[D ReturningDialect](s *InsertReady[D], bs ...Binding) *InsertReady[D] + func (i *InsertReady[D]) Build() (Query, error) + func (i *InsertReady[D]) Clause(cs ...Clause[D, InsertKind]) *InsertReady[D] + func (i *InsertReady[D]) Clone() *InsertReady[D] + func (i *InsertReady[D]) Dialect() Dialect + func (i *InsertReady[D]) Row(as ...Assignment) *InsertReady[D] + func (i *InsertReady[D]) With(name string, body Statement) *InsertReady[D] + func (i *InsertReady[D]) WriteSQL(b *strings.Builder, args *Args) + type Join struct + Clauses []AnyClause + On []Predicate + Source Source + Table Table + Type JoinType + Using []string + type JoinType string + const JoinCross + const JoinInner + const JoinLeft + const JoinRight + type Named = render.Named + type Option func(*selectCore) + func WithColumns(bs ...Binding) Option + func WithJoin(js ...Join) Option + func WithOrder(ts ...OrderTerm) Option + func WithWhere(ps ...Predicate) Option + type OrderTerm = expr.OrderTerm + type Predicate = expr.Predicate + func And(ps ...Predicate) Predicate + func EngineBinPred(engine, construct, op string, l, r SQLer) Predicate + func EnginePred(engine, construct string, render func(a *Args) string) Predicate + func Exists[D render.Dialect](s *Select[D]) Predicate + func InSubquery[T any, D render.Dialect](e Expr[T], s *Select[D]) Predicate + func NotExists[D render.Dialect](s *Select[D]) Predicate + func NotInSubquery[T any, D render.Dialect](e Expr[T], s *Select[D]) Predicate + func PredicateOf(f func(a *Args) string) Predicate + func SubqueryCompare[D render.Dialect](e SQLer, op, quantifier string, s *Select[D]) Predicate + type Query struct + Args []any + SQL string + Targets []any + func NewGuardedQuery(g Guard, sql string, args, targets []any) Query + func NewQuery(sql string, args, targets []any) Query + func (q Query) Acquire() bool + func (q Query) Release() + type Returning = render.Returning + type ReturningDialect interface + SupportsReturning func() bool + type SQLer = render.SQLer + func EngineQuoteLit(s string) SQLer + func EngineRaw(engine, construct string, render func(a *Args) string) SQLer + func Raw(f func(a *Args) string) SQLer + type Select struct + func NewSelect[D render.Dialect](d D) *Select[D] + func (s *Select[D]) Apply(opts ...Option) *Select[D] + func (s *Select[D]) Build() (Query, error) + func (s *Select[D]) Clause(cs ...Clause[D, SelectKind]) *Select[D] + func (s *Select[D]) Clone() *Select[D] + func (s *Select[D]) Columns(bs ...Binding) *Select[D] + func (s *Select[D]) Dialect() Dialect + func (s *Select[D]) Distinct() *Select[D] + func (s *Select[D]) Except(o *Select[D]) *Select[D] + func (s *Select[D]) Exprs(es ...SQLer) *Select[D] + func (s *Select[D]) From(src Source) *Select[D] + func (s *Select[D]) GroupBy(es ...SQLer) *Select[D] + func (s *Select[D]) Having(ps ...Predicate) *Select[D] + func (s *Select[D]) Intersect(o *Select[D]) *Select[D] + func (s *Select[D]) Join(js ...Join) *Select[D] + func (s *Select[D]) Limit(n int) *Select[D] + func (s *Select[D]) Offset(n int) *Select[D] + func (s *Select[D]) Order(ts ...OrderTerm) *Select[D] + func (s *Select[D]) SetOp(keyword string, o *Select[D]) *Select[D] + func (s *Select[D]) Union(o *Select[D]) *Select[D] + func (s *Select[D]) UnionAll(o *Select[D]) *Select[D] + func (s *Select[D]) Where(ps ...Predicate) *Select[D] + func (s *Select[D]) Window(name string, w Window) *Select[D] + func (s *Select[D]) With(name string, body Statement) *Select[D] + func (s *Select[D]) WithCTE(cte CTE) *Select[D] + func (s *Select[D]) WithRecursive(name string, seed, step *Select[D]) *Select[D] + func (s *Select[D]) WithRecursiveCTE(cte CTE) *Select[D] + func (s *Select[D]) WriteSQL(b *strings.Builder, args *Args) + type SelectKind struct + type Slot int + const SlotAfterColumns + const SlotAfterFrom + const SlotAfterGroupBy + const SlotAfterHaving + const SlotAfterInsert + const SlotAfterOffset + const SlotAfterOrder + const SlotAfterSelect + const SlotAfterSet + const SlotAfterTarget + const SlotAfterVerb + const SlotAfterWhere + const SlotBeforeOrder + const SlotBeforeValues + const SlotBeforeWhere + const SlotInsertBody + const SlotTail + func (s Slot) String() string + type SortDirection = expr.SortDirection + type Source = expr.Source + func EngineSource(engine, construct, alias string, render func(a *Args) string) Source + func SourceOf(alias string, f func(a *Args) string) Source + type Statement = expr.Statement + type Table = expr.Table + type Update struct + func NewUpdate[D render.Dialect](d D) *Update[D] + func (u *Update[D]) All() *FilteredUpdate[D] + func (u *Update[D]) Clause(cs ...Clause[D, UpdateKind]) *Update[D] + func (u *Update[D]) Clone() *Update[D] + func (u *Update[D]) Dialect() Dialect + func (u *Update[D]) Set(as ...Assignment) *Update[D] + func (u *Update[D]) Table(t Table) *Update[D] + func (u *Update[D]) Where(ps ...Predicate) *FilteredUpdate[D] + func (u *Update[D]) With(name string, body Statement) *Update[D] + type UpdateKind struct + type Window = expr.Window