Gathering detailed insights and metrics for @anthonyalayo/drizzle-kit
Gathering detailed insights and metrics for @anthonyalayo/drizzle-kit
Gathering detailed insights and metrics for @anthonyalayo/drizzle-kit
Gathering detailed insights and metrics for @anthonyalayo/drizzle-kit
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
npm install @anthonyalayo/drizzle-kit
Typescript
Module System
Node Version
NPM Version
71.4
Supply Chain
85.2
Quality
79.9
Maintenance
50
Vulnerability
98.6
License
TypeScript (98.67%)
JavaScript (1.33%)
Total Downloads
337
Last Day
10
Last Week
22
Last Month
333
Last Year
337
Apache-2.0 License
29,105 Stars
2,868 Commits
925 Forks
55 Watchers
25 Branches
133 Contributors
Updated on Jul 08, 2025
Minified
Minified + Gzipped
Latest Version
1.0.7
Package Id
@anthonyalayo/drizzle-kit@1.0.7
Unpacked Size
6.89 MB
Size
1.08 MB
File Count
15
NPM Version
11.2.0
Node Version
20.19.0
Published on
May 04, 2025
Cumulative downloads
Total Downloads
66
Drizzle Kit is a CLI migrator tool for Drizzle ORM. It is probably the one and only tool that lets you completely automatically generate SQL migrations and covers ~95% of the common cases like deletions and renames by prompting user input. https://github.com/drizzle-team/drizzle-kit-mirror - is a mirror repository for issues.
Check the full documentation on the website.
Drizzle Kit traverses a schema module and generates a snapshot to compare with the previous version, if there is one. Based on the difference, it will generate all needed SQL migrations. If there are any cases that can't be resolved automatically, such as renames, it will prompt the user for input.
For example, for this schema module:
1// src/db/schema.ts 2 3import { integer, pgTable, serial, text, varchar } from "drizzle-orm/pg-core"; 4 5const users = pgTable("users", { 6 id: serial("id").primaryKey(), 7 fullName: varchar("full_name", { length: 256 }), 8 }, (table) => ({ 9 nameIdx: index("name_idx", table.fullName), 10 }) 11); 12 13export const authOtp = pgTable("auth_otp", { 14 id: serial("id").primaryKey(), 15 phone: varchar("phone", { length: 256 }), 16 userId: integer("user_id").references(() => users.id), 17});
It will generate:
1CREATE TABLE IF NOT EXISTS auth_otp ( 2 "id" SERIAL PRIMARY KEY, 3 "phone" character varying(256), 4 "user_id" INT 5); 6 7CREATE TABLE IF NOT EXISTS users ( 8 "id" SERIAL PRIMARY KEY, 9 "full_name" character varying(256) 10); 11 12DO $$ BEGIN 13 ALTER TABLE auth_otp ADD CONSTRAINT auth_otp_user_id_fkey FOREIGN KEY ("user_id") REFERENCES users(id); 14EXCEPTION 15 WHEN duplicate_object THEN null; 16END $$; 17 18CREATE INDEX IF NOT EXISTS users_full_name_index ON users (full_name);
1npm install -D drizzle-kit
Running with CLI options:
1// package.json 2{ 3 "scripts": { 4 "generate": "drizzle-kit generate --out migrations-folder --schema src/db/schema.ts" 5 } 6}
1npm run generate
No vulnerabilities found.
No security vulnerabilities found.
Last Day
900%
10
Compared to previous day
Last Week
46.7%
22
Compared to previous week
Last Month
8,225%
333
Compared to previous month
Last Year
0%
337
Compared to previous year