atomic

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Simple

func Simple(db sqlt.QuerierExecutor, mandatory bool, f func(sqlt.QuerierExecutor) error) error

Simple performs runs given callback inside SQL transaction.

If given database does not support transactions and mandatory flag is set to "true", func will fail with corresponding error.

If given database does not support transactions and mandatory flag is set to "false" then callback func will be invoked without transaction.

If given callback function fails with error transaction will be rolled back, otherwise it will be committed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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