SQL Creator generates SQL migration queries by diffing two ASTs (Abstract Syntax Trees) representing database schemas. Version 0.54.0 is the latest stable release. It is used to programmatically produce ALTER TABLE, CREATE TABLE, DROP TABLE, and similar statements from a 'from' and 'to' AST. It is distinct from migration tools like Knex or TypeORM because it operates purely on ASTs and does not require a specific ORM or database driver. The library focuses on schema comparison rather than executing migrations or managing versions. It supports PostgreSQL and MySQL dialects.
npm install sql-creatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to parse two SQL schemas, create a migrator, and generate migration SQL.
Use import syntax instead of require().
Upgrade Node.js to 12 or later.
Use migrator.withDialect() or similar builder methods.
Always use the provided parse functions and avoid direct AST manipulation.
Use await when calling parse functions.
Set "type": "module" in package.json or rename file to .mjs.
Switch to import syntax or use dynamic import(): import('sql-creator').then(m => ...)Run npm install sql-creator (or yarn add sql-creator) and ensure node_modules is present.
No dependency data recorded yet.