Registry / database / drizzle-kit

drizzle-kit

JSON →
library0.31.10jsnpmunverified

Drizzle Kit is a CLI migrator tool for Drizzle ORM, currently at stable version 0.31.10. It automatically generates SQL migrations from schema definitions, covering ~95% of common cases like deletions and renames by prompting user input. Released frequently with active development, it supports PostgreSQL, MySQL, and SQLite. Key differentiators include push schema (direct database sync), introspection, and zero-config migrations, making it a fast and developer-friendly alternative to tools like Prisma Migrate.

npm install drizzle-kit
INSTALL
IMPORT
SIG · DRIZZLE-KIT
D
drizzle-kit
databasejavascriptv0.31.10
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.

drizzle-kit
npx drizzle-kit push
drizzle-kit push
Best run via npx to ensure using the local version
drizzle-kit generate
drizzle-kit generate
drizzle-kit migrate
Use generate to create migration files, then 'migrate' to apply

Initializes a SQLite project with Drizzle, generates schema, and applies migrations to a local file database.

// 1. Install npm install drizzle-orm @libsql/client npm install -D drizzle-kit // 2. Create schema file: db/schema.ts import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'; export const users = sqliteTable('users', { id: integer('id').primaryKey({ autoIncrement: true }), name: text('name').notNull(), }); // 3. Configure drizzle.config.ts import { defineConfig } from 'drizzle-kit'; export default defineConfig({ schema: './db/schema.ts', out: './drizzle', dialect: 'sqlite', dbCredentials: { url: process.env.DB_URL ?? 'file:./local.db', }, }); // 4. Generate and apply migrations npx drizzle-kit generate npx drizzle-kit migrate
Debug
Known issues
breakingIn v0.30+, the config file must export using `defineConfig()` instead of simple object export.
fix
Wrap your config object with `defineConfig()` from 'drizzle-kit'
affects: >=0.30
breakingDialect option changed from 'postgres' to 'pg' (and similar for others) in v0.29+
fix
Use 'pg', 'mysql', or 'sqlite' as the dialect value
affects: >=0.29
deprecatedThe `--schema` CLI option is deprecated; use `drizzle.config.ts` instead.
fix
Move schema path to config file under `schema` key
affects: >=0.25
gotchaWhen using multiple schema files, they must not have colliding table names across files.
fix
Use different table names or separate databases
affects: >=0.20
gotchaDrizzle Kit may prompt for input during migration generation (e.g., for drop/reorder) — non-interactive environments need `--force` flag.
fix
Add `npx drizzle-kit generate --force` to skip prompts
affects: >=0.20
Errors
Common errors & fixes
Cannot find module 'drizzle-kit/dist/index.js'
Outdated global installation or local version mismatch
fix
Use `npx drizzle-kit` to ensure local version, or reinstall with `npm install -D drizzle-kit`
Error: No config file found
Missing drizzle.config.ts or drizzle.config.js in project root
fix
Create a config file (e.g., `drizzle.config.ts`) with your schema path and credentials
TypeError: Cannot destructure property 'schema' of 'undefined'
Config file exports incorrect value (e.g., missing default export)
fix
Ensure you export the config as default: `export default defineConfig({...})`
Error: Dialect 'postgres' is not supported
Using outdated dialect name; changed in v0.29+
fix
Replace 'postgres' with 'pg' in your config dialect field
Upgrade
Version history
0.31.10latest on npm
Audit
Dependencies
drizzle-ormrequiredCore ORM needed for schema definitions and operations
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
drizzle-kit — npm install drizzle-kit · libregistry