database-sqlc-patterns

Document and enforce PostgreSQL database patterns using sqlc for Chronicle.

6|5|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/Emyrk/chronicle --skill database-sqlc-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-sqlc-patterns
Source: https://github.com/Emyrk/chronicle/tree/main/agent-skills/database-sqlc-patterns
Command: npx skills add https://github.com/Emyrk/chronicle --skill database-sqlc-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to managing Chronicle's PostgreSQL database, ensuring efficient and maintainable data operations through the use of sqlc.

Core Features & Use Cases

  • Query Writing Conventions: Learn standardized patterns for creating SQL queries.
  • Migration Workflow: Understand how to create and manage database schema changes.
  • Custom Type Handling: Discover how to map PostgreSQL types to Go types effectively.
  • Testing Strategies: Implement robust database testing with provided utilities.
  • Use Case: When adding a new feature that requires storing user preferences, you would use this Skill to define the new table schema in a migration, write the corresponding Go functions using sqlc, and ensure it's tested thoroughly.

Quick Start

Use the database-sqlc-patterns skill to add a new user role column to the users table.

Frequently Asked Questions about database-sqlc-patterns

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

FAQPage Schema
How do I write PostgreSQL queries with sqlc in Go?

To write PostgreSQL queries with sqlc, follow standardized query writing conventions that generate type-safe Go code, ensuring maintainable data operations for Chronicle database modifications.

What is the workflow for managing PostgreSQL database migrations?

The PostgreSQL database migration workflow involves creating and managing schema changes systematically, ensuring database structure modifications are tracked and applied consistently across environments.

How do I map custom PostgreSQL types to Go types using sqlc?

Mapping custom PostgreSQL types to Go types using sqlc requires applying custom type overrides, allowing effective translation of complex database column types into native Go structures.

How do I test database queries in Go using dbtestutil?

Testing database queries in Go uses dbtestutil utilities to implement robust testing strategies, ensuring PostgreSQL query modifications and schema changes are thoroughly validated before deployment.

Can sqlc handle batch operations for PostgreSQL databases?

Yes, sqlc handles batch operations for PostgreSQL databases, allowing developers to execute multiple queries efficiently using documented patterns to optimize bulk data processing workflows.