feat: schema separation — EnsureSchema + PoolWithSchema — Closes #166 #167

Merged
ash merged 3 commits from feat/schema-separation-166 into main 2026-03-02 22:45:06 +00:00
Owner

Two helpers for production Postgres schema layout:

  • EnsureSchema(ctx, pool, name) — idempotent CREATE SCHEMA
  • PoolWithSchema(ctx, connStr, schema) — pool with search_path set

Recommended layout: eventstore (events + checkpoints) + readmodel (projections).

No framework changes — just pool configuration. Postgres search_path handles routing.

Tests:

  • Schema creation + idempotency
  • SQL injection rejection (7 invalid names)
  • Pool isolation (each pool only sees its schema)
  • Full workflow: drop readmodel, events survive, rebuild

Docs: docs/schema-separation.md with setup, migration guide, rebuild instructions.

Two helpers for production Postgres schema layout: - `EnsureSchema(ctx, pool, name)` — idempotent CREATE SCHEMA - `PoolWithSchema(ctx, connStr, schema)` — pool with search_path set Recommended layout: `eventstore` (events + checkpoints) + `readmodel` (projections). No framework changes — just pool configuration. Postgres search_path handles routing. Tests: - Schema creation + idempotency - SQL injection rejection (7 invalid names) - Pool isolation (each pool only sees its schema) - Full workflow: drop readmodel, events survive, rebuild Docs: docs/schema-separation.md with setup, migration guide, rebuild instructions.
feat: schema separation — EnsureSchema + PoolWithSchema helpers — Refs #166
Some checks failed
CI / test-sqlitestore (push) Failing after 3s
CI / test-pgstore (push) Failing after 3s
CI / test-nats (push) Failing after 5s
CI / test-integration (push) Failing after 4s
CI / benchmarks (push) Failing after 4s
CI / test-codec-otelkit (push) Successful in 11s
CI / test-core (push) Has been cancelled
849e3ce6c1
fix: schema test — avoid public table collision — Refs #166
Some checks failed
CI / test-sqlitestore (push) Failing after 4s
CI / test-pgstore (push) Failing after 4s
CI / test-nats (push) Failing after 5s
CI / test-integration (push) Failing after 3s
CI / benchmarks (push) Failing after 4s
CI / test-codec-otelkit (push) Successful in 11s
CI / test-core (push) Has been cancelled
e937e44261
docs: schema separation guide — layout, setup, migration, rebuild — Refs #166
Some checks failed
CI / test-sqlitestore (push) Failing after 3s
CI / test-pgstore (push) Failing after 3s
CI / test-nats (push) Failing after 4s
CI / test-integration (push) Failing after 3s
CI / benchmarks (push) Failing after 4s
CI / test-codec-otelkit (push) Successful in 11s
CI / test-sqlitestore (pull_request) Failing after 5s
CI / test-pgstore (pull_request) Failing after 5s
CI / test-nats (pull_request) Failing after 7s
CI / test-integration (pull_request) Failing after 4s
CI / benchmarks (pull_request) Failing after 4s
CI / test-codec-otelkit (pull_request) Successful in 12s
CI / test-core (push) Failing after 1m16s
CI / test-core (pull_request) Failing after 1m22s
ecda81fd88
ash merged commit 0fee91cc46 into main 2026-03-02 22:45:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit!167
No description provided.