[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DFEPCP70M5DB028AB55DP3":3,"skill-same:01M7DFEPCP70M5DB028AB55DP3":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":59},"01M7DFEPCP70M5DB028AB55DP3","golang-database",null,"Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use when writing, reviewing, or debugging Golang code that interacts with PostgreSQL, MariaDB, MySQL, or SQLite; for database testing; or for questions about database\u002Fsql, sqlx, or pgx. Does NOT generate database schemas or migration SQL.","heynemann\u002Fomp-marketplace","heynemann","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F60965?v=4","01M7DFBD9ZDB2J2QE7R4AR0PES","Bernardo Heynemann","01M7DFBDAM3NXF540P210W3NYT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-database\ndescription: \"Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use when writing, reviewing, or debugging Golang code that interacts with PostgreSQL, MariaDB, MySQL, or SQLite; for database testing; or for questions about database\u002Fsql, sqlx, or pgx. Does NOT generate database schemas or migration SQL.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.3.2\"\n  openclaw:\n    emoji: \"🗄\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion\npaths:\n  - \"**\u002F*.go\"\n---\n\n**Persona:** You are a Go backend engineer who writes safe, explicit, and observable database code. You treat SQL as a first-class language — no ORMs, no magic — and you catch data integrity issues at the boundary, not deep in the application.\n\n**Modes:**\n\n- **Write mode** — generating new repository functions, query helpers, or transaction wrappers: follow the skill's sequential instructions; launch a background agent to grep for existing query patterns and naming conventions in the codebase before generating new code.\n- **Review\u002Fdebug mode** — auditing or debugging existing database code: use a sub-agent to scan for missing `rows.Close()`, un-parameterized queries, missing context propagation, and absent error checks in parallel with reading the business logic.\n\n> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-database` skill takes precedence.\n\n# Go Database Best Practices\n\nGo's `database\u002Fsql` provides a solid foundation for database access. Use `sqlx` or `pgx` on top of it for ergonomics — never an ORM.\n\nWhen using sqlx or pgx, refer to the library's official documentation and code examples for current API signatures.\n\n## Best Practices Summary\n\n1. **Use sqlx or pgx, not ORMs** — ORMs hide SQL, generate unpredictable queries, and make debugging harder\n2. Queries MUST use parameterized placeholders — NEVER concatenate user input into SQL strings\n3. Context MUST be passed to all database operations — use `*Context` method variants (`QueryContext`, `ExecContext`, `GetContext`)\n4. `sql.ErrNoRows` MUST be handled explicitly — distinguish \"not found\" from real errors using `errors.Is`\n5. Rows MUST be closed after iteration — `defer rows.Close()` immediately after `QueryContext` calls\n6. NEVER use `db.Query` for statements that don't return rows — `Query` returns `*Rows` which must be closed; if you forget, the connection leaks back to the pool. Use `db.Exec` instead\n7. **Use transactions for multi-statement operations** — wrap related writes in `BeginTxx`\u002F`Commit`\n8. **Use `SELECT ... FOR UPDATE`** when reading data you intend to modify — prevents race conditions\n9. **Set custom isolation levels** when default READ COMMITTED is insufficient (e.g., serializable for financial operations)\n10. **Handle NULLable columns** with pointer fields (`*string`, `*int`) or `sql.NullXxx` types\n11. Connection pool MUST be configured — `SetMaxOpenConns`, `SetMaxIdleConns`, `SetConnMaxLifetime`, `SetConnMaxIdleTime`\n12. **Use external tools for migrations** — golang-migrate or Flyway, never hand-rolled or AI-generated migration SQL\n13. **Batch operations in reasonable sizes** — not row-by-row (too many round trips), not millions at once (locks and memory)\n14. **Never create or modify database schemas** — a schema that looks correct on toy data can create hotspots, lock contention, or missing indexes under real production load. Schema design requires understanding of data volumes, access patterns, and production constraints that AI does not have\n15. **Avoid hidden SQL features** — do not rely on triggers, views, materialized views, stored procedures, or row-level security in application code\n\n## Library Choice\n\n| Library | Best for | Struct scanning | PostgreSQL-specific |\n| --- | --- | --- | --- |\n| `database\u002Fsql` | Portability, minimal deps | Manual `Scan` | No |\n| `sqlx` | Multi-database projects | `StructScan` | No |\n| `pgx` | PostgreSQL (30-50% faster) | `pgx.RowToStructByName` | Yes (COPY, LISTEN, arrays) |\n| GORM\u002Fent | **Avoid** | Magic | Abstracted away |\n\n**Why NOT ORMs:**\n\n- Unpredictable query generation — N+1 problems you cannot see in code\n- Magic hooks and callbacks (BeforeCreate, AfterUpdate) make debugging harder\n- Schema migrations coupled to application code\n- Learning the ORM API is harder than learning SQL, and the abstraction leaks\n\n## Parameterized Queries\n\n```go\n\u002F\u002F ✗ VERY BAD — SQL injection vulnerability\nquery := fmt.Sprintf(\"SELECT * FROM users WHERE email = '%s'\", email)\n\n\u002F\u002F ✓ Good — parameterized (PostgreSQL)\nvar user User\nerr := db.GetContext(ctx, &user, \"SELECT id, name, email FROM users WHERE email = $1\", email)\n\n\u002F\u002F ✓ Good — parameterized (MySQL)\nerr := db.GetContext(ctx, &user, \"SELECT id, name, email FROM users WHERE email = ?\", email)\n```\n\n### Dynamic IN clauses\n\n```go\nquery, args, err := sqlx.In(\"SELECT * FROM users WHERE id IN (?)\", ids)\nif err != nil {\n    return fmt.Errorf(\"building IN clause: %w\", err)\n}\nquery = db.Rebind(query) \u002F\u002F adjust placeholders for your driver\nerr = db.SelectContext(ctx, &users, query, args...)\n```\n\n### Dynamic column names\n\nNever interpolate column names from user input. Use an allowlist:\n\n```go\nallowed := map[string]bool{\"name\": true, \"email\": true, \"created_at\": true}\nif !allowed[sortCol] {\n    return fmt.Errorf(\"invalid sort column: %s\", sortCol)\n}\nquery := fmt.Sprintf(\"SELECT id, name, email FROM users ORDER BY %s\", sortCol)\n```\n\nFor more injection prevention patterns, see the `samber\u002Fcc-skills-golang@golang-security` skill.\n\n## Struct Scanning and NULLable Columns\n\nUse `db:\"column_name\"` tags for sqlx, `pgx.CollectRows` with `pgx.RowToStructByName` for pgx. Handle NULLable columns with pointer fields (`*string`, `*time.Time`) — they work cleanly with both scanning and JSON marshaling. See [Scanning Reference](.\u002Freferences\u002Fscanning.md) for examples of all approaches.\n\n## Error Handling\n\n```go\nfunc GetUser(id string) (*User, error) {\n    var user User\n\n    err := db.GetContext(ctx, &user, \"SELECT id, name FROM users WHERE id = $1\", id)\n    if err != nil {\n        if errors.Is(err, sql.ErrNoRows) {\n            return nil, ErrUserNotFound \u002F\u002F translate to domain error\n        }\n        return nil, fmt.Errorf(\"querying user %s: %w\", id, err)\n    }\n\n    return &user, nil\n}\n```\n\nor:\n\n```go\nfunc GetUser(id string) (u *User, exists bool, err error) {\n    var user User\n\n    err := db.GetContext(ctx, &user, \"SELECT id, name FROM users WHERE id = $1\", id)\n    if err != nil {\n        if errors.Is(err, sql.ErrNoRows) {\n            return nil, false, nil \u002F\u002F \"no user\" is not a technical error, but a domain error\n        }\n        return nil, false, fmt.Errorf(\"querying user %s: %w\", id, err)\n    }\n\n    return &user, true, nil\n}\n```\n\n### Always close rows\n\n```go\nrows, err := db.QueryContext(ctx, \"SELECT id, name FROM users\")\nif err != nil {\n    return fmt.Errorf(\"querying users: %w\", err)\n}\ndefer rows.Close() \u002F\u002F prevents connection leaks\n\nfor rows.Next() {\n    \u002F\u002F ...\n}\nif err := rows.Err(); err != nil { \u002F\u002F always check after iteration\n    return fmt.Errorf(\"iterating users: %w\", err)\n}\n```\n\n### Common database error patterns\n\n| Error | How to detect | Action |\n| --- | --- | --- |\n| Row not found | `errors.Is(err, sql.ErrNoRows)` | Return domain error |\n| Unique constraint | Check driver-specific error code | Return conflict error |\n| Connection refused | `err != nil` on `db.PingContext` | Fail fast, log, retry with backoff |\n| Serialization failure | PostgreSQL error code `40001` | Retry the entire transaction |\n| Context canceled | `errors.Is(err, context.Canceled)` | Stop processing, propagate |\n\n## Context Propagation\n\nAlways use the `*Context` method variants to propagate deadlines and cancellation:\n\n```go\n\u002F\u002F ✗ Bad — no context, query runs until completion even if client disconnects\ndb.Query(\"SELECT ...\")\n\n\u002F\u002F ✓ Good — respects context cancellation and timeouts\ndb.QueryContext(ctx, \"SELECT ...\")\n```\n\nFor context patterns in depth, see the `samber\u002Fcc-skills-golang@golang-context` skill.\n\n## Transactions, Isolation Levels, and Locking\n\nFor transaction patterns, isolation levels, `SELECT FOR UPDATE`, and locking variants, see [Transactions](.\u002Freferences\u002Ftransactions.md).\n\n## Connection Pool\n\n```go\ndb.SetMaxOpenConns(25)              \u002F\u002F limit total connections\ndb.SetMaxIdleConns(10)              \u002F\u002F keep warm connections ready\ndb.SetConnMaxLifetime(5 * time.Minute)  \u002F\u002F recycle stale connections\ndb.SetConnMaxIdleTime(1 * time.Minute)  \u002F\u002F close idle connections faster\n```\n\nFor sizing guidance and formulas, see [Database Performance](.\u002Freferences\u002Fperformance.md).\n\n## Migrations\n\nUse an external migration tool. Schema changes require human review with understanding of data volumes, existing indexes, foreign keys, and production constraints.\n\nRecommended tools:\n\n- [golang-migrate](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate) — CLI + Go library, supports all major databases\n- [Flyway](https:\u002F\u002Fflywaydb.org\u002F) — JVM-based, widely used in enterprise environments\n- [Atlas](https:\u002F\u002Fatlasgo.io\u002F) — modern, declarative schema management\n\nMigration SQL should be written and reviewed by humans, versioned in source control, and applied through CI\u002FCD pipelines.\n\n## Avoid Hidden SQL Features\n\nDo not rely on triggers, views, materialized views, stored procedures, or row-level security in application code — they create invisible side effects and make debugging impossible. Keep SQL explicit and visible in Go where it can be tested and version-controlled.\n\n## Schema Creation\n\n**This skill does NOT cover schema creation.** AI-generated schemas are often subtly wrong — missing indexes, incorrect column types, bad normalization, or missing constraints. Schema design requires understanding data volumes, access patterns, query profiles, and business constraints. Use dedicated database tooling and human review.\n\n## Deep Dives\n\n- **[Transactions](.\u002Freferences\u002Ftransactions.md)** — Transaction boundaries, isolation levels, deadlock prevention, `SELECT FOR UPDATE`\n- **[Testing Database Code](.\u002Freferences\u002Ftesting.md)** — Mock connections, integration tests with containers, fixtures, schema setup\u002Fteardown\n- **[Database Performance](.\u002Freferences\u002Fperformance.md)** — Connection pool sizing, batch processing, indexing strategy, query optimization\n- **[Struct Scanning](.\u002Freferences\u002Fscanning.md)** — Struct tags, NULLable column handling, JSON marshaling patterns\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-security` skill for SQL injection prevention patterns\n- → See `samber\u002Fcc-skills-golang@golang-context` skill for context propagation to database operations\n- → See `samber\u002Fcc-skills-golang@golang-error-handling` skill for database error wrapping patterns\n- → See `samber\u002Fcc-skills-golang@golang-testing` skill for database integration test patterns\n\n## References\n\n- [database\u002Fsql tutorial](https:\u002F\u002Fgo.dev\u002Fdoc\u002Fdatabase\u002F)\n- [sqlx](https:\u002F\u002Fgithub.com\u002Fjmoiron\u002Fsqlx)\n- [pgx](https:\u002F\u002Fgithub.com\u002Fjackc\u002Fpgx)\n- [golang-migrate](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate)\n","**Persona:** You are a Go backend engineer who writes safe, explicit, and observable database code. You treat SQL as a first-class language — no ORMs, no magic — and you catch data integrity issues at the boundary, not deep in the application.\n\n**Modes:**\n\n- **Write mode** — generating new repository functions, query helpers, or transaction wrappers: follow the skill's sequential instructions; launch a background agent to grep for existing query patterns and naming conventions in the codebase before generating new code.\n- **Review\u002Fdebug mode** — auditing or debugging existing database code: use a sub-agent to scan for missing `rows.Close()`, un-parameterized queries, missing context propagation, and absent error checks in parallel with reading the business logic.\n\n> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-database` skill takes precedence.\n\n# Go Database Best Practices\n\nGo's `database\u002Fsql` provides a solid foundation for database access. Use `sqlx` or `pgx` on top of it for ergonomics — never an ORM.\n\nWhen using sqlx or pgx, refer to the library's official documentation and code examples for current API signatures.\n\n## Best Practices Summary\n\n1. **Use sqlx or pgx, not ORMs** — ORMs hide SQL, generate unpredictable queries, and make debugging harder\n2. Queries MUST use parameterized placeholders — NEVER concatenate user input into SQL strings\n3. Context MUST be passed to all database operations — use `*Context` method variants (`QueryContext`, `ExecContext`, `GetContext`)\n4. `sql.ErrNoRows` MUST be handled explicitly — distinguish \"not found\" from real errors using `errors.Is`\n5. Rows MUST be closed after iteration — `defer rows.Close()` immediately after `QueryContext` calls\n6. NEVER use `db.Query` for statements that don't return rows — `Query` returns `*Rows` which must be closed; if you forget, the connection leaks back to the pool. Use `db.Exec` instead\n7. **Use transactions for multi-statement operations** — wrap related writes in `BeginTxx`\u002F`Commit`\n8. **Use `SELECT ... FOR UPDATE`** when reading data you intend to modify — prevents race conditions\n9. **Set custom isolation levels** when default READ COMMITTED is insufficient (e.g., serializable for financial operations)\n10. **Handle NULLable columns** with pointer fields (`*string`, `*int`) or `sql.NullXxx` types\n11. Connection pool MUST be configured — `SetMaxOpenConns`, `SetMaxIdleConns`, `SetConnMaxLifetime`, `SetConnMaxIdleTime`\n12. **Use external tools for migrations** — golang-migrate or Flyway, never hand-rolled or AI-generated migration SQL\n13. **Batch operations in reasonable sizes** — not row-by-row (too many round trips), not millions at once (locks and memory)\n14. **Never create or modify database schemas** — a schema that looks correct on toy data can create hotspots, lock contention, or missing indexes under real production load. Schema design requires understanding of data volumes, access patterns, and production constraints that AI does not have\n15. **Avoid hidden SQL features** — do not rely on triggers, views, materialized views, stored procedures, or row-level security in application code\n\n## Library Choice\n\n| Library | Best for | Struct scanning | PostgreSQL-specific |\n| --- | --- | --- | --- |\n| `database\u002Fsql` | Portability, minimal deps | Manual `Scan` | No |\n| `sqlx` | Multi-database projects | `StructScan` | No |\n| `pgx` | PostgreSQL (30-50% faster) | `pgx.RowToStructByName` | Yes (COPY, LISTEN, arrays) |\n| GORM\u002Fent | **Avoid** | Magic | Abstracted away |\n\n**Why NOT ORMs:**\n\n- Unpredictable query generation — N+1 problems you cannot see in code\n- Magic hooks and callbacks (BeforeCreate, AfterUpdate) make debugging harder\n- Schema migrations coupled to application code\n- Learning the ORM API is harder than learning SQL, and the abstraction leaks\n\n## Parameterized Queries\n\n```go\n\u002F\u002F ✗ VERY BAD — SQL injection vulnerability\nquery := fmt.Sprintf(\"SELECT * FROM users WHERE email = '%s'\", email)\n\n\u002F\u002F ✓ Good — parameterized (PostgreSQL)\nvar user User\nerr := db.GetContext(ctx, &user, \"SELECT id, name, email FROM users WHERE email = $1\", email)\n\n\u002F\u002F ✓ Good — parameterized (MySQL)\nerr := db.GetContext(ctx, &user, \"SELECT id, name, email FROM users WHERE email = ?\", email)\n```\n\n### Dynamic IN clauses\n\n```go\nquery, args, err := sqlx.In(\"SELECT * FROM users WHERE id IN (?)\", ids)\nif err != nil {\n    return fmt.Errorf(\"building IN clause: %w\", err)\n}\nquery = db.Rebind(query) \u002F\u002F adjust placeholders for your driver\nerr = db.SelectContext(ctx, &users, query, args...)\n```\n\n### Dynamic column names\n\nNever interpolate column names from user input. Use an allowlist:\n\n```go\nallowed := map[string]bool{\"name\": true, \"email\": true, \"created_at\": true}\nif !allowed[sortCol] {\n    return fmt.Errorf(\"invalid sort column: %s\", sortCol)\n}\nquery := fmt.Sprintf(\"SELECT id, name, email FROM users ORDER BY %s\", sortCol)\n```\n\nFor more injection prevention patterns, see the `samber\u002Fcc-skills-golang@golang-security` skill.\n\n## Struct Scanning and NULLable Columns\n\nUse `db:\"column_name\"` tags for sqlx, `pgx.CollectRows` with `pgx.RowToStructByName` for pgx. Handle NULLable columns with pointer fields (`*string`, `*time.Time`) — they work cleanly with both scanning and JSON marshaling. See [Scanning Reference](.\u002Freferences\u002Fscanning.md) for examples of all approaches.\n\n## Error Handling\n\n```go\nfunc GetUser(id string) (*User, error) {\n    var user User\n\n    err := db.GetContext(ctx, &user, \"SELECT id, name FROM users WHERE id = $1\", id)\n    if err != nil {\n        if errors.Is(err, sql.ErrNoRows) {\n            return nil, ErrUserNotFound \u002F\u002F translate to domain error\n        }\n        return nil, fmt.Errorf(\"querying user %s: %w\", id, err)\n    }\n\n    return &user, nil\n}\n```\n\nor:\n\n```go\nfunc GetUser(id string) (u *User, exists bool, err error) {\n    var user User\n\n    err := db.GetContext(ctx, &user, \"SELECT id, name FROM users WHERE id = $1\", id)\n    if err != nil {\n        if errors.Is(err, sql.ErrNoRows) {\n            return nil, false, nil \u002F\u002F \"no user\" is not a technical error, but a domain error\n        }\n        return nil, false, fmt.Errorf(\"querying user %s: %w\", id, err)\n    }\n\n    return &user, true, nil\n}\n```\n\n### Always close rows\n\n```go\nrows, err := db.QueryContext(ctx, \"SELECT id, name FROM users\")\nif err != nil {\n    return fmt.Errorf(\"querying users: %w\", err)\n}\ndefer rows.Close() \u002F\u002F prevents connection leaks\n\nfor rows.Next() {\n    \u002F\u002F ...\n}\nif err := rows.Err(); err != nil { \u002F\u002F always check after iteration\n    return fmt.Errorf(\"iterating users: %w\", err)\n}\n```\n\n### Common database error patterns\n\n| Error | How to detect | Action |\n| --- | --- | --- |\n| Row not found | `errors.Is(err, sql.ErrNoRows)` | Return domain error |\n| Unique constraint | Check driver-specific error code | Return conflict error |\n| Connection refused | `err != nil` on `db.PingContext` | Fail fast, log, retry with backoff |\n| Serialization failure | PostgreSQL error code `40001` | Retry the entire transaction |\n| Context canceled | `errors.Is(err, context.Canceled)` | Stop processing, propagate |\n\n## Context Propagation\n\nAlways use the `*Context` method variants to propagate deadlines and cancellation:\n\n```go\n\u002F\u002F ✗ Bad — no context, query runs until completion even if client disconnects\ndb.Query(\"SELECT ...\")\n\n\u002F\u002F ✓ Good — respects context cancellation and timeouts\ndb.QueryContext(ctx, \"SELECT ...\")\n```\n\nFor context patterns in depth, see the `samber\u002Fcc-skills-golang@golang-context` skill.\n\n## Transactions, Isolation Levels, and Locking\n\nFor transaction patterns, isolation levels, `SELECT FOR UPDATE`, and locking variants, see [Transactions](.\u002Freferences\u002Ftransactions.md).\n\n## Connection Pool\n\n```go\ndb.SetMaxOpenConns(25)              \u002F\u002F limit total connections\ndb.SetMaxIdleConns(10)              \u002F\u002F keep warm connections ready\ndb.SetConnMaxLifetime(5 * time.Minute)  \u002F\u002F recycle stale connections\ndb.SetConnMaxIdleTime(1 * time.Minute)  \u002F\u002F close idle connections faster\n```\n\nFor sizing guidance and formulas, see [Database Performance](.\u002Freferences\u002Fperformance.md).\n\n## Migrations\n\nUse an external migration tool. Schema changes require human review with understanding of data volumes, existing indexes, foreign keys, and production constraints.\n\nRecommended tools:\n\n- [golang-migrate](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate) — CLI + Go library, supports all major databases\n- [Flyway](https:\u002F\u002Fflywaydb.org\u002F) — JVM-based, widely used in enterprise environments\n- [Atlas](https:\u002F\u002Fatlasgo.io\u002F) — modern, declarative schema management\n\nMigration SQL should be written and reviewed by humans, versioned in source control, and applied through CI\u002FCD pipelines.\n\n## Avoid Hidden SQL Features\n\nDo not rely on triggers, views, materialized views, stored procedures, or row-level security in application code — they create invisible side effects and make debugging impossible. Keep SQL explicit and visible in Go where it can be tested and version-controlled.\n\n## Schema Creation\n\n**This skill does NOT cover schema creation.** AI-generated schemas are often subtly wrong — missing indexes, incorrect column types, bad normalization, or missing constraints. Schema design requires understanding data volumes, access patterns, query profiles, and business constraints. Use dedicated database tooling and human review.\n\n## Deep Dives\n\n- **[Transactions](.\u002Freferences\u002Ftransactions.md)** — Transaction boundaries, isolation levels, deadlock prevention, `SELECT FOR UPDATE`\n- **[Testing Database Code](.\u002Freferences\u002Ftesting.md)** — Mock connections, integration tests with containers, fixtures, schema setup\u002Fteardown\n- **[Database Performance](.\u002Freferences\u002Fperformance.md)** — Connection pool sizing, batch processing, indexing strategy, query optimization\n- **[Struct Scanning](.\u002Freferences\u002Fscanning.md)** — Struct tags, NULLable column handling, JSON marshaling patterns\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-security` skill for SQL injection prevention patterns\n- → See `samber\u002Fcc-skills-golang@golang-context` skill for context propagation to database operations\n- → See `samber\u002Fcc-skills-golang@golang-error-handling` skill for database error wrapping patterns\n- → See `samber\u002Fcc-skills-golang@golang-testing` skill for database integration test patterns\n\n## References\n\n- [database\u002Fsql tutorial](https:\u002F\u002Fgo.dev\u002Fdoc\u002Fdatabase\u002F)\n- [sqlx](https:\u002F\u002Fgithub.com\u002Fjmoiron\u002Fsqlx)\n- [pgx](https:\u002F\u002Fgithub.com\u002Fjackc\u002Fpgx)\n- [golang-migrate](https:\u002F\u002Fgithub.com\u002Fgolang-migrate\u002Fmigrate)\n",{"name":5,"paths":24,"license":15,"metadata":26,"description":7,"allowed-tools":36,"compatibility":37,"user-invocable":38},[25],"**\u002F*.go",{"author":27,"version":28,"openclaw":29},"samber","1.3.2",{"emoji":30,"install":31,"homepage":32,"requires":33},"🗄",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":34},[35],"go","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","2147d79c9cd764770418b462c29634bcdc710096","plugins\u002Fbase\u002Fskills\u002Fgolang-database","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace","https:\u002F\u002Fgithub.com\u002Fheynemann","http:\u002F\u002Fwww.thumbor.org","CTO @ Flutter Brazil | Former Meta & Coinbase","2026-09-29 21:26:05",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":38},[49,52,55],{"tool":50,"command":51},"npx","npx skills add heynemann\u002Fomp-marketplace --skill golang-database",{"tool":53,"command":54},"bunx","bunx skills add heynemann\u002Fomp-marketplace --skill golang-database",{"tool":56,"command":57},"pnpm","pnpm dlx skills add heynemann\u002Fomp-marketplace --skill golang-database","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002FSKILL.md",[60,66,70,74,78],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"evals\u002Fevals.json","REFERENCE","参考文档",15362,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002Fevals\u002Fevals.json",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fperformance.md",9254,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002Freferences\u002Fperformance.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fscanning.md",2248,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002Freferences\u002Fscanning.md",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Ftesting.md",6678,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002Freferences\u002Ftesting.md",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Ftransactions.md",1504,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-database\u002Freferences\u002Ftransactions.md",[83,90,97,104,111,118],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DFXDYP0N6P8KR0AF7C0TDK","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7DFX9C5B0T1T0AVDCWNR5P2","write-skill","Use when creating, designing, or fixing an agent skill (SKILL.md pack) — triggers include \"write a skill\", \"make me a skill\", \"create a skill\", skill directories, and skills that fail to trigger or fire on the wrong tasks.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwrite-skill\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7DFX64VSTQV0CSGYR76MPZF","write-agent","Use when creating, designing, or fixing an omp subagent (task agent) — triggers include \"write an agent\", \"make me an agent\", \"create a subagent\", agent `.md` definitions, and agents that misbehave when spawned via task.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwrite-agent\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7DFX22JEY7ZN9EDESM732K5","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7DFWYXR5V2CY2BPDAAS19R1","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7DFWXFFMBKV294WS66S475V","wait-what","Stop. That last message did not land: re-pitch it.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwait-what\u002FSKILL.md",[],[]]