howto-develop-with-postgres

Guide PostgreSQL development with transaction safety, type safety, and schema patterns.

8|1|Updated Feb 25, 2022
One-click install
npx skills add https://github.com/ayubun/dotfiles --skill howto-develop-with-postgres-ayubun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: howto-develop-with-postgres
Source: https://github.com/ayubun/dotfiles/tree/main/configs/opencode/skills/ed3d-house-style/howto-develop-with-postgres
Command: npx skills add https://github.com/ayubun/dotfiles --skill howto-develop-with-postgres-ayubun

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenges of developing with PostgreSQL by providing a comprehensive guide to best practices, patterns, and code examples.

Core Features & Use Cases

  • Transaction Management: Ensures transaction safety with TX_ naming and read-write separation.
  • Type Safety: Enforces type safety for UUIDs/JSONB and snake_case conventions.
  • Schema Patterns: Offers guidelines for schema design, indexing, and soft deletes.
  • Concurrency: Provides strategies for default and stricter isolation levels.
  • Migrations: Outlines a generate + migrate workflow for database changes.
  • Use Case: Developers looking to implement robust, type-safe PostgreSQL applications with transactional integrity.

Quick Start

Follow the guidelines in this Skill to develop PostgreSQL code that enforces transaction safety, type safety, and follows best practices.

Frequently Asked Questions about howto-develop-with-postgres

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

FAQPage Schema
What's the best way to ensure transaction safety in PostgreSQL?

Transaction safety in PostgreSQL is best ensured by using TX_ naming conventions and separating read-write operations. This approach maintains transactional integrity and prevents data inconsistencies in robust applications.

How do I enforce type safety for UUIDs and JSONB in PostgreSQL?

Type safety for PostgreSQL UUIDs and JSONB is enforced by applying strict typing conventions and snake_case naming. This ensures robust, type-safe code and prevents data format inconsistencies across database schemas.

What schema design patterns should I use for PostgreSQL indexing and soft deletes?

PostgreSQL schema design patterns for robust applications include structured guidelines for indexing and soft deletes. These patterns optimize query performance while maintaining data integrity by avoiding hard deletions.

How do I manage concurrency and isolation levels in PostgreSQL?

PostgreSQL concurrency management requires strategies for both default and stricter isolation levels. These strategies ensure transactional integrity and type safety when multiple concurrent operations access the database.

What is the generate + migrate workflow for PostgreSQL database changes?

The generate + migrate workflow for PostgreSQL database changes outlines a structured migration process. It ensures schema design modifications are applied safely and consistently without disrupting transaction safety.