dialect

package
v0.42.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialect dialect

Functions

This section is empty.

Types

type CTEChain

type CTEChain[Q interface{ AppendCTE(bob.Expression) }] func() clause.CTE

func With

func With[Q interface{ AppendCTE(bob.Expression) }](name string, columns ...string) CTEChain[Q]

func (CTEChain[Q]) Apply

func (c CTEChain[Q]) Apply(q Q)

func (CTEChain[Q]) As

func (c CTEChain[Q]) As(q bob.Query) CTEChain[Q]

func (CTEChain[Q]) Cycle

func (c CTEChain[Q]) Cycle(set, using string, cols ...string) CTEChain[Q]

func (CTEChain[Q]) CycleValue

func (c CTEChain[Q]) CycleValue(value, defaultVal any) CTEChain[Q]

func (CTEChain[Q]) Materialized

func (c CTEChain[Q]) Materialized() CTEChain[Q]

func (CTEChain[Q]) NotMaterialized

func (c CTEChain[Q]) NotMaterialized() CTEChain[Q]

func (CTEChain[Q]) SearchBreadth

func (c CTEChain[Q]) SearchBreadth(setCol string, searchCols ...string) CTEChain[Q]

func (CTEChain[Q]) SearchDepth

func (c CTEChain[Q]) SearchDepth(setCol string, searchCols ...string) CTEChain[Q]

type CrossJoinChain

type CrossJoinChain[Q Joinable] func() clause.Join

func CrossJoin

func CrossJoin[Q Joinable](e any) CrossJoinChain[Q]

func (CrossJoinChain[Q]) Apply

func (j CrossJoinChain[Q]) Apply(q Q)

func (CrossJoinChain[Q]) As

func (j CrossJoinChain[Q]) As(alias string, columns ...string) bob.Mod[Q]

type DeleteQuery

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-delete.html

func (DeleteQuery) WriteSQL

func (d DeleteQuery) WriteSQL(ctx context.Context, w io.StringWriter, dl bob.Dialect, start int) ([]any, error)

type Distinct

type Distinct struct {
	On []any
}

func (Distinct) WriteSQL

func (di Distinct) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type Expression

type Expression struct {
	expr.Chain[Expression, Expression]
}

func NewExpression

func NewExpression(exp bob.Expression) Expression

func (Expression) BetweenSymmetric

func (x Expression) BetweenSymmetric(a, b bob.Expression) Expression

BETWEEN SYMMETRIC a AND b

func (Expression) ILike

func (x Expression) ILike(val bob.Expression) Expression

ILIKE val

func (Expression) New

func (Expression) NotBetweenSymmetric

func (x Expression) NotBetweenSymmetric(a, b bob.Expression) Expression

NOT BETWEEN SYMMETRIC a AND b

func (Expression) String

func (x Expression) String() string

Implements fmt.Stringer()

type FromChain

type FromChain[Q fromable] func() clause.TableRef

func From

func From[Q fromable](table any) FromChain[Q]

func (FromChain[Q]) Apply

func (f FromChain[Q]) Apply(q Q)

func (FromChain[Q]) As

func (f FromChain[Q]) As(alias string, columns ...string) FromChain[Q]

func (FromChain[Q]) Lateral

func (f FromChain[Q]) Lateral() FromChain[Q]

func (FromChain[Q]) Only

func (f FromChain[Q]) Only() FromChain[Q]

func (FromChain[Q]) WithOrdinality

func (f FromChain[Q]) WithOrdinality() FromChain[Q]

type Function

type Function struct {
	Distinct    bool
	WithinGroup bool
	clause.OrderBy
	Filter []any

	Alias   string // used when there should be an alias before the columns
	Columns []columnDef

	expr.Chain[Expression, Expression]
	// contains filtered or unexported fields
}

func NewFunction

func NewFunction(name string, args ...any) *Function

func (*Function) AppendColumn

func (f *Function) AppendColumn(name, datatype string)

func (*Function) SetWindow

func (f *Function) SetWindow(w clause.Window)

func (*Function) WriteSQL

func (f *Function) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type Functions

type Functions []*Function

func (Functions) WriteSQL

func (f Functions) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type InsertQuery

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-insert.html

