Documentation
¶
Index ¶
- Variables
- func BindAny(stmt *sqlite.Stmt, i int, arg any)
- func Borrow(ctx context.Context, pool *Pool, fn func(conn *Conn) error) error
- func DoTx(ctx context.Context, pool *Pool, fn func(conn *Conn) error) error
- func DoTx1[T any](ctx context.Context, pool *Pool, fn func(conn *Conn) (T, error)) (T, error)
- func DoTx2[T1, T2 any](ctx context.Context, pool *Pool, fn func(conn *Conn) (T1, T2, error)) (T1, T2, error)
- func DoTxRO(ctx context.Context, pool *Pool, fn func(conn *Conn) error) error
- func Exec(conn *Conn, query string, args ...any) error
- func Get[T any](conn *Conn, dest *T, query string, args ...any) error
- func GetOne[T any](conn *Conn, dst *T, scan ScanFunc[T], query string, args ...any) (bool, error)
- func IsErrNoRows(err error) bool
- func ScanInt64(stmt *sqlite.Stmt, dst *int64) error
- func ScanString(stmt *sqlite.Stmt, dst *string) error
- func Select[T any](conn *Conn, scan func(stmt *sqlite.Stmt, dst *T) error, query string, ...) iter.Seq2[T, error]
- func Vacuum(conn *Conn) error
- func WALCheckpoint(conn *Conn) error
- type Conn
- type Iterator
- type Pool
- type ScanFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = errors.New("no rows found")
Functions ¶
func Borrow ¶
Borrow retrieves a connection from the pool and calls fn with it. The connection is returned to the pool after fn is called.
func GetOne ¶
GetOne runs a query that expects a single row in the result. (false, nil) is returned to indicate that the query was successful but there was no value.
func IsErrNoRows ¶
func Select ¶
func Select[T any](conn *Conn, scan func(stmt *sqlite.Stmt, dst *T) error, query string, args ...any) iter.Seq2[T, error]
Select returns an iterator over the results of the query. scan is called for each row.
func WALCheckpoint ¶
WALCheckpoint checkpoints the Write Ahead Log. It must not be called inside a transaction.
Types ¶
Click to show internal directories.
Click to hide internal directories.