Skip to main content

Module store

Module store 

Source
Expand description

Storage backend abstraction for the audit log.

Two backends ship in the box:

  • SqliteStore — rusqlite-backed, single-file local database. The default for dev/test; explicitly not recommended for production because the audit log dies with the host (no off-box durability, nothing to forward to a SOC).
  • PostgresStore — sqlx-backed, native async, TLS via rustls + webpki-roots. Wire-compatible with AWS RDS / Aurora, GCP Cloud SQL + AlloyDB, Azure Database for PostgreSQL Flexible Server, Supabase, Neon, and self-hosted PostgreSQL.

The dispatcher does not know which backend is active. It calls into AuditStore (an async trait) and the runtime resolves to the configured impl through state.audit: Arc<dyn AuditStore + Send + Sync>.

§Cloud provider quick reference

See docs/storage-cloud.md for the full table. Summary:

ProviderURL hintTLS modeStatement cache
AWS RDS / Aurora*.rds.amazonaws.com:5432verify-fulldefault
GCP Cloud SQLvia Cloud SQL Auth Proxy on 127.0.0.1disabledefault
Azure Flexible*.postgres.database.azure.com:5432verify-fulldefault
Supabase (5432)db.<ref>.supabase.co:5432requiredefault
Supabase (pooler)*.pooler.supabase.com:6543require0
Neonep-*.neon.techrequiredefault
Self-hosted(operator chooses)as neededdefault

Re-exports§

pub use postgres::PostgresStore;

Modules§

postgres
Postgres backend for the audit log.

Structs§

SqliteStore
Adapter that exposes the existing rusqlite-backed TransactionStore through the async AuditStore trait. Each method runs the underlying blocking work on tokio::task::spawn_blocking so the executor stays responsive even when the SQLite write takes a millisecond on a slow disk.

Traits§

AuditStore
Async, polymorphic interface to the audit log. Implemented by SqliteStore (rusqlite, blocking under the hood) and postgres::PostgresStore (sqlx, native async).