Expand description
headgate-postgres — the reference backend (push wakeups).
The admission gate is queries/admit.sql, ONE statement: policy + claim + lease +
accounting. This crate wires it up and implements the rest of the Store port plus
Transactional, which is the reason to be on Postgres at all.
Time comes from the store in every statement here — clock_timestamp(), never a
caller parameter. See the header comment in queries/admit.sql for the measured
failure that rule prevents.
Structs§
- Index
Health - PgStore
- The Postgres adapter. Construct it with
PgStore::newaround a pool YOU own — failure classification: headgate never closes a pool it did not open, and every entry point accepts an existing one.PgStore::connectis a convenience for tools and tests. - PgStore
Options - PgTx
- An open store transaction. Owns its pooled connection with
BEGINissued;commitorrollbackfinish it and return the connection to the pool. Dropping it unfinished DETACHES the connection (closing it, so the server aborts the transaction) rather than returning a dirty connection to the pool.