Documentation
¶
Index ¶
- func IsRetriableError(err error) bool
- func Retry(ctx context.Context, f func(ctx context.Context) error) error
- func SelectIntegers(ctx context.Context, tx *sql.Tx, query string, args ...any) ([]int, error)
- func Transaction(ctx context.Context, db *sql.DB, f func(context.Context, *sql.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRetriableError ¶
IsRetriableError returns true if the given error might be transient and the interaction can be safely retried.
func Retry ¶
Retry wraps a function that interacts with the database, and retries it in case a transient error is hit.
This should by typically used to wrap transactions.
func SelectIntegers ¶
SelectIntegers executes a statement which must yield rows with a single integer column. It returns the list of column values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.