pgterra
JSON →pgterra (v0.2.19) is a declarative PostgreSQL schema management tool that generates SQL migration statements by comparing a target schema.sql file against the current state of a PostgreSQL database. Unlike imperative migration tools (e.g., knex, node-pg-migrate), users define the desired schema in a single SQL file and Terra computes the ALTER TABLE, CREATE INDEX, etc. statements needed to reach that state. Written in TypeScript with ESM-only distribution, it supports tables, columns, functions, triggers, sequences, constraints, indexes, enums, views, and procedures. Released under an MIT license with low release cadence, it is primarily a CLI tool (pgterra plan / apply) but can also be used programmatically. Requires Node >=18 and TypeScript ^5.8.3 as a peer dependency.