Documentation
¶
Index ¶
- func Get(ctx context.Context, db DBI, val any, query string, vals ...any) error
- func ReadOnly[T any](ctx context.Context, db *sql.DB, fn func(DBI) (T, error)) (T, error)
- func ReadWrite[T any](ctx context.Context, db *sql.DB, fn func(DBI) (T, error)) (T, error)
- func TranslateNotFound(from, to error) error
- func WithTx[T any](ctx context.Context, db *sql.DB, opts *sql.TxOptions, ...) (T, error)
- type DBI
- type Factory
- type TxDal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadOnly ¶
ReadOnly executes fn within a read-only transaction. The transaction is committed if fn returns nil, otherwise rolled back.
func ReadWrite ¶
ReadWrite executes fn within a read-write transaction. The transaction is committed if fn returns nil, otherwise rolled back.
Types ¶
type DBI ¶
Source Files
¶
- dbi.go
- get.go
Click to show internal directories.
Click to hide internal directories.