PostgreSQL migration tool with integrated schema differ, powered by PGlite (PostgreSQL compiled to WASM). Current stable version 0.1.2. Schema extraction, DDL generation, diffing, and diff validation run in-process against PGlite without needing an external PostgreSQL server. Features automatic diff validation via round-tripping, hazard annotations for destructive operations, YAML migration drafting, and an ephemeral database mode for tools like Prisma. Requires Node.js >=20.
npm install pgmagmigNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows bootstrapping, drafting a migration from a SQL file, and applying migrations to a database.
Use Node.js >=20
Use `pgmagmig diff --from-empty --to-sql schema.sql` instead.
Ensure migration files are valid YAML (`.yaml` extension).
Maintain consecutive numerical prefixes (e.g., 0001, 0002).
Add `--allow-hazards all` to `draft-migration` command, or specify specific hazard types.
Use import statement or npx: `import { migrate } from 'pgmagmig'` or `npx pgmagmig`Upgrade Node.js to version 20 or later.
Ensure migration files are named sequentially starting from 0001.yaml.
No dependency data recorded yet.