PostgreSQL ledger adapter backed by the host application's Repo.
ExGAM intentionally has no database dependency. The application supplies
:repo; by default SQL is executed dynamically through
Ecto.Adapters.SQL.query/4 and transactions through the Repo's
transaction/2 and rollback/1 callbacks. A different compatible SQL module
may be supplied with :query_module.
Each logical batch is stored once as canonical bytes. A transaction-scoped
advisory lock serializes one Domain, while a revision-guarded head update and
database constraints preserve CAS and idempotency. Write transactions force
synchronous_commit on; the host remains responsible for keeping PostgreSQL
fsync enabled. The host provisions the schema in a migration using the SQL returned
by migration_sql/1.
compressed: true optionally compresses each new canonical batch before
storage. Readers accept compressed and plain batches independently of that
setting. Indexed head/2 and read_batch/3 support bounded recovery input;
full load/export remain explicit historical operations.
Summary
Functions
Returns the PostgreSQL DDL for a versioned host migration.
Returns the validated SQL namespace used for the ledger tables.