dbx

package
v0.0.0-...-fb49ba0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package dbx provides helpers for the database/sql package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLocalLockTimeout

func SetLocalLockTimeout(timeout time.Duration) func(context.Context, *sql.Tx) error

SetLocalLockTimeout returns a transaction option which will set the lock timeout for the transaction.

func Transact

func Transact(ctx context.Context, db *sql.DB, fns ...func(context.Context, *sql.Tx) error) (retErr error)

Transact begins a transaction, executes a sequence of functions on that transaction, and commits. If any of the functions returns a non-nil error or panics, execution is halted and the transaction will be rolled back.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL