{"_id":"@chtibizoux/drizzle-kit","name":"@chtibizoux/drizzle-kit","dist-tags":{"latest":"0.24.2"},"versions":{"0.24.2":{"name":"@chtibizoux/drizzle-kit","version":"0.24.2","homepage":"https://orm.drizzle.team","keywords":["drizzle","orm","pg","mysql","postgresql","postgres","sqlite","database","sql","typescript","ts","drizzle-kit","migrations","schema"],"repository":{"type":"git","url":"git+https://github.com/chtibizoux/drizzle-orm.git"},"author":{"name":"Drizzle Team"},"license":"MIT","bin":{"drizzle-kit":"bin.cjs"},"scripts":{"api":"tsx ./dev/api.ts","migrate:old":"drizzle-kit generate:mysql","cli":"tsx ./src/cli/index.ts","test":"TEST_CONFIG_PATH_PREFIX=./tests/cli/ vitest","build":"rm -rf ./dist && tsx build.ts && cp package.json dist/ && attw --pack dist","build:dev":"rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs","pack":"cp package.json README.md dist/ && (cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz","tsc":"tsc -p tsconfig.build.json","publish":"npm publish package.tgz"},"dependencies":{"@drizzle-team/brocli":"^0.10.1","@esbuild-kit/esm-loader":"^2.5.5","esbuild":"^0.19.7","esbuild-register":"^3.5.0"},"devDependencies":{"@arethetypeswrong/cli":"^0.15.3","@aws-sdk/client-rds-data":"^3.556.0","@cloudflare/workers-types":"^4.20230518.0","@electric-sql/pglite":"^0.1.5","@hono/node-server":"^1.9.0","@hono/zod-validator":"^0.2.1","@libsql/client":"^0.4.2","@neondatabase/serverless":"^0.9.1","@originjs/vite-plugin-commonjs":"^1.0.3","@planetscale/database":"^1.16.0","@types/better-sqlite3":"^7.6.4","@types/dockerode":"^3.3.28","@types/glob":"^8.1.0","@types/json-diff":"^1.0.3","@types/minimatch":"^5.1.2","@types/node":"^18.11.15","@types/pg":"^8.10.7","@types/pluralize":"^0.0.33","@types/semver":"^7.5.5","@types/uuid":"^9.0.8","@types/ws":"^8.5.10","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0","@vercel/postgres":"^0.8.0","ava":"^5.1.0","better-sqlite3":"^9.4.3","camelcase":"^7.0.1","chalk":"^5.2.0","commander":"^12.1.0","dockerode":"^3.3.4","dotenv":"^16.0.3","drizzle-kit":"0.21.2","drizzle-orm":"workspace:./drizzle-orm/dist","env-paths":"^3.0.0","esbuild-node-externals":"^1.9.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","get-port":"^6.1.2","glob":"^8.1.0","hanji":"^0.0.5","hono":"^4.1.5","json-diff":"1.0.6","minimatch":"^7.4.3","mysql2":"3.3.3","node-fetch":"^3.3.2","pg":"^8.11.5","pluralize":"^8.0.0","postgres":"^3.4.4","prettier":"^2.8.1","semver":"^7.5.4","superjson":"^2.2.1","tsup":"^8.0.2","tsx":"^3.12.1","typescript":"^5.4.3","uuid":"^9.0.1","vite-tsconfig-paths":"^4.3.2","vitest":"^1.4.0","wrangler":"^3.22.1","ws":"^8.16.0","zod":"^3.20.2","zx":"^7.2.2"},"exports":{".":{"import":{"types":"./index.d.mts","default":"./index.mjs"},"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./api":{"import":{"types":"./api.d.mts","default":"./api.mjs"},"require":{"types":"./api.d.ts","default":"./api.js"},"types":"./api.d.mts","default":"./api.mjs"}},"_id":"@chtibizoux/drizzle-kit@0.24.2","types":"./index.d.ts","description":"DrizzleKit - is a CLI migrator tool for DrizzleORM. It is probably 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","bugs":{"url":"https://github.com/chtibizoux/drizzle-orm/issues"},"_integrity":"sha512-PGlBmI9zA5RojRBW7WKm3QuJz8anRohK90X80MHTwcf9HmB/4H2xyUevX65Rlt7k71GB4dcrpb4xvLLNgtzknQ==","_resolved":"/workspaces/drizzle-orm/drizzle-kit/package.tgz","_from":"file:package.tgz","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-PGlBmI9zA5RojRBW7WKm3QuJz8anRohK90X80MHTwcf9HmB/4H2xyUevX65Rlt7k71GB4dcrpb4xvLLNgtzknQ==","shasum":"7ec30be38b05fead7969896d626894da474b3893","tarball":"https://registry.npmjs.org/@chtibizoux/drizzle-kit/-/drizzle-kit-0.24.2.tgz","fileCount":13,"unpackedSize":6242827,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFQWwSR+AfEwv/HoM9Cstcwq4xHG59+mXRlLfMH+ohwnAiEA6mvhgfp3sfuoaoHEfiM/RvlBTlIkKXWAiovCsZkaapQ="}]},"_npmUser":{"name":"chtibizoux","email":"5clemans585@gmail.com"},"directories":{},"maintainers":[{"name":"chtibizoux","email":"5clemans585@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/drizzle-kit_0.24.2_1725820313395_0.47958373171345725"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-08T18:31:53.271Z","0.24.2":"2024-09-08T18:31:53.592Z","modified":"2024-09-08T18:31:53.895Z"},"maintainers":[{"name":"chtibizoux","email":"5clemans585@gmail.com"}],"description":"DrizzleKit - is a CLI migrator tool for DrizzleORM. It is probably 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","homepage":"https://orm.drizzle.team","keywords":["drizzle","orm","pg","mysql","postgresql","postgres","sqlite","database","sql","typescript","ts","drizzle-kit","migrations","schema"],"repository":{"type":"git","url":"git+https://github.com/chtibizoux/drizzle-orm.git"},"author":{"name":"Drizzle Team"},"bugs":{"url":"https://github.com/chtibizoux/drizzle-orm/issues"},"license":"MIT","readme":"## Drizzle Kit\n\nDrizzleKit - is a CLI migrator tool for DrizzleORM. It is probably 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.\n<https://github.com/drizzle-team/drizzle-kit-mirror> - is a mirror repository for issues.\n\n## Documentation\n\nCheck the full documenation on [the website](https://orm.drizzle.team/kit-docs/overview)\n\n### How it works\n\n`drizzle-kit` will traverse `schema folder` or `schema file`, generate schema snapshot and compare it to the previous version, if there's one.\n Based on the difference it will generate all needed SQL migrations and if there are any `automatically unresolvable` cases like `renames` it will prompt user for input.\n\nFor schema file:\n\n```typescript\n// ./src/db/schema.ts\n\nimport { integer, pgTable, serial, text, varchar } from \"drizzle-orm/pg-core\";\n\nconst users = pgTable(\"users\", {\n    id: serial(\"id\").primaryKey(),\n    fullName: varchar(\"full_name\", { length: 256 }),\n  }, (table) => ({\n    nameIdx: index(\"name_idx\", table.fullName),\n  })\n);\n\nexport const authOtp = pgTable(\"auth_otp\", {\n  id: serial(\"id\").primaryKey(),\n  phone: varchar(\"phone\", { length: 256 }),\n  userId: integer(\"user_id\").references(() => users.id),\n});\n```\n\nIt will generate:\n\n```SQL\nCREATE TABLE IF NOT EXISTS auth_otp (\n \"id\" SERIAL PRIMARY KEY,\n \"phone\" character varying(256),\n \"user_id\" INT\n);\n\nCREATE TABLE IF NOT EXISTS users (\n \"id\" SERIAL PRIMARY KEY,\n \"full_name\" character varying(256)\n);\n\nDO $$ BEGIN\n ALTER TABLE auth_otp ADD CONSTRAINT auth_otp_user_id_fkey FOREIGN KEY (\"user_id\") REFERENCES users(id);\nEXCEPTION\n WHEN duplicate_object THEN null;\nEND $$;\n\nCREATE INDEX IF NOT EXISTS users_full_name_index ON users (full_name);\n```\n\n### Installation & configuration\n\n```shell\nnpm install -D drizzle-kit\n```\n\nRunning with CLI options\n\n```jsonc\n// package.json\n{\n \"scripts\": {\n  \"generate\": \"drizzle-kit generate --out migrations-folder --schema src/db/schema.ts\"\n }\n}\n```\n\n```shell\nnpm run generate\n```\n","readmeFilename":"README.md"}