sqltx

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sqltx provides explicit transaction helpers for database/sql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, db *sql.DB, opts *sql.TxOptions, fn func(*sql.Tx) error) (err error)

Do runs fn inside a database transaction.

The transaction commits only when fn returns nil. If fn returns an error, Do rolls the transaction back and returns that error. The caller owns db and remains responsible for closing it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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