Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/muratmirgun/gophers/go-databasenpx skills add muratmirgun/gophers --skill go-databasegit clone --depth 1 https://github.com/muratmirgun/gophersWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/muratmirgun/gophers/go-database)<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-database"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-database.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00098 | $0.02256 |
| Opus 5 | $0.00049 | $0.01128 |
| Sonnet 5 | $0.00020 | $0.00451 |
| Haiku 4.5 | $0.00010 | $0.00226 |
Grade A, and why
go-database scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Database
Go's database/sql is a thin, driver-pluggable foundation. Most projects layer one of sqlx, sqlc, or pgx on top for ergonomics. ORMs (GORM, ent) trade SQL visibility for one less line of code — a bad trade in production.
Core Rules
- SQL is the source of truth. It is reviewed, version-controlled, and explained in code. Magic ORM queries are the opposite.
- Always parameterize.
$1/?placeholders, never string concatenation. The driver handles escaping; you cannot. - Every I/O call takes
ctx.QueryContext,ExecContext,GetContext. No context = no timeout = a stuck handler. - Distinguish "not found" from "error".
errors.Is(err, sql.ErrNoRows)is a domain signal, not a failure. - Close rows.
defer rows.Close()immediately afterQueryContext. Forgetting it leaks a pool connection. - Configure the pool. Default
MaxOpenConnsis unlimited — a runaway request rate exhausts the DB.
Library Decision
| Library | Best for | Struct scanning | Code-gen |
|---|---|---|---|
database/sql |
Minimal deps, multi-driver portability | Manual Scan |
No |
sqlx |
Sweetens database/sql ergonomics |
StructScan, Get, Select |
No |
sqlc |
Type-safe queries derived from .sql files |
Generated structs and funcs | Yes |
pgx (v5) |
PostgreSQL-only, 30-50% faster, native types | pgx.RowToStructByName |
No |
| GORM / ent | Avoid in new code | Reflection | Yes |
Why not ORMs.
- Generated queries are unpredictable; N+1 problems are invisible at the call site.
- Hooks (
BeforeCreate,AfterUpdate) create implicit state machines. - Schema migrations entangle with application code.
- Learning the ORM API is harder than learning SQL, and the abstraction leaks at every interesting query.
Read references/library-tradeoffs.md when picking between sqlx, sqlc, and pgx for a new project.
Parameterized Queries
// VERY BAD — SQL injection.
q := fmt.Sprintf("SELECT * FROM users WHERE email = '%s'", email)
// Good — placeholder, driver-escaped.
err := db.GetContext(ctx, &u, "SELECT id, email FROM users WHERE email = $1", email)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 203 lines · 98 tokens per session scan A e5e2acd03d62
go-database is a skill published in the GitHub repository muratmirgun/gophers (8 stars, last pushed 23d ago), licensed MIT. It adds 98 tokens to every session and 2,256 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
convex
Build and operate Convex backends: functions (queries/mutations/actions/http actions), schemas, auth patterns, scheduling (cron/scheduled/workflows), file storage, components, migrations, performance, testing, and debugging. Triggers: "convex", "query", "mutation", "action", "httpAction", "schema", "validator"…
django-safe-migration
Write, review, and rewrite Django migrations for PostgreSQL with zero-downtime guarantees. Use this skill whenever the user mentions migrations, Django schema changes, or deployment safety — even if they don't say "zero downtime" explicitly. Trigger on: "review this migration", "is this migration safe?", "write a…
agent-platform-rag-engine-management
Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.
cloud-databases-onboarding
Guides users through discovering their database requirements, recommends a Google Cloud database based on a recommendation matrix, and assists in database creation. Use when a user asks 'What database service should I use?', 'Help me pick a database', or when a user wants to create a new database on Google Cloud.…
cloud-monitoring-metric-selection
Retrieve, query, and identify relevant Google Cloud Monitoring metric descriptors for a GCP service or resource (such as Compute Engine, Spanner, BigQuery, Cloud Run, Cloud SQL, Pub/Sub, Cloud Storage, etc.). Use when asked to find, list, search, or discover GCP metric types, names, kind/value schemas, or descriptors.