feat: add PostgreSQL storage provider for LawNet BFF #56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "push-zzyrmktsoxqm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements the PostgreSQL storage provider for the LawNet BFF, adding an environment-variable-driven storage provider switch (
BFF_STORAGE=filesystem|postgres).Changes
services/flyway/sql/V2__lawnet_schema.sql): 7 tables underlawnetschema — judgments, judgment_sources, corams, catchwords, artifacts, artifact_data, citations — with appropriate indexespostgres-store.ts): full implementation of theLawnetStoreinterface usingpg.Poolwith parameterized queriesindex.ts):getLawnetStore()readsBFF_STORAGEenv var;"postgres"creates aPoolfromDATABASE_URLand returnsLawnetPostgresStore, otherwise falls back toLawnetFileSystemStoreBFF_STORAGEtocompose.yamland.env.examplepostgres-store.test.ts): 19 tests that self-seed fixture data from disk against a real PostgreSQL, gracefully skipped whenDATABASE_URLis absentVerification
tsc --noEmit— cleaneslint— cleanprettier --check— cleandocker compose configpassesCloses #49
c43d034cb5273e4677e8Pull request closed