Declarative database schema management tool for provisioning, tracking, syncing, and modifying database schemas using plain, version-controlled SQL. Current stable version is 1.7.1. It supports PostgreSQL and MySQL, and is inspired by Liquibase and Terraform. Key differentiators include a declarative approach with two schema management classes (changes and resources), automatic detection of out-of-sync resources, and seamless integration into CI/CD pipelines. Release cadence is not specified but appears active. It ships TypeScript types and requires Node >=8.0.0.
npm install sql-schema-controlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to plan and apply schema changes using sql-schema-control with PostgreSQL, including connection setup and error handling.
Grant DDL privileges (e.g., CREATE, ALTER, DROP) to the user specified in the connection config.
Set strict: false in the control config if you expect uncontrolled resources.
Update your config to pass the connection object directly instead of a module path.
Set the dialect to the exact version of your PostgreSQL or MySQL server (e.g., '10.7' for Postgres).
Ensure your control directory contains only .sql files, organized by changes/ and resources/ subdirectories.
Run: npm install pg --save-dev
Ensure the database server is running and the host/port are correct in the connection config.
Grant USAGE, CREATE on schema and DDL privileges to the user. For example: GRANT ALL ON SCHEMA public TO your_user;
Pass a connection object directly instead of a module path, or ensure the module exports a promiseConfig function.