JSPM

@excli/orm-init

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q64043F
  • License ISC

A CLI tool for setting up popular SQL and NoSQL ORMs/ODMs in Node.js projects, with support for both JavaScript and TypeScript.

Package Exports

  • @excli/orm-init
  • @excli/orm-init/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@excli/orm-init) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ORM Init CLI Tool

A CLI tool for setting up popular SQL and NoSQL ORMs/ODMs in Node.js projects, with support for both JavaScript and TypeScript.

npm version License: ISC Node.js TypeScript

Part of the excli ecosystem.


Features

  • ๐Ÿ—„๏ธ SQL โ€” MySQL, MariaDB, PostgreSQL
  • ๐Ÿƒ NoSQL โ€” MongoDB
  • ๐Ÿ”— ORMs/ODMs โ€” Prisma, Sequelize, TypeORM, Drizzle, Mongoose
  • ๐Ÿš€ JS & TS support
  • ๐Ÿ“ฆ Package managers โ€” npm, yarn, pnpm, bun
  • โšก Interactive and flag-based modes

Usage

Interactive Mode

npx @excli/orm-init

Guides you through selecting database, ORM, language, and package manager.

Flag-Based Mode

# TypeScript + PostgreSQL + Prisma + pnpm
npx @excli/orm-init --ts --pnpm --postgres --prisma

# JavaScript + MongoDB + Mongoose + npm
npx @excli/orm-init --js --npm --mongodb --mongoose

# TypeScript + MySQL + TypeORM + yarn
npx @excli/orm-init --ts --yarn --mysql --typeorm

# TypeScript + PostgreSQL + Drizzle + bun
npx @excli/orm-init --ts --bun --postgres --drizzle

# JavaScript + MySQL + Sequelize + pnpm
npx @excli/orm-init --js --pnpm --mysql --sequelize

Global Install

npm install -g @excli/orm-init
excli-orm-init [flags]

Requirements


Flags

Category Flag Description
Language --ts / --js TypeScript or JavaScript
Database --mysql --mariadb --postgres --mongodb Target database
ORM/ODM --prisma --sequelize --typeorm --drizzle --mongoose ORM/ODM to configure
Package Manager --npm --yarn --pnpm --bun Package manager to use

Compatibility Matrix

ORM / ODM MySQL MariaDB PostgreSQL MongoDB
Prisma โœ… โœ… โœ… โœ…
Sequelize โœ… โœ… โœ… โŒ
TypeORM โœ… โœ… โœ… โœ…
Drizzle โœ… โœ… โœ… โŒ
Mongoose โŒ โŒ โŒ โœ…

Incompatible combinations are caught at runtime โ€” the CLI will prompt you to correct them.


What Gets Generated

  • ORM config file โ€” pre-configured database connection
  • Schema / Model file โ€” starter schema or model for your chosen ORM

Note: .env, .env.example, and .gitignore are not generated. This is intentional so the tool integrates safely into both new and existing projects. Use @excli/docker to auto-generate a complete .env, or create one manually (see below).

Known Issues & Gotchas

Sequelize + MariaDB โ€” Connection String Prefix

The DATABASE_URL must use the mariadb:// prefix, not mysql://. Using the wrong prefix causes Sequelize to load the wrong driver.

# โŒ Wrong
DATABASE_URL="mysql://root:password@localhost:3306/mydb"

# โœ… Correct
DATABASE_URL="mariadb://root:password@localhost:3306/mydb"

Prisma โ€” Shadow Database Error

During prisma migrate dev, Prisma requires a shadow database and needs CREATE DATABASE privileges. Use root credentials for local development.

# โœ… Use root credentials for migrations
DATABASE_URL="mysql://root:rootpassword@localhost:3306/mydb"

This only applies to prisma migrate dev. Production deployments use prisma migrate deploy, which does not require shadow database creation.

TypeORM โ€” synchronize: true in Production

Never enable synchronize: true in production โ€” it can drop or alter columns on startup. Always use migrations instead.

// โŒ Development only
synchronize: true;

// โœ… Production
synchronize: false;

Drizzle โ€” Migration Folder

Drizzle outputs SQL migrations to a drizzle/ folder. Commit this folder to version control โ€” it serves as your migration history.

Mongoose โ€” No Migrations

MongoDB is schemaless; existing documents are not updated when your Mongoose schema changes. Handle data migrations manually.


Troubleshooting

Problem Solution
Prisma shadow database error Use root credentials in DATABASE_URL
Incompatible ORM + database Check the compatibility matrix
.env not generated Expected โ€” create manually or use @excli/docker
TypeORM decorators failing in JS Use TypeScript; JS decorator support is limited
Prisma Client not found Run npx prisma generate after setup
Connection refused Ensure your database is running before testing

excli Ecosystem

Package Description
@excli/express Express app generator for JS/TS
@excli/docker Docker Compose + .env generator
@excli/orm-init ORM/ODM setup (this package)

Full project setup in one command:

npx @excli/express

Scaffolds a complete Express app with Docker, a running database, and a configured ORM.


Contributing

Bug reports, feature requests, and pull requests are welcome.


License

ISC โ€” see LICENSE for details.

Author

Noman ยท pxycknomdictator@gmail.com ยท @pxycknomdictator