Versions in this module Expand all Collapse all v0 v0.3.0 Oct 15, 2026 Changes in this version + func InTx(ctx context.Context, db *sql.DB, body func(*sql.Tx) error) error v0.2.0 Oct 10, 2026 Changes in this version + func EscapeLike(term string) string v0.1.0 Oct 7, 2026 Changes in this version + var ErrAddress = errors.New("dbkit: refused database address") + var ErrBusy = errors.New("dbkit: the database is busy") + var ErrCheck = errors.New("dbkit: a check constraint failed") + var ErrForeignKey = errors.New("dbkit: a foreign key constraint failed") + var ErrNotNull = errors.New("dbkit: a not null constraint failed") + var ErrPlaceholder = errors.New("dbkit: write every parameter as $N") + var ErrRefused = errors.New("dbkit: the observer refused the statement") + var ErrShareFull = errors.New("dbkit: no free slot in the share before the statement deadline") + var ErrUnique = errors.New("dbkit: a unique constraint failed") + func SQLitePath(address string) (string, error) + type Checkpoint struct + Busy bool + CheckpointedFrames int + LogFrames int + Took time.Duration + type Engine int + const Postgres + const SQLite + func EngineOf(address string) (Engine, error) + func (e Engine) String() string + type Function struct + Args int + Call func(args []driver.Value) (driver.Value, error) + Deterministic bool + Name string + func CaseFold() Function + type FunctionList struct + func NewFunctionList(fns ...Function) (*FunctionList, error) + func (l *FunctionList) All() []Function + type Kind int + const KindBegin + const KindExec + const KindQuery + const KindQueryRow + func (k Kind) String() string + type Observer func(ctx context.Context, s Statement) error + type QueryBudget struct + func NewQueryBudget(limit int) (*QueryBudget, error) + func (b *QueryBudget) Attach(ctx context.Context) context.Context + type QueryCount struct + ByID map[string]int + PastBudget bool + Total int + func QueriesIn(ctx context.Context) (QueryCount, bool) + type Row struct + func (r *Row) Err() error + func (r *Row) Scan(dest ...any) error + type Rows struct + func (r *Rows) Close() error + func (r *Rows) Err() error + func (r *Rows) Next() bool + func (r *Rows) NextResultSet() bool + func (r *Rows) Scan(dest ...any) error + type Share struct + func NewShare(db *sql.DB, engine Engine, opts ShareOptions) (*Share, error) + func (s *Share) Begin(ctx context.Context) (*Tx, error) + func (s *Share) Engine() Engine + func (s *Share) Exec(ctx context.Context, query string, args ...any) (sql.Result, error) + func (s *Share) Query(ctx context.Context, query string, args ...any) (*Rows, error) + func (s *Share) QueryRow(ctx context.Context, query string, args ...any) *Row + type ShareOptions struct + ID string + Observer Observer + Slots int + StatementTimeout time.Duration + TransactionTimeout time.Duration + type Snapshot struct + Checkpoint Checkpoint + Path string + type Snapshotter interface + Snapshot func(ctx context.Context, target string) (Snapshot, error) + type Statement struct + Count int + ID string + InTransaction bool + Kind Kind + PastBudget bool + Query string + Writes bool + type Time struct + func (t *Time) Scan(src any) error + func (t Time) Value() (driver.Value, error) + type Tx struct + func (t *Tx) Commit() error + func (t *Tx) Exec(ctx context.Context, query string, args ...any) (sql.Result, error) + func (t *Tx) Query(ctx context.Context, query string, args ...any) (*Rows, error) + func (t *Tx) QueryRow(ctx context.Context, query string, args ...any) *Row + func (t *Tx) Rollback() error