Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design, implement, test, and ship SQL-backed persistence for Go CLIs using database/sql, explicit pool ownership, bounded startup checks, embedded migrations, transaction boundaries, parameterized queries, adapter error mapping, Scanner and Valuer types, SQLite or server databases, and real-driver integration tests. Use when a Go command stores durable state in SQL, initializes a local database, applies schema changes, or needs safe repository and transaction behavior.
.claude/skills/hashgraph-online-go-cli-sql-storage/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-22 | ✓→✗ | ▼ Worse | -1% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -11% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 27% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 10% | 0% |
Treat *sql.DB as a long-lived pool owned by the composition root. Keep SQL, driver behavior, migrations, and sensitive connection details inside adapters.
PingContext.| Task | Load | |---|---| | Design storage for a CLI | guidelines.md, workflows/build-sql-storage.md | | Add or change migrations | workflows/apply-schema-migrations.md | | Test an adapter | workflows/test-sql-adapter.md | | Review pools, transactions, queries, or conversions | references/sql-storage/rules.md | | Understand driver and pool contracts | references/sql-storage/knowledge.md | | Build a multi-process SQLite cache | references/sql-storage/sqlite.md | | Review patterns | references/sql-storage/examples.md |
sql.Open as a connectivity check.Guidance is transformed and paraphrased from Inanc Gumus, Go by Example: Programmer's Guide to Idiomatic and Testable Programs (Manning, 2025), Chapter 10. Examples are original.
Nullable values, row lifecycle, and pool guidance also incorporates transformed material from Teiva Harsanyi, 100 Go Mistakes and How to Avoid Them (Manning, 2022), Chapter 10.
Book: https://www.manning.com/books/go-by-example
Verify current contracts against https://pkg.go.dev/database/sql, https://pkg.go.dev/database/sql/driver, and the selected driver's documentation. For SQLite, also verify https://sqlite.org/wal.html, https://sqlite.org/lang_transaction.html, and https://sqlite.org/backup.html.
Other measured skills in the registry, with their headline benchmark lift.