Core schema and connection factory #1

Open
opened 2026-08-07 14:22:38 +00:00 by hum3 · 0 comments
Owner

Overview

Provide a connection factory and core schema that all gobank services share.

Connection Factory

  • NewDB(dsn) — returns *sql.DB configured for the target
  • Dev/WASM: pglike (in-memory SQLite via go-postgres)
  • Production: Postgres or CockroachDB
  • Connection pooling, health checks

Core Schema

  • Schema versioning table (gobank_schema_versions)
  • Migration runner using expand/contract pattern
  • Namespace isolation: each service prefixes its tables (e.g. luca_, cust_, acc_)

Acceptance Criteria

  • NewDB() factory with pglike/Postgres/CockroachDB support
  • Schema version tracking
  • Migration runner (up/down)
  • Tests against pglike in-memory DB

Migrated from Codeberg: originally #1, opened 2026-03-25.

## Overview Provide a connection factory and core schema that all gobank services share. ## Connection Factory - `NewDB(dsn)` — returns `*sql.DB` configured for the target - Dev/WASM: pglike (in-memory SQLite via go-postgres) - Production: Postgres or CockroachDB - Connection pooling, health checks ## Core Schema - Schema versioning table (`gobank_schema_versions`) - Migration runner using expand/contract pattern - Namespace isolation: each service prefixes its tables (e.g. `luca_`, `cust_`, `acc_`) ## Acceptance Criteria - `NewDB()` factory with pglike/Postgres/CockroachDB support - Schema version tracking - Migration runner (up/down) - Tests against pglike in-memory DB --- *Migrated from Codeberg: originally [#1](https://codeberg.org/hum3/gobank-db/issues/1), opened 2026-03-25.*
Sign in to join this conversation.
No labels
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
hum3/gobank-db#1
No description provided.