nexusql is a database migration toolkit for PostgreSQL that uses DBML (Database Markup Language) schema definitions to generate and apply migration SQL. Current stable version is 0.9.10. It is actively maintained with weekly releases. Unlike other migration tools, nexusql integrates with migra (a Python diffing engine) to produce accurate migration SQL by comparing the live database schema against the DBML file. It also generates TypeScript type definitions from the schema, making it particularly useful for full-stack TypeScript projects. Major features include CLI commands for initialization, migration generation, applying/rolling back migrations, and type generation. The tool bundles most dependencies except migra, which must be installed separately via pip.
npm install nexusqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows complete setup: install migra, nexusql, init project, configure DB URL, create DBML schema, and run migration.
Upgrade Node.js to version 18 or later.
Run 'pip install migra' before using nexusql.
Set the password as-is in .env (e.g., password@123) and nexusql will encode it.
Replace SQL keywords like NOT NULL with DBML attributes such as [not null].
Ensure PostgreSQL is running on localhost and check DATABASE_URL spelling.
Run 'pip install migra' and ensure Python is in PATH.
Replace 'PRIMARY KEY' with '[pk]' and use [unique, not null] etc.