postgresql

Enforce PostgreSQL schema, migration, and data integrity guidelines for multi-tenant setups.

258|33|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/speakeasy-api/gram --skill postgresql-speakeasy-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/speakeasy-api/gram/tree/main/.agents/skills/postgresql
Command: npx skills add https://github.com/speakeasy-api/gram --skill postgresql-speakeasy-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rules and guidelines for working with PostgreSQL within Gram, including schema design, migrations, and data integrity.

Core Features & Use Cases

  • Multi-tenant friendly design with project_id and optional organization_id when appropriate
  • Change tracking with created_at and updated_at and soft delete handling via deleted_at
  • Safe migration practices with backwards compatibility guidance and SQLc integration

Quick Start

Consult Gram's PostgreSQL guidelines when starting a new database module.

Frequently Asked Questions about postgresql

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

FAQPage Schema
How do I design a multi-tenant PostgreSQL schema with project and organization isolation?

Multi-tenant PostgreSQL schemas use project_id and optional organization_id columns for data isolation. This enforces tenant boundaries while maintaining query flexibility across shared database tables.

What are the best practices for safe PostgreSQL schema migrations with backward compatibility?

Safe PostgreSQL migrations enforce backward compatibility by adding nullable columns first, deploying code changes, then backfilling data. This prevents downtime and ensures SQLc query scoping across schema evolutions.

How do I implement soft deletes and change tracking in a PostgreSQL database?

Soft deletes and change tracking in PostgreSQL use created_at, updated_at, and deleted_at timestamp columns. This preserves data integrity by retaining records instead of deleting them, enabling audit trails.

What naming conventions should I follow for PostgreSQL schema design?

PostgreSQL naming conventions enforce consistent table, column, and constraint naming across projects. Applying standardized conventions reduces schema ambiguity and ensures maintainable database design.

Does this PostgreSQL methodology work with SQLc query generation?

Yes, the PostgreSQL guidelines integrate with SQLc by enforcing safe migration practices and query scoping. This ensures generated queries align with schema evolution and maintain backward compatibility.