ποΈ Drizzle Setup CLI
A powerful CLI tool that automatically scaffolds and configures database setup using Drizzle ORM for PostgreSQL, SQLite, MySQL, and more databases.
β¨ Features
- π Zero Configuration Setup β Instantly scaffold database structure and config with minimal input
- π Automated Script Generation β Automatically updates
package.json
with essential Drizzle CLI scripts
- π Environment Management β Automatically injects required environment variables into
.env
- ποΈ Multi-Database Support β Seamlessly works with PostgreSQL, SQLite, MySQL, and other popular databases
- π Template System β Instantly sets up a working project structure with best practices
- π― Interactive Setup β Guided CLI experience with smart defaults
- π¦ Dependency Management β Automatically installs required packages based on your database choice
π Quick Start
Navigate to your project directory and run:
npx drizzle-setup
The CLI will guide you through an interactive setup process:
Setup Flow
- ποΈ Database Selection β Choose from PostgreSQL, SQLite, MySQL, and more
- βοΈ Configuration Preset β Select from optimized presets for different use cases
- π Target Directory β Specify where to create your database files
- π Template Selection β Choose from various boilerplate templates
- π§ Config Generation β Automatically create
drizzle.config.ts
- π Environment Setup β Update
.env
with required variables
- π¦ Package Management β Install dependencies via your preferred package manager
- β
Final Verification β Ensure everything is set up correctly
ποΈ Supported Databases
PostgreSQL
- Default PostgreSQL β Standard PostgreSQL setup
- Neon β Serverless PostgreSQL with automatic scaling
- Supabase β Open-source Firebase alternative
- Vercel Postgres β Serverless PostgreSQL by Vercel
SQLite
- Default SQLite β Local SQLite database
- Turso β Edge SQLite database
- Bun SQLite β High-performance SQLite with Bun runtime
- Cloudflare D1 β Serverless SQLite at the edge
MySQL
- Default MySQL β Standard MySQL setup
- PlanetScale β Serverless MySQL platform
- Railway MySQL β Cloud MySQL hosting
Other Databases
- MongoDB β NoSQL document database
- Redis β In-memory data structure store
Each database type comes with pre-configured templates, optimized settings, and environment variables.
ποΈ Project Structure
After setup, your project will have a clean, organized structure:
project-root/
βββ node_modules/ # Installed dependencies
βββ drizzle.config.ts # Drizzle configuration
βββ .env # Environment variables
βββ .env.example # Example environment file
βββ package.json # Updated with Drizzle scripts
βββ [target-folder]/ # Your database folder
β βββ schema.ts # Database schema definitions
β βββ index.ts # Database connection and exports
Perfect for Modern Stacks ποΈ
This tool shines especially bright with modern frameworks:
π Astro Projects
# In your Astro project
npx drizzle-setup
# Choose PostgreSQL + Vercel
# Boom! Database ready for your Astro app
β‘ Next.js Apps
# Perfect for Next.js API routes
npx drizzle-setup
# Select your preferred database
# Start building features, not configs
π― Any JavaScript/TypeScript Project
Whether itβs Express, Fastify, SvelteKit, or any other framework - this CLI has got you covered.
Real-World Impact π
Before Drizzle Setup CLI:
- β° 2-3 hours of setup time
- π Configuration errors and typos
- π Constant reference to documentation
- π« Frustration and context switching
After Drizzle Setup CLI:
- β‘ 30 seconds to complete setup
- β
Zero configuration errors
- π― Focus on building features
- π Happy developer experience
π License
MIT License Β© 2025 Drizzle Team