postgresql-data-layer

Design PostgreSQL schemas and migrations for Node.js/TypeScript applications.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/AndreaCadonna/sbobuz-web-game-app --skill postgresql-data-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-data-layer
Source: https://github.com/AndreaCadonna/sbobuz-web-game-app/tree/main/skills/postgresql-data-layer
Command: npx skills add https://github.com/AndreaCadonna/sbobuz-web-game-app --skill postgresql-data-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides production-focused guidance to design, operate, and evolve PostgreSQL schemas for Node.js/TypeScript backends, reducing data integrity issues, downtime during migrations, and query performance bottlenecks.

Core Features & Use Cases

  • Schema Design & Naming Conventions: Recommended table, column, key, and index naming to keep schema consistent and maintainable.
  • Migrations & Backward Compatibility: Patterns for forward-only, idempotent, and rolling-deploy-safe migrations to enable zero-downtime schema changes.
  • Connection Pooling & Monitoring: Pool sizing guidance, timeouts, and monitoring hooks to avoid exhausting database connections.
  • Query Patterns & Safety: Repository pattern, parameterized queries, and transaction handling examples to prevent injection and ensure atomic updates.
  • Indexing & JSONB Guidance: When to add indexes, partial and concurrent index strategies, and appropriate uses of JSONB versus relational columns.
  • Dual-store Planning: Decision framework for what belongs in PostgreSQL versus Redis (durability vs ephemeral state).

Quick Start

Design a normalized games and game_actions schema, produce migration steps that are backward-compatible, and recommend connection pool and indexing settings for a Node.js/TypeScript backend.

Frequently Asked Questions about postgresql-data-layer

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

FAQPage Schema
How do I run zero-downtime PostgreSQL migrations in a Node.js backend?

To ensure zero-downtime PostgreSQL migrations, apply forward-only, idempotent, and rolling-deploy-safe patterns that maintain backward compatibility. This approach prevents locking and downtime during Node.js schema changes.

What is the recommended connection pool size for PostgreSQL in Node.js?

Connection pool sizing for PostgreSQL requires balancing available database connections with Node.js concurrency. Apply pool sizing guidance, statement timeouts, and monitoring hooks to avoid exhausting database connections under load.

When should I use JSONB columns versus normalized relational tables in PostgreSQL?

Use JSONB columns for flexible, ephemeral data and normalized relational tables for structured, query-heavy data. Apply specific guidance on appropriate JSONB uses versus relational columns to balance query performance and schema consistency.

How do I handle ACID transactions and parameterized queries in Node.js?

Handle ACID transactions and parameterized queries in Node.js by implementing the repository pattern with transaction handling examples. This prevents SQL injection and ensures atomic updates to the PostgreSQL database.

What data belongs in PostgreSQL versus Redis for a Node.js application?

Data requiring durability belongs in PostgreSQL, while ephemeral state belongs in Redis. Apply a dual-store decision framework to determine what data goes where, optimizing both persistence and performance in Node.js backends.

When should I add partial or concurrent indexes in PostgreSQL?

Add partial or concurrent indexes in PostgreSQL when optimizing query performance for specific subsets of data without blocking writes. Apply production-ready indexing strategies to reduce query bottlenecks and improve Node.js backend efficiency.