Versions in this module Expand all Collapse all v0 v0.1.1 Oct 11, 2026 v0.1.0 Oct 11, 2026 Changes in this version + var DeleteReturning = sqlb.DeleteReturning[Dialect] + var ErrAddStored = errors.New("sqlb/sqlite: SQLite cannot add a STORED generated column") + var ErrEmptyModifier = errors.New("sqlb/sqlite: a time modifier cannot be empty") + var ErrEmptyName = errors.New("sqlb/sqlite: object has no name") + var ErrIncompleteSpec = errors.New("sqlb/sqlite: a JSON pair has no value") + var ErrMixedReferences = errors.New("sqlb/sqlite: a foreign key references one table") + var ErrModuleName = errors.New("sqlb/sqlite: a module name must be letters, digits and underscores") + var ErrNegativeTimeout = errors.New("sqlb/sqlite: busy_timeout cannot be negative") + var ErrNoModule = errors.New("sqlb/sqlite: a virtual table needs a module name") + var ErrPageSize = errors.New("sqlb/sqlite: page_size must be a power of two from 512 to 65536") + var ErrRTreeDims = errors.New("sqlb/sqlite: an R*Tree has one to five dimensions") + var ErrRebuildIncomplete = errors.New("sqlb/sqlite: a rebuild needs the old table, Into and at least one Copy") + var ErrRebuildSameName = errors.New("sqlb/sqlite: the rebuilt table needs a name of its own until the rename") + var ErrTemporaryQualified = errors.New("sqlb/sqlite: a temporary object cannot name a schema other than temp") + var ErrTemporaryTable = errors.New("sqlb/sqlite: a temporary table cannot name a schema other than temp") + var ErrUnknownKeyword = errors.New("sqlb/sqlite: value outside its named constants") + var InsertReturning = sqlb.InsertReturning[Dialect] + var UpdateReturning = sqlb.UpdateReturning[Dialect] + func Abs[T sqlb.Number](e sqlb.Expr[T]) sqlb.Expr[T] + func AutoincrementKey[T integer](col sqlb.Expr[T]) ddl.ColumnClause[Dialect] + func BM25(table sqlb.Table, weights ...float64) sqlb.Expr[float64] + func BinOp[R any](construct, op string, l, r sqlb.SQLer) sqlb.Expr[R] + func BinPred(construct, op string, l, r sqlb.SQLer) sqlb.Predicate + func Changes() sqlb.Expr[int64] + func ClauseIn[K any](slot sqlb.Slot, construct string, render func(a *sqlb.Args) string) sqlb.Clause[Dialect, K] + func ColumnCollate[T collatable](col sqlb.Expr[T], c Collation) ddl.ColumnClause[Dialect] + func Date(e sqlb.SQLer, mods ...Modifier) sqlb.Expr[string] + func DateTime(e sqlb.SQLer, mods ...Modifier) sqlb.Expr[string] + func Excluded[T any](col sqlb.Expr[T]) sqlb.Expr[T] + func Expr[T any](construct string, render func(a *sqlb.Args) string) sqlb.Expr[T] + func Format(format string, args ...sqlb.SQLer) sqlb.Expr[string] + func Func[R any](construct, name string, args ...sqlb.SQLer) sqlb.Expr[R] + func GeneratedStored[T any](col, e sqlb.Expr[T]) ddl.ColumnClause[Dialect] + func GeneratedVirtual[T any](col, e sqlb.Expr[T]) ddl.ColumnClause[Dialect] + func Glob(e sqlb.Expr[string], pattern string) sqlb.Predicate + func GroupConcat(e sqlb.Expr[string], sep string, opts ...sqlb.AggOption) sqlb.Expr[string] + func Guard(a *sqlb.Args, construct string) bool + func Hex(e sqlb.SQLer) sqlb.Expr[string] + func Highlight(table sqlb.Table, column int, openTag, closeTag string) sqlb.Expr[string] + func IIF[T any](cond sqlb.Predicate, then, els sqlb.Expr[T]) sqlb.Expr[T] + func IfNull[T any](a, b sqlb.Expr[T]) sqlb.Expr[T] + func Instr(haystack sqlb.Expr[string], needle string) sqlb.Expr[int32] + func Is(d sqlb.Dialect) bool + func IsEqual[T any](l, r sqlb.Expr[T]) sqlb.Predicate + func IsNot[T any](l, r sqlb.Expr[T]) sqlb.Predicate + func JSONArray(items ...sqlb.SQLer) sqlb.Expr[string] + func JSONArrayLength(e sqlb.Expr[string]) sqlb.Expr[int32] + func JSONArrayLengthAt(e sqlb.Expr[string], path string) sqlb.Expr[int32] + func JSONArrow(e sqlb.Expr[string], path string) sqlb.Expr[string] + func JSONArrowText(e sqlb.Expr[string], path string) sqlb.Expr[string] + func JSONEach(e sqlb.SQLer, alias string) sqlb.Source + func JSONExtract[R any](e sqlb.Expr[string], path string) sqlb.Expr[R] + func JSONGroupArray(e sqlb.SQLer, opts ...sqlb.AggOption) sqlb.Expr[string] + func JSONGroupObject(key, value sqlb.SQLer, opts ...sqlb.AggOption) sqlb.Expr[string] + func JSONInsert(e sqlb.Expr[string], path string, value sqlb.SQLer) sqlb.Expr[string] + func JSONObject(pairs ...Pair) sqlb.Expr[string] + func JSONPatch(target, patch sqlb.Expr[string]) sqlb.Expr[string] + func JSONQuote[T any](v T) sqlb.Expr[string] + func JSONRemove(e sqlb.Expr[string], paths ...string) sqlb.Expr[string] + func JSONReplace(e sqlb.Expr[string], path string, value sqlb.SQLer) sqlb.Expr[string] + func JSONSet(e sqlb.Expr[string], path string, value sqlb.SQLer) sqlb.Expr[string] + func JSONTree(e sqlb.SQLer, alias string) sqlb.Source + func JSONType(e sqlb.Expr[string]) sqlb.Expr[string] + func JSONTypeAt(e sqlb.Expr[string], path string) sqlb.Expr[*string] + func JSONValid(e sqlb.Expr[string]) sqlb.Expr[bool] + func JulianDay(e sqlb.SQLer, mods ...Modifier) sqlb.Expr[float64] + func LastInsertRowid() sqlb.Expr[int64] + func Length(e sqlb.Expr[string]) sqlb.Expr[int32] + func List(a *sqlb.Args, items []sqlb.SQLer) string + func Match(e sqlb.Expr[string], query string) sqlb.Predicate + func Max[T any](first sqlb.Expr[T], rest ...sqlb.Expr[T]) sqlb.Expr[T] + func Min[T any](first sqlb.Expr[T], rest ...sqlb.Expr[T]) sqlb.Expr[T] + func New[T any](col sqlb.Expr[T]) sqlb.Expr[T] + func NotGlob(e sqlb.Expr[string], pattern string) sqlb.Predicate + func Now() sqlb.Expr[string] + func Old[T any](col sqlb.Expr[T]) sqlb.Expr[T] + func Pred(construct string, render func(a *sqlb.Args) string) sqlb.Predicate + func QuoteLit(s string) sqlb.SQLer + func QuoteSQL(e sqlb.SQLer) sqlb.Expr[string] + func Raise(action RaiseAction, message string) sqlb.Expr[any] + func RaiseIgnore() sqlb.Expr[any] + func Random() sqlb.Expr[int64] + func RandomBlob(n int) sqlb.Expr[[]byte] + func Rank(table sqlb.Table) sqlb.Expr[float64] + func Rowid(t sqlb.Table) sqlb.Expr[int64] + func Snippet(table sqlb.Table, column int, openTag, closeTag, ellipsis string, tokens int) sqlb.Expr[string] + func Strftime(format string, e sqlb.SQLer, mods ...Modifier) sqlb.Expr[string] + func Substr(e sqlb.Expr[string], start sqlb.Expr[int32]) sqlb.Expr[string] + func SubstrN(e sqlb.Expr[string], start, n sqlb.Expr[int32]) sqlb.Expr[string] + func Time(e sqlb.SQLer, mods ...Modifier) sqlb.Expr[string] + func TimeLit(t time.Time) sqlb.Expr[string] + func TotalChanges() sqlb.Expr[int64] + func Typeof(e sqlb.SQLer) sqlb.Expr[string] + func UnixEpoch(e sqlb.SQLer, mods ...Modifier) sqlb.Expr[int64] + func Version() sqlb.Expr[string] + type AlterClause = ddl.AlterClause[Dialect] + func AddColumn(c ddl.ColumnSpec, with ...ddl.ColumnClause[Dialect]) AlterClause + func RenameTo(to sqlb.Table) AlterClause + type AlterTableQuery = ddl.AlterTable[Dialect] + func AlterTable(t sqlb.Table) *AlterTableQuery + type AlterTableReady = ddl.AlterTableReady[Dialect] + type AutoVacuum int + const AutoVacuumFull + const AutoVacuumIncremental + const AutoVacuumNone + type Collation int + const Binary + const NoCase + const RTrim + type ColumnKeyClause struct + func ColumnKey[T any](col sqlb.Expr[T]) ColumnKeyClause + func (ColumnKeyClause) Part() ddl.ColumnPart + func (ColumnKeyClause) Position() ddl.Position + func (ColumnKeyClause) TableClauseOf(Dialect) + func (c ColumnKeyClause) Asc() ColumnKeyClause + func (c ColumnKeyClause) Desc() ColumnKeyClause + func (c ColumnKeyClause) DescribeInto(t *schema.Table) + func (c ColumnKeyClause) OnConflict(action OrAction) ColumnKeyClause + func (c ColumnKeyClause) Target() ddl.ColumnRef + func (c ColumnKeyClause) WriteSQL(b *strings.Builder, a *sqlb.Args) + type ColumnPair struct + func RefPair[T any](local, ref sqlb.Expr[T]) ColumnPair + type Conflict struct + func OnConflict(cols ...sqlb.SQLer) *Conflict + func (c *Conflict) Clause() InsertClause + func (c *Conflict) DoNothing() InsertClause + func (c *Conflict) DoUpdate(as ...sqlb.Assignment) *Conflict + func (c *Conflict) TargetWhere(ps ...sqlb.Predicate) *Conflict + func (c *Conflict) UpdateWhere(ps ...sqlb.Predicate) *Conflict + type CopyPair struct + func CopyAs[T any](to, e sqlb.Expr[T]) CopyPair + type CreateFTS5Query struct + func CreateFTS5(t sqlb.Table) *CreateFTS5Query + func (x *CreateFTS5Query) Columns(first ddl.ColumnRef, more ...ddl.ColumnRef) *CreateFTS5Statement + func (x *CreateFTS5Query) IfNotExists() *CreateFTS5Query + type CreateFTS5Statement struct + func (x *CreateFTS5Statement) Build() (ddl.Script, error) + func (x *CreateFTS5Statement) ExternalContent(content sqlb.Table, rowid ddl.ColumnRef) *CreateFTS5Statement + func (x *CreateFTS5Statement) IfNotExists() *CreateFTS5Statement + func (x *CreateFTS5Statement) Prefix(lengths ...int) *CreateFTS5Statement + func (x *CreateFTS5Statement) Tokenize(t Tokenizer) *CreateFTS5Statement + type CreateIndexQuery struct + func CreateIndex(ix Index, t sqlb.Table) *CreateIndexQuery + func (x *CreateIndexQuery) IfNotExists() *CreateIndexQuery + func (x *CreateIndexQuery) On(first IndexElement, more ...IndexElement) *CreateIndexReady + func (x *CreateIndexQuery) Unique() *CreateIndexQuery + type CreateIndexReady struct + func (x *CreateIndexReady) Build() (ddl.Script, error) + func (x *CreateIndexReady) IfNotExists() *CreateIndexReady + func (x *CreateIndexReady) Unique() *CreateIndexReady + func (x *CreateIndexReady) Where(p sqlb.Predicate) *CreateIndexReady + type CreateRTreeQuery struct + func CreateRTree(t sqlb.Table) *CreateRTreeQuery + func (x *CreateRTreeQuery) Columns(id sqlb.Expr[int64], first Dim, more ...Dim) *CreateRTreeStatement + func (x *CreateRTreeQuery) IfNotExists() *CreateRTreeQuery + func (x *CreateRTreeQuery) Integer() *CreateRTreeQuery + type CreateRTreeStatement struct + func (x *CreateRTreeStatement) Build() (ddl.Script, error) + type CreateTableAsStatement struct + func CreateTableAs(t sqlb.Table, body *SelectQuery) *CreateTableAsStatement + func (x *CreateTableAsStatement) Build() (ddl.Script, error) + func (x *CreateTableAsStatement) IfNotExists() *CreateTableAsStatement + func (x *CreateTableAsStatement) Temporary() *CreateTableAsStatement + type CreateTableQuery = ddl.CreateTable[Dialect] + func CreateTable(t sqlb.Table) *CreateTableQuery + type CreateTableReady = ddl.CreateTableReady[Dialect] + type CreateTriggerQuery struct + func CreateTrigger(tr Trigger) *CreateTriggerQuery + func (x *CreateTriggerQuery) After(e TriggerEvent, t sqlb.Table) *TimedTriggerQuery + func (x *CreateTriggerQuery) Before(e TriggerEvent, t sqlb.Table) *TimedTriggerQuery + func (x *CreateTriggerQuery) IfNotExists() *CreateTriggerQuery + func (x *CreateTriggerQuery) InsteadOf(e TriggerEvent, v View) *TimedTriggerQuery + func (x *CreateTriggerQuery) Temporary() *CreateTriggerQuery + type CreateTriggerStatement struct + func (x *CreateTriggerStatement) Build() (ddl.Script, error) + type CreateViewQuery struct + func CreateView(v View) *CreateViewQuery + func (x *CreateViewQuery) As(body *SelectQuery) *CreateViewStatement + func (x *CreateViewQuery) Columns(first ddl.ColumnRef, more ...ddl.ColumnRef) *CreateViewQuery + func (x *CreateViewQuery) IfNotExists() *CreateViewQuery + func (x *CreateViewQuery) Temporary() *CreateViewQuery + type CreateViewStatement struct + func (x *CreateViewStatement) Build() (ddl.Script, error) + func (x *CreateViewStatement) Columns(first ddl.ColumnRef, more ...ddl.ColumnRef) *CreateViewStatement + func (x *CreateViewStatement) IfNotExists() *CreateViewStatement + func (x *CreateViewStatement) Temporary() *CreateViewStatement + type CreateVirtualTableStatement struct + func CreateGeopoly(t sqlb.Table, cols ...ddl.ColumnRef) *CreateVirtualTableStatement + func CreateVirtualTable(t sqlb.Table, m Module, args ...string) *CreateVirtualTableStatement + func (x *CreateVirtualTableStatement) Build() (ddl.Script, error) + func (x *CreateVirtualTableStatement) IfNotExists() *CreateVirtualTableStatement + type Deferrability int + const DeferrableInitiallyDeferred + const DeferrableInitiallyImmediate + const NotDeferrable + type DeleteClause = sqlb.Clause[Dialect, sqlb.DeleteKind] + type DeleteQuery = sqlb.Delete[Dialect] + func Delete(t sqlb.Table) *DeleteQuery + type Dialect = sqlite.Dialect + type Dim struct + func Dimension[T float32 | float64 | int32 | int64](lo, hi sqlb.Expr[T]) Dim + type DropStatement struct + func DropIndex(ix Index) *DropStatement + func DropTrigger(tr Trigger) *DropStatement + func DropView(v View) *DropStatement + func (x *DropStatement) Build() (ddl.Script, error) + func (x *DropStatement) IfExists() *DropStatement + type DropTableQuery = ddl.DropTable[Dialect] + func DropTable(first sqlb.Table, more ...sqlb.Table) *DropTableQuery + type FilteredDelete = sqlb.FilteredDelete[Dialect] + type FilteredUpdate = sqlb.FilteredUpdate[Dialect] + type ForeignKeyClause struct + func ForeignKey(c TableConstraint, first ColumnPair, more ...ColumnPair) ForeignKeyClause + func References[T any](local, ref sqlb.Expr[T]) ForeignKeyClause + func (ForeignKeyClause) Position() ddl.Position + func (ForeignKeyClause) TableClauseOf(Dialect) + func (f ForeignKeyClause) ClauseTable() sqlb.Table + func (f ForeignKeyClause) Deferrable(d Deferrability) ForeignKeyClause + func (f ForeignKeyClause) Deferred() ForeignKeyClause + func (f ForeignKeyClause) DescribeInto(t *schema.Table) + func (f ForeignKeyClause) NamedColumns() []ddl.ColumnRef + func (f ForeignKeyClause) OnDelete(r RefAction) ForeignKeyClause + func (f ForeignKeyClause) OnUpdate(r RefAction) ForeignKeyClause + func (f ForeignKeyClause) WriteSQL(b *strings.Builder, a *sqlb.Args) + type Index struct + Name string + Schema string + type IndexElement interface + IndexColumns func() []ddl.ColumnRef + WriteIndexElement func(b *strings.Builder, a *sqlb.Args) + type IndexKeyElem struct + func IndexExpr[T any](e sqlb.Expr[T]) IndexKeyElem[T] + func IndexKey[T any](col sqlb.Expr[T]) IndexKeyElem[T] + func (k IndexKeyElem[T]) Asc() IndexKeyElem[T] + func (k IndexKeyElem[T]) Collate(c Collation) IndexKeyElem[T] + func (k IndexKeyElem[T]) Desc() IndexKeyElem[T] + func (k IndexKeyElem[T]) IndexColumns() []ddl.ColumnRef + func (k IndexKeyElem[T]) WriteIndexElement(b *strings.Builder, a *sqlb.Args) + type InsertClause = sqlb.Clause[Dialect, sqlb.InsertKind] + func InsertOr(action OrAction) InsertClause + type InsertQuery = sqlb.Insert[Dialect] + func Insert(t sqlb.Table) *InsertQuery + type InsertReady = sqlb.InsertReady[Dialect] + type JournalMode int + const JournalDelete + const JournalMemory + const JournalOff + const JournalPersist + const JournalTruncate + const JournalWAL + type KeyClause struct + func PrimaryKey(first ddl.ColumnRef, more ...ddl.ColumnRef) KeyClause + func PrimaryKeyOn(first KeyColumn, more ...KeyColumn) KeyClause + func Unique(first ddl.ColumnRef, more ...ddl.ColumnRef) KeyClause + func UniqueOn(first KeyColumn, more ...KeyColumn) KeyClause + func (KeyClause) Position() ddl.Position + func (KeyClause) TableClauseOf(Dialect) + func (k KeyClause) ClauseTable() sqlb.Table + func (k KeyClause) DescribeInto(t *schema.Table) + func (k KeyClause) Named(c TableConstraint) KeyClause + func (k KeyClause) NamedColumns() []ddl.ColumnRef + func (k KeyClause) OnConflict(action OrAction) KeyClause + func (k KeyClause) WriteSQL(b *strings.Builder, a *sqlb.Args) + type KeyColumn struct + func Key(col ddl.ColumnRef) KeyColumn + func (k KeyColumn) Asc() KeyColumn + func (k KeyColumn) Collate(c Collation) KeyColumn + func (k KeyColumn) Desc() KeyColumn + type Modifier string + const Auto + const Ceiling + const Floor + const JulianDayMod + const LocalTime + const StartOfDay + const StartOfMonth + const StartOfYear + const Subsec + const UTC + const Unixepoch + func Offset(n int, unit Unit) Modifier + func Weekday(n int) Modifier + type Module string + const ModuleDBStat + const ModuleFTS5 + const ModuleGeopoly + const ModuleRTree + const ModuleRTreeI32 + type NotNullConflictClause struct + func NotNullOnConflict[T any](col sqlb.Expr[T], action OrAction) NotNullConflictClause + func (NotNullConflictClause) Part() ddl.ColumnPart + func (NotNullConflictClause) Position() ddl.Position + func (NotNullConflictClause) TableClauseOf(Dialect) + func (c NotNullConflictClause) RequiresDefault() bool + func (c NotNullConflictClause) Target() ddl.ColumnRef + func (c NotNullConflictClause) WriteSQL(b *strings.Builder, a *sqlb.Args) + type OrAction string + const OrAbort + const OrFail + const OrIgnore + const OrReplace + const OrRollback + type Pair struct + Key string + Value sqlb.SQLer + func KV(key string, value sqlb.SQLer) Pair + type PragmaStatement struct + func DeferForeignKeys(on bool) *PragmaStatement + func ForeignKeyCheck() *PragmaStatement + func ForeignKeyCheckOf(t sqlb.Table) *PragmaStatement + func ForeignKeys(on bool) *PragmaStatement + func IntegrityCheck() *PragmaStatement + func IntegrityCheckOf(t sqlb.Table) *PragmaStatement + func LegacyAlterTable(on bool) *PragmaStatement + func QuickCheck() *PragmaStatement + func QuickCheckOf(t sqlb.Table) *PragmaStatement + func RecursiveTriggers(on bool) *PragmaStatement + func SetApplicationID(n int32) *PragmaStatement + func SetAutoVacuum(v AutoVacuum) *PragmaStatement + func SetBusyTimeout(d time.Duration) *PragmaStatement + func SetCacheSizeKibibytes(kib uint32) *PragmaStatement + func SetCacheSizePages(pages uint32) *PragmaStatement + func SetJournalMode(m JournalMode) *PragmaStatement + func SetMmapSize(bytes uint64) *PragmaStatement + func SetPageSize(bytes uint32) *PragmaStatement + func SetSecureDelete(s SecureDelete) *PragmaStatement + func SetSynchronous(s Synchronous) *PragmaStatement + func SetTempStore(s TempStore) *PragmaStatement + func SetUserVersion(n int32) *PragmaStatement + func (x *PragmaStatement) Build() (ddl.Script, error) + type RaiseAction int + const RaiseAbort + const RaiseFail + const RaiseRollback + type RawJSON = json.RawMessage + type RebuildQuery struct + func Rebuild(old sqlb.Table) *RebuildQuery + func (x *RebuildQuery) Into(def *CreateTableReady) *RebuildStatement + type RebuildStatement struct + func (x *RebuildStatement) Build() (ddl.Script, error) + func (x *RebuildStatement) Copy(first CopyPair, more ...CopyPair) *RebuildStatement + func (x *RebuildStatement) Recreate(bs ...interface{ Build() (ddl.Script, error) }) *RebuildStatement + type RefAction int + const RefCascade + const RefNoAction + const RefRestrict + const RefSetDefault + const RefSetNull + type SecureDelete int + const SecureDeleteFast + const SecureDeleteOff + const SecureDeleteOn + type SelectClause = sqlb.Clause[Dialect, sqlb.SelectKind] + func IndexedBy(index string) SelectClause + func NotIndexed() SelectClause + type SelectQuery = sqlb.Select[Dialect] + func Select(items ...sqlb.SQLer) *SelectQuery + type Synchronous int + const SynchronousExtra + const SynchronousFull + const SynchronousNormal + const SynchronousOff + type TableClause = ddl.TableClause[Dialect] + func Strict() TableClause + func Temporary() TableClause + func WithoutRowID() TableClause + type TableConstraint = ddl.TableConstraint + type TempStore int + const TempStoreDefault + const TempStoreFile + const TempStoreMemory + type TimedTriggerQuery struct + func (x *TimedTriggerQuery) Do(first TriggerStep, more ...TriggerStep) *CreateTriggerStatement + func (x *TimedTriggerQuery) When(p sqlb.Predicate) *TimedTriggerQuery + type Tokenizer struct + func ASCII() Tokenizer + func Porter(inner Tokenizer) Tokenizer + func Trigram() Tokenizer + func Unicode61(removeDiacritics int) Tokenizer + type Trigger struct + Name string + Schema string + type TriggerEvent struct + func OnDelete() TriggerEvent + func OnInsert() TriggerEvent + func OnUpdate() TriggerEvent + func OnUpdateOf(first ddl.ColumnRef, more ...ddl.ColumnRef) TriggerEvent + type TriggerStep struct + func StepDelete(s *FilteredDelete) TriggerStep + func StepInsert(s *InsertReady) TriggerStep + func StepSelect(s *SelectQuery) TriggerStep + func StepUpdate(s *FilteredUpdate) TriggerStep + type Unit string + const Day + const Hour + const Minute + const Month + const Second + const Year + type UpdateClause = sqlb.Clause[Dialect, sqlb.UpdateKind] + type UpdateQuery = sqlb.Update[Dialect] + func Update(t sqlb.Table) *UpdateQuery + type View struct + Name string + Schema string