dialect

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Dialect dialect
)

Functions

func OrAbort

func OrAbort[Q interface{ SetOr(string) }]() bob.Mod[Q]

func OrFail

func OrFail[Q interface{ SetOr(string) }]() bob.Mod[Q]

func OrIgnore

func OrIgnore[Q interface{ SetOr(string) }]() bob.Mod[Q]

func OrReplace

func OrReplace[Q interface{ SetOr(string) }]() bob.Mod[Q]

func OrRollback

func OrRollback[Q interface{ SetOr(string) }]() bob.Mod[Q]

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]) Materialized

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

func (CTEChain[Q]) NotMaterialized

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

type CrossJoinChain added in v0.29.0

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

func CrossJoin

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

func (CrossJoinChain[Q]) Apply added in v0.29.0

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

func (CrossJoinChain[Q]) As added in v0.29.0

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

type DeleteQuery added in v0.15.0

Trying to represent the select query structure as documented in https://www.sqlite.org/lang_delete.html

func (DeleteQuery) WriteSQL added in v0.15.0

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

type Expression

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

func (Expression) New

func (Expression) String

func (x Expression) String() string

Implements fmt.Stringer()

type FromChain added in v0.7.0

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

func From added in v0.7.0

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

func (FromChain[Q]) Apply added in v0.7.0

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

func (FromChain[Q]) As added in v0.7.0

func (f FromChain[Q]) As(alias string) FromChain[Q]

func (FromChain[Q]) IndexedBy added in v0.7.0

func (f FromChain[Q]) IndexedBy(indexName string) bob.Mod[Q]

func (FromChain[Q]) NotIndexed added in v0.7.0

func (f FromChain[Q]) NotIndexed() bob.Mod[Q]

type Function

type Function struct {

	// Used in value functions. Supported by Sqlite and Postgres
	Distinct bool
	clause.OrderBy
	Filter []any

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

func NewFunction

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

func (*Function) SetWindow added in v0.27.0

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

func (Function) WriteSQL

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

type InsertQuery added in v0.15.0

type InsertQuery struct {
	clause.With

	clause.Table
	clause.Values
	clause.Conflict
	clause.Returning
	bob.EmbeddedHook
	bob.ContextualModdable[*InsertQuery]
	// contains filtered or unexported fields
}

Trying to represent the select query structure as documented in https://www.sqlite.org/lang_insert.html

func (*InsertQuery) SetOr added in v0.15.0

func (o *InsertQuery) SetOr(to string)

func (InsertQuery) WriteSQL added in v0.15.0

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

type JoinChain

type JoinChain[Q interface{ AppendJoin(clause.Join) }] 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 added in v0.17.0

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) JoinChain[Q]

func (JoinChain[Q]) IndexedBy added in v0.20.0

func (f JoinChain[Q]) IndexedBy(indexName string) bob.Mod[Q]

func (JoinChain[Q]) Natural

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

func (JoinChain[Q]) NotIndexed added in v0.20.0

func (f JoinChain[Q]) NotIndexed() 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]) Using

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

type Joinable added in v0.17.0

type Joinable interface{ AppendJoin(clause.Join) }

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]

type SelectQuery added in v0.15.0

Trying to represent the select query structure as documented in https://www.sqlite.org/lang_select.html

func (SelectQuery) WriteSQL added in v0.15.0

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

type UpdateQuery added in v0.15.0

type UpdateQuery struct {
	clause.With

	Table clause.From
	clause.Set
	clause.From
	clause.Where
	clause.Returning
	bob.Load
	bob.EmbeddedHook
	bob.ContextualModdable[*UpdateQuery]
	// contains filtered or unexported fields
}

Trying to represent the select query structure as documented in https://www.sqlite.org/lang_update.html

func (*UpdateQuery) SetOr added in v0.15.0

func (o *UpdateQuery) SetOr(to string)

func (UpdateQuery) WriteSQL added in v0.15.0

func (u UpdateQuery) WriteSQL(ctx context.Context, w io.Writer, 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