Documentation ¶
Index ¶
- Constants
- Variables
- type CTE
- type CTECycle
- type CTESearch
- type Columns
- type Combine
- type DeleteFrom
- type DeleteOnly
- type Distinct
- type Frame
- type From
- type GroupBy
- func (c *GroupBy) ClauseID() string
- func (c *GroupBy) ClauseMerge(other litsql.QueryClause) error
- func (c *GroupBy) ClauseOrder() int
- func (g *GroupBy) SetGroupByDistinct(distinct bool)
- func (g *GroupBy) SetGroupWith(with string)
- func (g *GroupBy) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- type Having
- type InsertConflict
- func (c *InsertConflict) ClauseID() string
- func (c *InsertConflict) ClauseOrder() int
- func (c *InsertConflict) SetDoNothing()
- func (c *InsertConflict) SetDoUpdate()
- func (c *InsertConflict) SetWhere(condition litsql.Expression)
- func (c *InsertConflict) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- type InsertConflictTarget
- type InsertOverriding
- type Join
- func (c *Join) ClauseID() string
- func (c *Join) ClauseMultiple()
- func (c *Join) ClauseOrder() int
- func (c *Join) SetNatural()
- func (c *Join) SetOn(on string)
- func (c *Join) SetOnClause(query string, args ...any)
- func (c *Join) SetOnExpr(on litsql.Expression)
- func (c *Join) SetUsing(using ...string)
- func (c *Join) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- type Limit
- type NamedWindow
- type Offset
- type OrderBy
- type RawQuery
- type Returning
- type Set
- type Table
- type UpdateOnly
- type Value
- type Values
- type Where
- type WindowDef
- type Windows
- type With
Constants ¶
View Source
const ( Union = "UNION" Intersect = "INTERSECT" Except = "EXCEPT" )
View Source
const ( SearchBreadth = "BREADTH" SearchDepth = "DEPTH" )
Variables ¶
View Source
var ErrNoCombinationStrategy = internal.NewClauseError("Combination strategy must be set")
Functions ¶
This section is empty.
Types ¶
type CTE ¶
type CTE struct { Query litsql.Query // SQL standard says only select, postgres allows insert/update/delete Name string Columns []litsql.Expression Materialized *bool Search CTESearch Cycle CTECycle }
func (*CTE) SetMaterialized ¶
func (c *CTE) SetMaterialized()
func (*CTE) SetNotMaterialized ¶
func (c *CTE) SetNotMaterialized()
type CTECycle ¶
type CTECycle struct { Columns []string Set string Using string SetVal litsql.Expression DefaultVal litsql.Expression }
type Columns ¶
type Columns struct {
Columns []litsql.Expression
}
func (*Columns) ClauseMerge ¶
func (c *Columns) ClauseMerge(other litsql.QueryClause) error
func (*Columns) ClauseOrder ¶
type Combine ¶
func (*Combine) ClauseMultiple ¶
func (c *Combine) ClauseMultiple()
func (*Combine) ClauseOrder ¶
type DeleteFrom ¶
type DeleteFrom struct {
Table string
}
func (*DeleteFrom) ClauseID ¶ added in v0.2.0
func (c *DeleteFrom) ClauseID() string
func (*DeleteFrom) ClauseOrder ¶
func (c *DeleteFrom) ClauseOrder() int
type DeleteOnly ¶
type DeleteOnly struct {
Only bool
}
func (*DeleteOnly) ClauseID ¶ added in v0.2.0
func (c *DeleteOnly) ClauseID() string
func (*DeleteOnly) ClauseOrder ¶
func (c *DeleteOnly) ClauseOrder() int
type Distinct ¶
type Distinct struct {
On []litsql.Expression
}
func (*Distinct) ClauseMerge ¶
func (c *Distinct) ClauseMerge(other litsql.QueryClause) error
func (*Distinct) ClauseOrder ¶
type Frame ¶
type Frame struct { Defined bool // whether any of the parts was defined Mode string Start litsql.Expression End litsql.Expression // can be nil Exclusion string // can be empty }
func (*Frame) SetEnd ¶
func (f *Frame) SetEnd(end litsql.Expression)
func (*Frame) SetExclusion ¶
func (*Frame) SetStart ¶
func (f *Frame) SetStart(start litsql.Expression)
type From ¶
type From struct { Table litsql.Expression Starter bool Clause string // Aliases Alias string AliasColumns []string // Dialect specific modifiers Only bool // Postgres Lateral bool // Postgres & MySQL WithOrdinality bool // Postgres }
func (*From) ClauseOrder ¶
func (*From) SetLateral ¶
func (f *From) SetLateral()
func (*From) SetWithOrdinality ¶
func (f *From) SetWithOrdinality()
type GroupBy ¶
type GroupBy struct { Groups []litsql.Expression Distinct bool With string // ROLLUP | CUBE }
func (*GroupBy) ClauseMerge ¶
func (c *GroupBy) ClauseMerge(other litsql.QueryClause) error
func (*GroupBy) ClauseOrder ¶
func (*GroupBy) SetGroupByDistinct ¶
func (*GroupBy) SetGroupWith ¶
type Having ¶
type Having struct {
Conditions []litsql.Expression
}
func (*Having) ClauseMerge ¶
func (c *Having) ClauseMerge(other litsql.QueryClause) error
func (*Having) ClauseOrder ¶
type InsertConflict ¶
type InsertConflict struct { Do string // DO NOTHING | DO UPDATE Target InsertConflictTarget Set Set Where Where }
func (*InsertConflict) ClauseID ¶ added in v0.2.0
func (c *InsertConflict) ClauseID() string
func (*InsertConflict) ClauseOrder ¶
func (c *InsertConflict) ClauseOrder() int
func (*InsertConflict) SetDoNothing ¶
func (c *InsertConflict) SetDoNothing()
func (*InsertConflict) SetDoUpdate ¶
func (c *InsertConflict) SetDoUpdate()
func (*InsertConflict) SetWhere ¶
func (c *InsertConflict) SetWhere(condition litsql.Expression)
type InsertConflictTarget ¶
type InsertConflictTarget struct { Constraint string Columns []string Where []litsql.Expression }
type InsertOverriding ¶
type InsertOverriding struct {
Overriding string
}
func (*InsertOverriding) ClauseID ¶ added in v0.2.0
func (c *InsertOverriding) ClauseID() string
func (*InsertOverriding) ClauseOrder ¶
func (c *InsertOverriding) ClauseOrder() int
type Join ¶
type Join struct { Type string To *From // the expression for the table // Join methods Natural bool On []litsql.Expression Using []string }
func (*Join) ClauseMultiple ¶
func (c *Join) ClauseMultiple()
func (*Join) ClauseOrder ¶
func (*Join) SetNatural ¶
func (c *Join) SetNatural()
func (*Join) SetOnClause ¶ added in v0.8.0
func (*Join) SetOnExpr ¶ added in v0.8.0
func (c *Join) SetOnExpr(on litsql.Expression)
type NamedWindow ¶
type OrderBy ¶
type OrderBy struct {
Expressions []litsql.Expression
}
func (*OrderBy) ClauseMerge ¶
func (c *OrderBy) ClauseMerge(other litsql.QueryClause) error
func (*OrderBy) ClauseOrder ¶
type RawQuery ¶ added in v0.8.1
type RawQuery struct { Query litsql.Expression Args []any }
func (*RawQuery) ClauseOrder ¶ added in v0.8.1
type Returning ¶
type Returning struct {
Expressions []litsql.Expression
}
func (*Returning) ClauseMerge ¶
func (c *Returning) ClauseMerge(other litsql.QueryClause) error
func (*Returning) ClauseOrder ¶
type Set ¶
type Set struct { Set []litsql.Expression Starter bool }
func (*Set) ClauseMerge ¶
func (c *Set) ClauseMerge(other litsql.QueryClause) error
func (*Set) ClauseOrder ¶
type Table ¶
type Table struct { Expression litsql.Expression Alias string Columns []string }
func (*Table) ClauseOrder ¶
type UpdateOnly ¶
type UpdateOnly struct {
Only bool
}
func (*UpdateOnly) ClauseID ¶ added in v0.2.0
func (c *UpdateOnly) ClauseID() string
func (*UpdateOnly) ClauseOrder ¶
func (c *UpdateOnly) ClauseOrder() int
type Value ¶
type Value []litsql.Expression
type Values ¶
type Values struct { // Query takes the highest priority // If present, will attempt to insert from this query Query litsql.Query // for multiple inserts // each sub-slice is one set of values Vals []Value }
func (*Values) ClauseMerge ¶
func (c *Values) ClauseMerge(other litsql.QueryClause) error
func (*Values) ClauseOrder ¶
type Where ¶
type Where struct {
Conditions []litsql.Expression
}
func (*Where) ClauseMerge ¶
func (c *Where) ClauseMerge(other litsql.QueryClause) error
func (*Where) ClauseOrder ¶
type WindowDef ¶
type WindowDef struct { From string // an existing window name OrderBy []litsql.Expression PartitionBy []litsql.Expression Frame }
func (*WindowDef) AddOrderBy ¶
func (wd *WindowDef) AddOrderBy(order ...litsql.Expression)
func (*WindowDef) AddPartitionBy ¶
func (wd *WindowDef) AddPartitionBy(condition ...litsql.Expression)
type Windows ¶
type Windows struct {
Windows []*NamedWindow
}
func (*Windows) ClauseMerge ¶
func (c *Windows) ClauseMerge(other litsql.QueryClause) error
func (*Windows) ClauseOrder ¶
type With ¶
func (*With) ClauseMerge ¶
func (c *With) ClauseMerge(other litsql.QueryClause) error
func (*With) ClauseOrder ¶
func (*With) SetRecursive ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.