golang-database

Audit Go database code for parameterized queries, transactions, and connection handling.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-database-tamago0224
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-database
Source: https://github.com/tamago0224/kuroshio-mta/tree/main/.agents/skills/golang-database
Command: npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-database-tamago0224

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It eliminates the risk of insecure, inefficient, and hard‑to‑maintain database interactions in Go applications by enforcing best‑practice patterns.

Core Features & Use Cases

  • Enforces parameterized queries and strict context propagation.
  • Provides guidance on struct scanning, NULL handling, and error patterns.
  • Details transaction handling, isolation levels, SELECT FOR UPDATE, and connection‑pool configuration.
  • Offers batch‑processing recommendations and migration tooling advice while explicitly forbidding ORM usage and hidden SQL features such as triggers or views.

Quick Start

Use the golang-database skill to audit your Go code’s database layer and receive production‑ready recommendations.

Frequently Asked Questions about golang-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle database transactions and connection pooling in Go safely?

To manage database transactions and connection pooling in Go safely, you must enforce proper context propagation, strict isolation levels, and configure connection pool limits to prevent leaks and ensure transactional integrity during concurrent query execution.

What is the best way to prevent SQL injection in Go database queries?

The best way to prevent SQL injection in Go database queries is by enforcing strict parameterized queries, ensuring user input is treated as data rather than executable code and eliminating the risk of insecure SQL string concatenation.

Does this approach work with pgx and sqlx for PostgreSQL and MySQL?

Yes, this approach works with Go projects using database/sql, sqlx, or pgx for PostgreSQL, MySQL, MariaDB, or SQLite, auditing database access code across these drivers to ensure safe, performant query execution and connection handling.

How do I handle NULL values when scanning database rows into Go structs?

To handle NULL values when scanning database rows into Go structs, you must apply specific struct scanning and NULL handling patterns to ensure type safety and prevent runtime errors when database columns contain missing data.

Why should I avoid using ORMs and hidden SQL features in Go applications?

You should avoid ORMs and hidden SQL features like triggers or views in Go applications to eliminate hard-to-maintain database interactions, enforcing raw SQL with strict parameterized queries for transparent, efficient, and predictable database access.