package crdbgorm

import "github.com/cockroachdb/cockroach-go/v2/crdb/crdbgorm"

Index

Functions

func ExecuteTx

func ExecuteTx(
	ctx context.Context, db *gorm.DB, opts *sql.TxOptions, fn func(tx *gorm.DB) error,
) error

ExecuteTx runs fn inside a transaction and retries it as needed. On non-retryable failures, the transaction is aborted and rolled back; on success, the transaction is committed.

See crdb.ExecuteTx() for more information.

Source Files

gorm.go

Version
v2.3.4
Published
Jun 3, 2023
Platform
js/wasm
Imports
4 packages
Last checked
4 hours ago

Tools for package owners.