Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built pistachio, a declarative schema tool for PostgreSQL

Описание и применение

Pistachio упрощает управление схемой PostgreSQL, позволяя редактировать один декларативный SQL‑файл, генерировать и применять изменения в стиле Terraform, а также проверять idempotency через dump‑plan цикл.

Задача

Managing PostgreSQL schema changes with multiple migration files is cumbersome and error‑prone.

Результат

Pistachio streamlines schema management by consolidating migrations into a single declarative file, providing clear diffs, idempotent applies, and round‑trip validation via dump and plan. It reduces drift and simplifies collaboration.

Рабочий процесс

  • Write the desired schema in a single SQL file (e.g., schema.sql).
  • Run pista plan schema.sql to see the DDL diff that will be applied.
  • Run pista apply schema.sql to apply the changes to the database.
  • Run pista plan schema.sql again to confirm no changes remain.
  • Use pista dump to export the current schema for backup or migration purposes.
  • For an existing database, run pista dump > schema.sql to generate the initial desired schema file and then edit it moving forward.

Доказательства

Instead of piling up migration files, you keep editing one schema file as the desired state.

Источник

pista plan shows the diff, pista apply runs it, and a second plan reports no changes.

Источник

  • Дата записи: 2026-09-07T05:40:41.162Z