Package Exports
- drizzle-init
- drizzle-init/index.js
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 (drizzle-init) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
drizzle-init
drizzle-init is a CLI tool designed to initialize a Drizzle ORM setup with various database configurations, including PostgreSQL, SQLite, and MySQL. This tool simplifies the process of creating the necessary configuration files and folders for your Drizzle-based project.
Features
- Database Support: Configure your project for PostgreSQL, SQLite, or MySQL.
- Automated Setup: Automatically creates necessary directories and files, including
drizzle.config.ts,schema.ts, anddb.ts. - Custom Configuration: Choose from various database providers and customize the generated configuration based on your project requirements.
Installation
To install drizzle-init, you can clone the repository and install dependencies:
npx drizzle-init
# OR
git clone https://github.com/naeem-gg/drizzle-init.git
cd drizzle-init
npm installYou can also install it globally:
npm install -g drizzle-initUsage
After installing, you can use the CLI by running:
drizzle-initThis will prompt you to choose your database and provider, and automatically generate the necessary files.
Example
$ drizzle-init
Choose your database?
> postgresql
> sqlite
> mysql
What are you using?
> Neon
> Xata
> PostgresJS
> node-postgres
> Vercel Postgres
> Supabase
> AWS Data API
> HTTP Proxy
Directory 'drizzle' has been created successfully.
Directory 'migrations' has been created successfully.
schema.ts has been created successfully.
db.ts has been created successfully.
drizzle.config.ts has been written successfully.File Structure
After running the CLI, your project structure will look like this:
/your-project/
├── drizzle/
│ ├── schema.ts
│ ├── db.ts
│ └── migrations/
└── drizzle.config.tsConfiguration Files
drizzle.config.ts: Contains the configuration for Drizzle ORM based on the database and provider you selected.schema.ts: Placeholder for your database schema.db.ts: Contains the setup for connecting to your database.
Contributing
Contributions are welcome! If you have any ideas, issues, or suggestions, feel free to open an issue or create a pull request.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a pull request.
License
This project is licensed under the ISC License.
Acknowledgments
Special thanks to the developers of Drizzle ORM and the open-source community for their contributions.