Story: Postgres-backed currency persistence
Table of Contents
This page documents a story in Sprint 03. It captures the goal, current status, acceptance criteria, and the tasks that compose it.
Goal
Complete the Postgres write path for currencies (begun in sprint 02 with sqlgen) and make the service connection parameters configurable via CLI flags.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent sprint | Sprint 03 |
| Now | Story closed; currencies persist into Postgres through the repository, with single-row writes available and DB connection parameters exposed as CLI flags. |
| Waiting on | None. |
| Next | None. |
| Last touched | 2025-11-25 |
Acceptance
- Currencies persist through the Postgres repository (including upserts of versioned rows).
- A
write_oneentry point exists alongside the batch write. - The service accepts
--database-host,--database-port,--database-user,--database-password,--database-name(and matching environment variables).
Tasks
| Task | State | Start | End | Description |
|---|---|---|---|---|
| Add Postgres support for currency | DONE | 2025-11-25 | 2025-11-25 | Persist currency reference data through the Postgres repository layer end-to-end. |
| Add write-one to repository | DONE | 2025-11-25 | 2025-11-25 | Add a single-row write entry point to the repository alongside batch writes. |
| Add database command-line arguments to service | DONE | 2025-11-25 | 2025-11-25 | Expose database connection parameters as CLI flags for the service runtime. |
Decisions
write_oneas a peer to batch write- the API mirrors the domain shape rather than forcing every caller to build a vector for a single insert.
Out of scope
- Read-replica support (deferred).
- Connection pooling tuning beyond defaults (deferred).
See also
- ores.refdata — the reference-data component that hosts the currency repository.
- ores.sql — the Postgres setup; sqlgen targets this.
- ores.cli — host of the new database CLI flags.
- Currencies end-to-end (sprint 01) and Currencies temporal and export (sprint 02) — predecessor stories in the currency thread.
- Currency (domain note).