golang-database

Guide Go developers on secure SQL database access with parameterized queries.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-database-luigiapcpereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-database
Source: https://github.com/LuigiAPCPereira/evolutiondocs/tree/main/.agents/skills/golang-database
Command: npx skills add https://github.com/LuigiAPCPereira/evolutiondocs --skill golang-database-luigiapcpereira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides guidance on best practices for database access in Golang, ensuring secure, efficient, and maintainable database interactions.

Core Features & Use Cases

  • Best Practices: Offers a comprehensive guide to using Go's database/sql package and third-party libraries like sqlx and pgx safely.
  • SQL Injection Prevention: Instructs on using parameterized queries to prevent SQL injection vulnerabilities.
  • Performance Optimization: Discusses connection pooling, indexing strategies, and query optimization techniques.
  • Use Case: Ideal for Go developers looking to write secure and efficient database code, or those needing to audit and debug existing codebases.

Quick Start

Run the skill with the 'golang-database' command to get started.

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 in Golang database access?

To prevent SQL injection in Golang database access, use parameterized queries instead of string concatenation. This Skill guides you through implementing parameterized queries with Go's `database/sql` package and libraries like `sqlx` and `pgx` to ensure secure database interactions.

What's the best way to optimize Golang database performance?

Optimizing Golang database performance involves proper connection pooling, indexing strategies, and query optimization. This Skill provides actionable guidance on configuring connection pools and leveraging context propagation to maintain efficient and responsive database access.

Does this Skill cover using third-party libraries like sqlx and pgx with Go?

Yes, this Skill covers using third-party libraries like `sqlx` and `pgx` alongside Go's native `database/sql` package. It offers best practices for safely interacting with SQL databases using these tools to ensure secure and maintainable code.

How do I manage database migrations in a Golang application?

To manage database migrations in a Golang application, this Skill recommends using external migration tools rather than application-level logic. This approach ensures database schema changes are handled safely and consistently across different environments.

Why should I use context propagation with Go database queries?

Using context propagation with Go database queries allows you to manage timeouts and cancellations effectively. This Skill emphasizes context propagation as a best practice to prevent long-running queries from blocking your application and degrading performance.

Can I use this Skill to audit and debug existing Golang database code?

Yes, you can use this Skill to audit and debug existing Golang database code. It is designed for Go developers who need to review their codebases against security and performance best practices, ensuring secure and efficient database operations.