golang-database

Guide Go developers on SQL database access with parameterized queries and transactions.

Updated May 30, 2026
One-click install
npx skills add https://github.com/ozan-fn/mqtt-capture --skill golang-database-ozan-fn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-database
Source: https://github.com/ozan-fn/mqtt-capture/tree/main/.agents/skills/golang-database
Command: npx skills add https://github.com/ozan-fn/mqtt-capture --skill golang-database-ozan-fn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires database/sql, sqlx, pgx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for Go database access, helping developers write safe, explicit, and observable database code.

Core Features & Use Cases

  • Parameterized Queries: Prevents SQL injection and ensures secure data handling.
  • Context Propagation: Ensures deadlines and cancellation signals are respected.
  • Transactions and Locking: Manages multi-statement operations with proper isolation levels.
  • Connection Pooling: Optimizes database connection management.
  • Migrations: Recommends external tools for schema changes.
  • Use Cases: Ideal for Go backend engineers working with PostgreSQL, MariaDB, MySQL, or SQLite, as well as for database testing and debugging.

Quick Start

Invoke the golang-database skill to learn best practices for writing database code in Go.

Frequently Asked Questions about golang-database

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

FAQPage Schema
How do I prevent SQL injection when writing database queries in Go?

Using parameterized queries in Go prevents SQL injection by separating SQL code from data. The golang-database skill provides expert guidance on writing safe, explicit database code with parameterized queries to ensure secure data handling.

What's the best way to manage transactions and connection pooling in Go's database/sql package?

Managing transactions and connection pooling in Go's database/sql package requires setting explicit isolation levels and configuring pool limits. The golang-database skill provides best practices and code examples to optimize database connection management for safe and observable operations.

How do I use context propagation for Go database queries to handle timeouts?

Context propagation ensures Go database queries respect deadlines and cancellation signals. The golang-database skill provides best practices for passing context through your database access layer to maintain safe and observable query execution.

Does the golang-database skill provide guidance on using pgx and sqlx?

The golang-database skill offers comprehensive guidance on using pgx and sqlx. It provides best practices and code examples for Go developers working with various SQL databases and related tools to write safe, explicit database code.

What are the recommended tools for database migrations in Go backend applications?

For database migrations in Go backend applications, the golang-database skill recommends external tools for schema changes. It provides best practices for backend engineers working with PostgreSQL, MariaDB, MySQL, or SQLite to manage schema evolution.

When should I use specific isolation levels for transactions in Go?

Specific transaction isolation levels in Go should be used when managing multi-statement operations that require strict data consistency. The golang-database skill provides expert guidance on transactions and locking to ensure proper isolation for your database operations.