Registry / database / forge-sql-orm-cli

forge-sql-orm-cli

JSON →
library2.1.29jsnpmunverified

Commonly used CLI for managing Atlassian Forge SQL database migrations and Drizzle ORM model generation. Version 2.1.29 (frequent releases) provides commands to auto-generate TypeScript entity files from a MySQL schema, create migration SQL, and update schemas. Integrates exclusively with Atlassian Forge environment; requires local install as dev dependency and usage via npm scripts. Differentiates by offering Forge-specific features like version tracking and environment-based configuration.

npm install forge-sql-orm-cli
INSTALL
IMPORT
SIG · FORGE-SQL-ORM-CLI
F
forge-sql-orm-cli
databasejavascriptv2.1.29
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
npx forge-sql-orm-cli generate:model
npx forge-sql-orm generate:model
The CLI is invoked via npx or npm scripts, not as a JavaScript import.
models
npm run models:create
node node_modules/forge-sql-orm-cli/bin/run
The CLI is designed to be used through npm scripts defined in package.json, not by directly calling the binary.
migrations:create
forge-sql-orm-cli migrations:create --output src/migration
forge-sql-orm-cli migration:create
Command is 'migrations:create' (plural) not 'migration:create' (singular).

Shows installation, setup of npm scripts, and execution of model generation and migration creation.

// Install as dev dependency npm install forge-sql-orm-cli -D // Add npm scripts (run once) npm pkg set scripts.models:create="forge-sql-orm-cli generate:model --output src/entities --saveEnv" npm pkg set scripts.migration:create="forge-sql-orm-cli migrations:create --force --output src/migration" npm pkg set scripts.migration:update="forge-sql-orm-cli migrations:update --entitiesPath src/entities --output src/migration" npm pkg set scripts.schema:create="forge-sql-orm-cli schema:create --entitiesPath src/entities" // Configure database credentials in .env (or use --saveEnv on first run) // Then run: npm run models:create npm run migration:create
Debug
Known issues
breakingCLI must be used exclusively through npm scripts; direct invocation via node_modules path may fail due to missing environment configuration.
fix
Always define npm scripts as shown in quickstart and run via npm run.
affects: >=1.0.0
gotchaThe --legacy-peer-deps flag is required during installation for UI-Kit projects due to peer dependency conflicts with older Forge SDK versions.
fix
Install with: npm install forge-sql-orm-cli -D --legacy-peer-deps
affects: >=2.0.0
deprecatedThe --saveEnv flag is deprecated in v2.1.x; environment variables should be set manually in .env file.
fix
Manually set DB_HOST, DB_PORT, etc. in .env instead of using --saveEnv.
affects: >=2.1.0
gotchaGenerated models are in TypeScript; if your project is JavaScript, you may need to compile or use ts-node.
fix
Ensure TypeScript compilation is set up or use ts-node to run scripts.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'forge-sql-orm-cli'
CLI not installed as a dev dependency or not run via npx.
fix
Run 'npm install forge-sql-orm-cli -D' first, then use 'npx forge-sql-orm-cli' or an npm script.
Error: Missing required argument: host
Database credentials not provided via flags or environment variables.
fix
Provide --host, --user, --password, --dbName flags or set corresponding environment variables (DB_HOST, etc.).
Error: Entity file not found at src/entities
The --entitiesPath specified does not contain generated entity files.
fix
Run 'generate:model' first to create entities, then point --entitiesPath to that output directory.
Upgrade
Version history
2.1.29latest on npm
Audit
Dependencies
drizzle-ormrequiredCore ORM dependency for generated models and schema operations
mysql2requiredDatabase driver for MySQL connections in Forge environment
Agent activity
7 hits · last 30 days
node
6
Resources
forge-sql-orm-cli — npm install forge-sql-orm-cli · libregistry