sm

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 4 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Columns

func Columns(clauses ...any) bob.Mod[*dialect.SelectQuery]

func CrossJoin

func CrossJoin(e any) dialect.JoinChain[*dialect.SelectQuery]

func Cube added in v0.44.0

func Cube(groups ...any) clause.GroupingSet

func Distinct

func Distinct(on ...any) bob.Mod[*dialect.SelectQuery]

func Except

func Except(q bob.Query) bob.Mod[*dialect.SelectQuery]

func ExceptAll

func ExceptAll(q bob.Query) bob.Mod[*dialect.SelectQuery]

func Fetch

func Fetch(count any, withTies bool) bob.Mod[*dialect.SelectQuery]

func FetchCombined added in v0.39.0

func FetchCombined(count any, withTies bool) bob.Mod[*dialect.SelectQuery]

To apply fetch to the result of a UNION, INTERSECT, or EXCEPT query

func ForKeyShare

func ForKeyShare(tables ...any) dialect.LockChain[*dialect.SelectQuery]

ForKeyShare acquires a key-share lock on selected tables.

func ForNoKeyUpdate

func ForNoKeyUpdate(tables ...any) dialect.LockChain[*dialect.SelectQuery]

ForNoKeyUpdate locks selected tables without affecting key columns.

func ForShare

func ForShare(tables ...any) dialect.LockChain[*dialect.SelectQuery]

ForShare acquires a shared lock on selected tables.

func ForUpdate

func ForUpdate(tables ...any) dialect.LockChain[*dialect.SelectQuery]

ForUpdate locks selected tables. Pass table names as psql.Quote(...) or another Expression.

func From

From sets the query source. Pass a table name as a string (unquoted literal) or use psql.Quote(...) / a subquery Expression for quoted or qualified names. Optional joins are attached to this from_item.

func FromFunction

func FromFunction(funcs ...*dialect.Function) bob.Expression

FromFunction returns an expression for sm.From when the source is one or more table functions (ROWS FROM when multiple).

func FullJoin

func FullJoin(e any) dialect.JoinChain[*dialect.SelectQuery]

func GroupBy

func GroupBy(e any) bob.Mod[*dialect.SelectQuery]

func GroupByDistinct

func GroupByDistinct(distinct bool) bob.Mod[*dialect.SelectQuery]

func Grouping added in v0.44.0

func Grouping(groups ...any) clause.Grouping

func GroupingSets added in v0.44.0

func GroupingSets(groups ...any) clause.GroupingSet

func Having

func Having(e any) bob.Mod[*dialect.SelectQuery]

func InnerJoin

func InnerJoin(e any) dialect.JoinChain[*dialect.SelectQuery]

func Intersect

func Intersect(q bob.Query) bob.Mod[*dialect.SelectQuery]

func IntersectAll

func IntersectAll(q bob.Query) bob.Mod[*dialect.SelectQuery]

func LeftJoin

func LeftJoin(e any) dialect.JoinChain[*dialect.SelectQuery]

func Limit

func Limit(count any) bob.Mod[*dialect.SelectQuery]

func LimitCombined added in v0.39.0

func LimitCombined(count any) bob.Mod[*dialect.SelectQuery]

To apply limit to the result of a UNION, INTERSECT, or EXCEPT query

func Offset

func Offset(count any) bob.Mod[*dialect.SelectQuery]

func OffsetCombined added in v0.39.0

func OffsetCombined(count any) bob.Mod[*dialect.SelectQuery]

To apply offset to the result of a UNION, INTERSECT, or EXCEPT query

func OrderBy

func OrderBy(e any) dialect.OrderBy[*dialect.SelectQuery]

func OrderCombined added in v0.39.0

func OrderCombined(e any) dialect.OrderCombined

To apply order to the result of a UNION, INTERSECT, or EXCEPT query

func Recursive

func Recursive(r bool) bob.Mod[*dialect.SelectQuery]

func RightJoin

func RightJoin(e any) dialect.JoinChain[*dialect.SelectQuery]

func Rollup added in v0.44.0

func Rollup(groups ...any) clause.GroupingSet

func Union

func Union(q bob.Query) bob.Mod[*dialect.SelectQuery]

func UnionAll

func UnionAll(q bob.Query) bob.Mod[*dialect.SelectQuery]

func Window

func Window(name string, winMods ...bob.Mod[*clause.Window]) bob.Mod[*dialect.SelectQuery]

Window defines a named window for the query. The name is quoted as an SQL identifier.

func With

func With(name string, columns ...string) dialect.CTEChain[*dialect.SelectQuery]

With starts a CTE. The name and column list are quoted as SQL identifiers.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL