Documentation
¶
Index ¶
- Constants
- Variables
- type CTE
- type CTECycle
- type CTESearch
- type Combine
- type Combines
- type Conflict
- type ConflictClause
- type ConflictTarget
- type Fetch
- type Frame
- type GroupBy
- type GroupingSet
- type Having
- type IndexHint
- type Join
- type Limit
- type Lock
- type Locks
- type NamedWindow
- type Offset
- type OrderBy
- type OrderDef
- type Returning
- type SelectList
- func (s *SelectList) AppendPreloadSelect(columns ...any)
- func (s *SelectList) AppendSelect(columns ...any)
- func (s *SelectList) CountSelectCols() int
- func (s *SelectList) SetPreloadSelect(columns ...any)
- func (s *SelectList) SetSelect(columns ...any)
- func (s SelectList) WriteSQL(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error)
- type Set
- type TableRef
- func (f *TableRef) AppendIndexHint(i IndexHint)
- func (f *TableRef) AppendJoin(j Join)
- func (f *TableRef) AppendPartition(partitions ...string)
- func (f TableRef) As(alias string, columns ...string) TableRef
- func (f *TableRef) SetIndexedBy(i *string)
- func (f *TableRef) SetLateral(lateral bool)
- func (f *TableRef) SetOnly(only bool)
- func (f *TableRef) SetTable(table any)
- func (f *TableRef) SetTableAlias(alias string, columns ...string)
- func (f *TableRef) SetWithOrdinality(to bool)
- func (f TableRef) WriteSQL(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error)
- type Value
- type Values
- type Where
- type Window
- type Windows
- type With
Constants ¶
View Source
const ( Union = "UNION" Intersect = "INTERSECT" Except = "EXCEPT" )
View Source
const ( SearchBreadth = "BREADTH" SearchDepth = "DEPTH" )
View Source
const ( InnerJoin = "INNER JOIN" LeftJoin = "LEFT JOIN" RightJoin = "RIGHT JOIN" FullJoin = "FULL JOIN" CrossJoin = "CROSS JOIN" StraightJoin = "STRAIGHT_JOIN" )
View Source
const ( LockStrengthUpdate = "UPDATE" LockStrengthNoKeyUpdate = "NO KEY UPDATE" )
View Source
const ( LockWaitNoWait = "NOWAIT" LockWaitSkipLocked = "SKIP LOCKED" )
Variables ¶
View Source
var ErrNoCombinationStrategy = errors.New("combination strategy must be set")
View Source
var ErrNoLockStrength = errors.New("no lock strength specified")
Functions ¶
This section is empty.
Types ¶
type CTE ¶
type Combine ¶
func (*Combine) SetCombine ¶
type Combines ¶ added in v0.30.0
type Combines struct {
Queries []Combine
}
func (*Combines) AppendCombine ¶ added in v0.30.0
type Conflict ¶
type Conflict struct {
Expression bob.Expression
}
func (*Conflict) SetConflict ¶
func (c *Conflict) SetConflict(conflict bob.Expression)
type ConflictClause ¶ added in v0.33.0
type ConflictClause struct {
Do string // DO NOTHING | DO UPDATE
Target ConflictTarget
Set
Where
}
type ConflictTarget ¶
type Frame ¶
type Frame struct {
Defined bool // whether any of the parts was defined
Mode string
Start any
End any // can be nil
Exclusion string // can be empty
}
func (*Frame) SetExclusion ¶
type GroupBy ¶
func (*GroupBy) AppendGroup ¶
func (*GroupBy) SetGroupByDistinct ¶
func (*GroupBy) SetGroupWith ¶
type GroupingSet ¶
type GroupingSet struct {
Groups []bob.Expression
Type string // GROUPING SET | CUBE | ROLLUP
}
type IndexHint ¶
type Join ¶
type Limit ¶
type Limit struct {
// Some DBs (e.g. SQite) can take an expression
// It is up to the mods to enforce any extra conditions
Count any
}
type Locks ¶ added in v0.32.0
type Locks struct {
Locks []bob.Expression
}
func (*Locks) AppendLock ¶ added in v0.32.0
func (f *Locks) AppendLock(lock bob.Expression)
type NamedWindow ¶
type Offset ¶
type Offset struct {
// Some DBs (e.g. SQite) can take an expression
// It is up to the mods to enforce any extra conditions
Count any
}
type OrderBy ¶
type OrderBy struct {
Expressions []bob.Expression
}
func (*OrderBy) AppendOrder ¶
func (o *OrderBy) AppendOrder(order bob.Expression)
func (*OrderBy) ClearOrderBy ¶ added in v0.32.0
func (o *OrderBy) ClearOrderBy()
type OrderDef ¶
type Returning ¶
type Returning struct {
Expressions []any
}
func (*Returning) AppendReturning ¶
func (*Returning) HasReturning ¶ added in v0.22.0
type SelectList ¶ added in v0.7.0
type SelectList struct {
Columns []any
// necessary to be able to treat preloaders
// like any other query Mod
PreloadColumns []any
}
func (*SelectList) AppendPreloadSelect ¶ added in v0.20.0
func (s *SelectList) AppendPreloadSelect(columns ...any)
func (*SelectList) AppendSelect ¶ added in v0.7.0
func (s *SelectList) AppendSelect(columns ...any)
func (*SelectList) CountSelectCols ¶ added in v0.20.0
func (s *SelectList) CountSelectCols() int
func (*SelectList) SetPreloadSelect ¶ added in v0.27.0
func (s *SelectList) SetPreloadSelect(columns ...any)
func (*SelectList) SetSelect ¶ added in v0.20.0
func (s *SelectList) SetSelect(columns ...any)
type TableRef ¶ added in v0.35.0
type TableRef struct {
Expression any
// Aliases
Alias string
Columns []string
// Dialect specific modifiers
Only bool // Postgres
Lateral bool // Postgres & MySQL
WithOrdinality bool // Postgres
IndexedBy *string // SQLite
Partitions []string // MySQL
IndexHints []IndexHint // MySQL
// Joins
Joins []Join
}
func (*TableRef) AppendIndexHint ¶ added in v0.35.0
func (*TableRef) AppendJoin ¶ added in v0.35.0
func (*TableRef) AppendPartition ¶ added in v0.35.0
func (*TableRef) SetIndexedBy ¶ added in v0.35.0
func (*TableRef) SetLateral ¶ added in v0.35.0
func (*TableRef) SetTableAlias ¶ added in v0.35.0
func (*TableRef) SetWithOrdinality ¶ added in v0.35.0
type Value ¶ added in v0.29.0
type Value []bob.Expression
type Values ¶
type Values struct {
// Query takes the highest priority
// If present, will attempt to insert from this query
Query bob.Query
// for multiple inserts
// each sub-slice is one set of values
Vals []Value
}
func (*Values) AppendValues ¶
func (v *Values) AppendValues(vals ...bob.Expression)
type Window ¶ added in v0.27.0
type Window struct {
BasedOn string // an existing window name
OrderBy
Frame
// contains filtered or unexported fields
}
func (*Window) AddPartitionBy ¶ added in v0.27.0
func (*Window) SetBasedOn ¶ added in v0.30.0
type Windows ¶
type Windows struct {
Windows []bob.Expression
}
func (*Windows) AppendWindow ¶
func (wi *Windows) AppendWindow(w bob.Expression)
type With ¶
type With struct {
Recursive bool
CTEs []bob.Expression
}
func (*With) AppendCTE ¶ added in v0.32.0
func (w *With) AppendCTE(cte bob.Expression)
func (*With) SetRecursive ¶
Click to show internal directories.
Click to hide internal directories.