go-cli-sql-storage
Installation
SKILL.md
Go CLI SQL Storage
Treat *sql.DB as a long-lived pool owned by the composition root. Keep SQL,
driver behavior, migrations, and sensitive connection details inside adapters.
Core Workflow
- Choose the database and driver from workload, platform, and distribution needs.
- Define domain operations and transaction ownership before repository methods.
- Open and configure one long-lived pool at the composition root.
- Verify required startup connectivity with a bounded
PingContext. - Apply versioned migrations using an explicit serialization policy.
- Implement parameterized queries and map driver errors to stable domain errors.
- Test consumers with fakes and adapters with the real driver and production schema.
- Build the final artifact and smoke-test database initialization.