Documentation ¶
Index ¶
- Constants
- Variables
- type CTE
- type CTECycle
- type CTESearch
- type Columns
- type Combine
- type DeleteFrom
- type DeleteOnly
- type Distinct
- 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 InsertConflictTarget
- type InsertConflictUpdate
- func (c *InsertConflictUpdate) ClauseID() string
- func (c *InsertConflictUpdate) ClauseOrder() int
- func (c *InsertConflictUpdate) SetDoNothing()
- func (c *InsertConflictUpdate) SetDoUpdate()
- func (c *InsertConflictUpdate) SetSet(assignment litsql.Expression)
- func (c *InsertConflictUpdate) SetWhere(condition litsql.Expression)
- func (c *InsertConflictUpdate) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- type InsertDuplicateKey
- func (c *InsertDuplicateKey) ClauseID() string
- func (c *InsertDuplicateKey) ClauseMerge(other litsql.QueryClause) error
- func (c *InsertDuplicateKey) ClauseOrder() int
- func (c *InsertDuplicateKey) SetSet(assignment litsql.Expression)
- func (c *InsertDuplicateKey) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- 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
- func (wd *WindowDef) AddOrderBy(order ...litsql.Expression)
- func (wd *WindowDef) AddPartitionBy(condition ...litsql.Expression)
- func (wd *WindowDef) SetFrame(frame litsql.Expression)
- func (wd *WindowDef) SetFrom(from string)
- func (wd *WindowDef) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)
- 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 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 InsertConflictTarget ¶
type InsertConflictTarget struct { Constraint string Columns []string Where []litsql.Expression }
type InsertConflictUpdate ¶ added in v0.9.1
type InsertConflictUpdate struct { Do string // DO NOTHING | DO UPDATE Target InsertConflictTarget Set Set Where Where }
func (*InsertConflictUpdate) ClauseID ¶ added in v0.9.1
func (c *InsertConflictUpdate) ClauseID() string
func (*InsertConflictUpdate) ClauseOrder ¶ added in v0.9.1
func (c *InsertConflictUpdate) ClauseOrder() int
func (*InsertConflictUpdate) SetDoNothing ¶ added in v0.9.1
func (c *InsertConflictUpdate) SetDoNothing()
func (*InsertConflictUpdate) SetDoUpdate ¶ added in v0.9.1
func (c *InsertConflictUpdate) SetDoUpdate()
func (*InsertConflictUpdate) SetSet ¶ added in v0.11.0
func (c *InsertConflictUpdate) SetSet(assignment litsql.Expression)
func (*InsertConflictUpdate) SetWhere ¶ added in v0.9.1
func (c *InsertConflictUpdate) SetWhere(condition litsql.Expression)
type InsertDuplicateKey ¶ added in v0.11.0
type InsertDuplicateKey struct {
Set Set
}
func (*InsertDuplicateKey) ClauseID ¶ added in v0.11.0
func (c *InsertDuplicateKey) ClauseID() string
func (*InsertDuplicateKey) ClauseMerge ¶ added in v0.11.0
func (c *InsertDuplicateKey) ClauseMerge(other litsql.QueryClause) error
func (*InsertDuplicateKey) ClauseOrder ¶ added in v0.11.0
func (c *InsertDuplicateKey) ClauseOrder() int
func (*InsertDuplicateKey) SetSet ¶ added in v0.11.0
func (c *InsertDuplicateKey) SetSet(assignment 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 SkipClause 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 litsql.Expression }
func (*WindowDef) AddOrderBy ¶
func (wd *WindowDef) AddOrderBy(order ...litsql.Expression)
func (*WindowDef) AddPartitionBy ¶
func (wd *WindowDef) AddPartitionBy(condition ...litsql.Expression)
func (*WindowDef) SetFrame ¶ added in v0.11.8
func (wd *WindowDef) SetFrame(frame 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.