@dbcube/cli
v5.2.10
Published
Command-line interface for DBCube: schema management (.cube files), migrations with rollback, seeders, triggers, TypeScript type generation and database introspection.
Maintainers
Readme
@dbcube/cli
Command-line interface for DBCube: schema management with .cube files, tracked migrations with rollback, seeders, triggers, TypeScript type generation and database introspection.
Installation
npm install -D @dbcube/cli
npx dbcube initCommands
| Command | Description |
|---|---|
| npx dbcube init | Scaffold a new project (config + dbcube/ + example schema) |
| npx dbcube generate | Generate TypeScript types from .table.cube files |
| npx dbcube validate | Validate every .cube file without executing (exit 1 on errors — CI-friendly) |
| npx dbcube doctor | Diagnose config, binaries and database connectivity |
| npx dbcube dev | Watch mode: saving a .cube file applies it automatically |
| npx dbcube run database:create | Interactive database setup (config + physical creation) |
| npx dbcube run table:fresh | Drop and recreate all tables (asks for written confirmation; --force for CI) |
| npx dbcube run table:refresh | Apply schema changes without dropping data |
| npx dbcube run table:alter | Apply pending .alter.cube migrations (--dry-run, --all) |
| npx dbcube migrate:status | Show applied / pending / modified migrations |
| npx dbcube migrate:rollback | Revert the last migration batch |
| npx dbcube run pull [db] | Generate .table.cube files FROM an existing database (MySQL, PostgreSQL, SQLite) |
| npx dbcube run seeder:add | Run .seeder.cube data seeders |
| npx dbcube run trigger:fresh | Recreate triggers from .trigger.cube files |
| npx dbcube update | Check and update the Rust engine binaries |
| npx dbcube run download <engine> [ver] | Download a specific engine binary |
| npx dbcube -v | Versions of CLI, packages, engines, Node and platform |
Run npx dbcube help for the full reference.
Configuration
dbcube.config.js (created by init):
module.exports = function (config) {
config.set({
databases: {
myapp: {
type: "sqlite", // mysql | postgres | sqlite | mongodb
config: { DATABASE: "myapp" }
}
}
});
};Documentation
https://dbcube.org
License
MIT
