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

I built pistachio, a declarative schema tool for PostgreSQL

说明与用途

Pistachio 通过让开发者编辑单一声明式 SQL 文件,生成并应用类似 Terraform 的变更,并通过 dump‑plan 循环验证幂等性,从而简化 PostgreSQL 模式管理。

问题

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