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.
Click to show internal directories.
Click to hide internal directories.