Skip to main content

Crate headgate_postgres

Crate headgate_postgres 

Source
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§

IndexHealth
PgStore
The Postgres adapter. Construct it with PgStore::new around a pool YOU own — failure classification: headgate never closes a pool it did not open, and every entry point accepts an existing one. PgStore::connect is a convenience for tools and tests.
PgStoreOptions
PgTx
An open store transaction. Owns its pooled connection with BEGIN issued; commit or rollback finish 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.