golang-database

Review Go database code for parameterized queries and connection pooling.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/constzz/dates-app --skill golang-database-constzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-database
Source: https://github.com/constzz/dates-app/tree/main/.agents/skills/golang-database
Command: npx skills add https://github.com/constzz/dates-app --skill golang-database-constzz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go, sqlx, pgx, golang-migrate, Flyway, Atlas, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive, expert-level guidance on Go database access, addressing common issues, and improving the quality of database interactions in Go applications.

Core Features & Use Cases

  • Database Access Guide: Offers best practices for database interactions, including parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, and more.
  • Code Review/Debugging: Helps in reviewing and debugging existing database code by identifying common mistakes and providing best practices.
  • Use Case: A Go developer encounters slow queries or data integrity issues. This Skill helps them optimize the database layer, improving application performance and reliability.

Quick Start

Utilize the golang-database skill to enhance your Go database code by following its guidelines on transactions, connection pooling, and error handling.

Frequently Asked Questions about golang-database

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

FAQPage Schema
What is the best way to handle Go database access without an ORM?

The best way to handle Go database access without an ORM is using sqlx or pgx, implementing parameterized queries, handling nullable columns, and configuring connection pools for optimal performance and reliability.

How do I optimize Go database code for slow queries and data integrity issues?

To optimize Go database code, enforce best practices such as using parameterized queries, managing transactions and isolation levels, and properly configuring connection pools. This helps resolve slow queries and data integrity issues effectively.

How do I handle nullable columns when scanning database rows in Go?

Handle nullable columns when scanning database rows in Go by applying expert struct scanning techniques and best practices. This ensures safe data mapping without risking nil pointer dereferences or scan errors.

Does this Go database guidance work with MySQL and PostgreSQL?

Yes, this Go database guidance works with PostgreSQL, MariaDB, MySQL, and SQLite. It applies to developers working with these databases using the database/sql package, sqlx, and pgx.

sqlx vs pgx: which should I use for Go database access?

Choosing sqlx vs pgx depends on your needs, but both are recommended over ORMs for Go database access. This Skill provides best practices for implementing parameterized queries and struct scanning using either library.

What are the limitations of using ORMs compared to sqlx or pgx in Go?

ORMs often hide query complexity and limit control compared to using sqlx or pgx in Go. By enforcing direct parameterized queries and transaction management, you avoid hidden performance bottlenecks and maintain explicit data integrity.