Documentation
¶
Index ¶
- func Excluded(column string) dialect.Expression
- func Into(name any, columns ...string) bob.Mod[*dialect.InsertQuery]
- func IntoAs(name any, alias string, columns ...string) bob.Mod[*dialect.InsertQuery]
- func OnConflict(columns ...any) mods.Conflict[*dialect.InsertQuery]
- func OnConflictOnConstraint(constraint string) mods.Conflict[*dialect.InsertQuery]
- func OverridingSystem() bob.Mod[*dialect.InsertQuery]
- func OverridingUser() bob.Mod[*dialect.InsertQuery]
- func Query(q bob.Query) bob.Mod[*dialect.InsertQuery]
- func Recursive(r bool) bob.Mod[*dialect.InsertQuery]
- func Returning(clauses ...any) mods.Returning[*dialect.InsertQuery]
- func Rows(rows ...[]bob.Expression) bob.Mod[*dialect.InsertQuery]
- func Set(sets ...bob.Expression) bob.Mod[*clause.ConflictClause]
- func SetCol(from string) mods.Set[*clause.ConflictClause]
- func SetCols(columns ...string) dialect.SetCols[*clause.ConflictClause]
- func SetExcluded(cols ...string) bob.Mod[*clause.ConflictClause]
- func SetExpr(col bob.Expression) mods.Set[*clause.ConflictClause]
- func Values(clauses ...bob.Expression) bob.Mod[*dialect.InsertQuery]
- func Where(e bob.Expression) bob.Mod[*clause.ConflictClause]
- func With(name string, columns ...string) dialect.CTEChain[*dialect.InsertQuery]
- type ConflictTargetExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Excluded ¶ added in v0.44.0
func Excluded(column string) dialect.Expression
Excluded references a column from the EXCLUDED pseudo-table in ON CONFLICT DO UPDATE.
SQL: EXCLUDED."col"
Go: im.Excluded("col")
func Into ¶
Into sets the insert target. Use psql.Quote(...) for quoted table names; column names in columns are quoted automatically.
func OnConflict ¶
func OnConflict(columns ...any) mods.Conflict[*dialect.InsertQuery]
OnConflict starts an ON CONFLICT clause. Pass conflict target columns as psql.Quote(...) or another Expression; strings are written as raw SQL.
func OnConflictOnConstraint ¶
func OnConflictOnConstraint(constraint string) mods.Conflict[*dialect.InsertQuery]
func OverridingSystem ¶
func OverridingSystem() bob.Mod[*dialect.InsertQuery]
func OverridingUser ¶
func OverridingUser() bob.Mod[*dialect.InsertQuery]
func Rows ¶
func Rows(rows ...[]bob.Expression) bob.Mod[*dialect.InsertQuery]
func Set ¶ added in v0.23.0
func Set(sets ...bob.Expression) bob.Mod[*clause.ConflictClause]
func SetCol ¶ added in v0.23.0
func SetCol(from string) mods.Set[*clause.ConflictClause]
SetCol sets one column in ON CONFLICT DO UPDATE SET. The column name is quoted automatically. For qualified names or other expressions on the LHS, use SetExpr.
func SetCols ¶ added in v0.44.0
func SetCols(columns ...string) dialect.SetCols[*clause.ConflictClause]
SetCols creates a multi-column setter: (columns...) = ROW(...) | (values...) | (subquery)
func SetExcluded ¶ added in v0.23.0
func SetExcluded(cols ...string) bob.Mod[*clause.ConflictClause]
func SetExpr ¶ added in v0.45.0
func SetExpr(col bob.Expression) mods.Set[*clause.ConflictClause]
SetExpr is like SetCol but the column LHS is any expression (e.g. psql.Quote("t", "col")).
func Values ¶
func Values(clauses ...bob.Expression) bob.Mod[*dialect.InsertQuery]
func Where ¶ added in v0.23.0
func Where(e bob.Expression) bob.Mod[*clause.ConflictClause]
Types ¶
type ConflictTargetExpr ¶ added in v0.44.0
type ConflictTargetExpr struct {
// contains filtered or unexported fields
}
ConflictTargetExpr is a chainable helper expression for a single ON CONFLICT target item, e.g. email COLLATE "en_US" text_pattern_ops.
Values built by this helper are passed directly to OnConflict(...).
func ConflictTarget ¶ added in v0.44.0
func ConflictTarget(target any) ConflictTargetExpr
ConflictTarget creates a helper for a single ON CONFLICT target item.
The target is rendered as provided. This can be a column-like item ("email") or an expression (psql.Raw("lower(email)")). If extra grouping is needed, pass a grouped expression explicitly.
func (ConflictTargetExpr) Collate ¶ added in v0.44.0
func (c ConflictTargetExpr) Collate(collation any) ConflictTargetExpr
Collate appends COLLATE <name> for this target item.
The collation can be provided as a string token or any bob.Expression.
func (ConflictTargetExpr) OpClass ¶ added in v0.44.0
func (c ConflictTargetExpr) OpClass(opClass any) ConflictTargetExpr
OpClass appends an operator class token for this target item.
The operator class can be provided as a string token or any bob.Expression.