Skip to main content

write

Function write 

Source
pub async fn write(record: AuditRecord, database: &Database)
Expand description

Writes one row against a bare database handle.

The free function exists for the relay backend: it settles an issuance from a background task that holds an Arc<Database> and no Auditor, and it needs no reverse lookup either — the address it records was resolved during the finalize request and stored on the upstream_orders row. Giving that task an Auditor would have meant threading one through signer::build_backends and Profile::build_all for the sake of a resolver it would never call.

A failed write is logged and swallowed. The alternative — failing the request — would turn a certificate this CA has already signed into a 500 the client retries, issuing a second one, which is a worse outcome for the same underlying fault. It is also nearly unreachable in practice: this is the same SQLite file the order was just written to, so a failure here means the write that preceded it had already failed. The error! carries the record’s identifying fields, so the trail survives in the log even when the table did not get it.