func (InsertQuery) WriteSQL

func (i InsertQuery) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type JoinChain

type JoinChain[Q Joinable] func() clause.Join

func FullJoin

func FullJoin[Q Joinable](e any) JoinChain[Q]

func InnerJoin

func InnerJoin[Q Joinable](e any) JoinChain[Q]

func Join

func Join[Q Joinable](typ string, e any) JoinChain[Q]

func LeftJoin

func LeftJoin[Q Joinable](e any) JoinChain[Q]

func RightJoin

func RightJoin[Q Joinable](e any) JoinChain[Q]

func (JoinChain[Q]) Apply

func (j JoinChain[Q]) Apply(q Q)

func (JoinChain[Q]) As

func (j JoinChain[Q]) As(alias string, columns ...string) JoinChain[Q]

func (JoinChain[Q]) Lateral

func (f JoinChain[Q]) Lateral() JoinChain[Q]

func (JoinChain[Q]) Natural

func (j JoinChain[Q]) Natural() bob.Mod[Q]

func (JoinChain[Q]) On

func (j JoinChain[Q]) On(on ...bob.Expression) bob.Mod[Q]

func (JoinChain[Q]) OnEQ

func (j JoinChain[Q]) OnEQ(a, b bob.Expression) bob.Mod[Q]

func (JoinChain[Q]) Only

func (f JoinChain[Q]) Only() JoinChain[Q]

func (JoinChain[Q]) Using

func (j JoinChain[Q]) Using(using ...string) bob.Mod[Q]

func (JoinChain[Q]) WithOrdinality

func (f JoinChain[Q]) WithOrdinality() JoinChain[Q]

type Joinable

type Joinable interface{ AppendJoin(clause.Join) }

type LockChain

type LockChain[Q interface{ AppendLock(bob.Expression) }] func() clause.Lock

func (LockChain[Q]) Apply

func (l LockChain[Q]) Apply(q Q)

func (LockChain[Q]) NoWait

func (l LockChain[Q]) NoWait() LockChain[Q]

func (LockChain[Q]) SkipLocked

func (l LockChain[Q]) SkipLocked() LockChain[Q]

type OrderBy

type OrderBy[Q interface{ AppendOrder(bob.Expression) }] func() clause.OrderDef

func (OrderBy[Q]) Apply

func (s OrderBy[Q]) Apply(q Q)

func (OrderBy[Q]) Asc

func (o OrderBy[Q]) Asc() OrderBy[Q]

func (OrderBy[Q]) Collate

func (o OrderBy[Q]) Collate(collationName string) OrderBy[Q]

func (OrderBy[Q]) Desc

func (o OrderBy[Q]) Desc() OrderBy[Q]

func (OrderBy[Q]) NullsFirst

func (o OrderBy[Q]) NullsFirst() OrderBy[Q]

func (OrderBy[Q]) NullsLast

func (o OrderBy[Q]) NullsLast() OrderBy[Q]

func (OrderBy[Q]) Using

func (o OrderBy[Q]) Using(operator string) OrderBy[Q]

type OrderCombined

type OrderCombined OrderBy[*SelectQuery]

func (OrderCombined) Apply

func (o OrderCombined) Apply(q *SelectQuery)

type RowValue

type RowValue []bob.Expression

func (RowValue) WriteSQL

func (v RowValue) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type SelectQuery

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-select.html

func (SelectQuery) WriteSQL

func (s SelectQuery) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type UpdateQuery

Trying to represent the select query structure as documented in https://www.postgresql.org/docs/current/sql-update.html

func (UpdateQuery) WriteSQL

func (u UpdateQuery) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

type ValuesQuery

type ValuesQuery struct {
	// rows of VALUES query
	// each sub-slice is one set of values
	RowVals []RowValue

	clause.OrderBy
	clause.Limit
	clause.Offset
	clause.Fetch
}

Trying to represent the values query structure as doumented in https://www.postgresql.org/docs/current/sql-values.html

func (*ValuesQuery) AppendValues

func (v *ValuesQuery) AppendValues(vals ...bob.Expression)

func (ValuesQuery) WriteSQL

func (v ValuesQuery) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error)

Jump to

Keyboard shortcuts

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