glimr_postgres/db/db
Database transaction support for PostgreSQL.
Provides transaction execution with automatic retry on deadlock errors. Transactions are committed on success or rolled back on error.
Values
pub fn transaction(
pool: pool.Pool,
retries: Int,
callback: fn(pog.Connection) -> Result(
a,
pool_connection.DbError,
),
) -> Result(a, pool_connection.DbError)
Executes a function within a database transaction. The transaction is committed on success or rolled back on error. The retries parameter controls how many times to retry on deadlock errors.