pgapi-one-transaction-per-method

IN premise

Each PgApi public method is a single PostgreSQL transaction that commits or rolls back at the end; __exit__ rolls back on exception

Summary

Each public method on PgApi runs its entire operation inside one database transaction that either fully commits on success or fully rolls back on failure. This means callers get atomic behavior by default — there is no risk of partial writes from a single method call, and error handling via context manager exit will automatically clean up uncommitted changes.

Dependents

These beliefs depend on this one:

Details

Sourceentries/2026/04/28/reasons_lib-pg.md