feat(wfe-postgres): add PostgreSQL persistence provider

PostgresPersistenceProvider using sqlx with wfc schema. JSONB for
complex fields, TIMESTAMPTZ for dates. Transactions for atomicity.
Proper error propagation on deserialization (no unwrap_or_default).
Status conversion returns Result for unknown values.
This commit is contained in:
2026-03-25 20:13:44 +00:00
parent f39766cc3d
commit b2c37701b1
3 changed files with 968 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
use wfe_core::persistence_suite;
use wfe_core::traits::PersistenceProvider;
async fn make_provider() -> wfe_postgres::PostgresPersistenceProvider {
let database_url = "postgres://wfe:wfe@localhost:5433/wfe_test";
let provider = wfe_postgres::PostgresPersistenceProvider::new(database_url)
.await
.expect("Failed to connect to PostgreSQL. Is the database running?");
provider.ensure_store_exists().await.unwrap();
provider.truncate_all().await.unwrap();
provider
}
persistence_suite!(make_provider);