drizzle-kit 0.9.49 → 0.9.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/index.js +38459 -18336
  2. package/package.json +12 -17
  3. package/.pnpm-debug.log +0 -16
  4. package/LICENSE +0 -674
  5. package/readme.md +0 -83
package/package.json CHANGED
@@ -1,51 +1,46 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.9.49",
3
+ "version": "0.9.52",
4
+ "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
4
5
  "author": "Alex Blokh <aleksandrblokh@gmail.com>",
5
6
  "license": "MIT",
6
7
  "bin": {
7
8
  "drizzle-kit": "./index.js"
8
9
  },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/lambda-direct/drizzle-orm.git",
12
- "directory": "kit"
13
- },
14
10
  "dependencies": {
15
11
  "cli-table": "^0.3.11",
16
12
  "commander": "^8.0.0",
17
13
  "enquirer": "^2.3.6",
18
14
  "esbuild": "^0.14.2",
19
15
  "js-yaml": "^4.1.0",
20
- "json-diff": "^0.5.4",
16
+ "json-diff": "0.9.0",
21
17
  "loading-cli": "^1.1.0",
22
18
  "pretty-error": "^3.0.4",
19
+ "source-map-support": "^0.5.19",
23
20
  "xstate": "^4.25.0",
24
21
  "yup": "^0.32.11"
25
22
  },
26
23
  "devDependencies": {
27
- "@types/jest": "^27.0.3",
28
24
  "@types/js-yaml": "^4.0.3",
29
25
  "@types/pg": "^8.6.1",
30
- "@typescript-eslint/eslint-plugin": "4.4.1",
31
- "drizzle-orm": "^0.11.2",
32
26
  "esbuild-register": "^3.3.2",
33
27
  "eslint": "^7.2.0",
34
- "eslint-config-airbnb": "18.2.1",
35
- "eslint-config-airbnb-typescript": "11.0.0",
36
28
  "eslint-plugin-import": "^2.22.1",
37
- "source-map-loader": "^3.0.0",
38
- "typescript": "4.2.4",
29
+ "typescript": "^4.7.4",
39
30
  "uvu": "^0.5.3"
40
31
  },
32
+ "optionalDependencies": {
33
+ "drizzle-orm": "^0.11.5"
34
+ },
41
35
  "scripts": {
36
+ "preinstall": "npx only-allow pnpm",
42
37
  "start": "ts-node ./src/index.ts",
43
38
  "watch": "esbuild ./src/cli/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --watch",
44
39
  "diff": "ts-node ./src/diff.ts",
45
40
  "sim": "ts-node ./dev/simulate.ts",
46
41
  "test": "uvu -r esbuild-register ./tests/",
47
42
  "imports": "ts-node ./test.ts",
48
- "build": "esbuild ./src/cli/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild"
49
- },
50
- "readme": "## Drizzle Kit\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 delitions and renames by prompting user input.\n\n### How it works\n`drizzle-kit` will traverse `data folder` from configuration file, find all schema .ts files. Generate schema snapshot and compare it to the previous version(if there's one). Based on the difference it will generate all needed SQL migrations and if there're any `automatically unresolvable` cases like `renames` it will prompt user for input.\n\nFor schema file:\n```typescript\nimport { AbstractTable } from \"drizzle-orm\";\n\nexport class UsersTable extends AbstractTable<UsersTable> {\n public id = this.serial(\"id\").primaryKey();\n public fullName = this.varchar(\"full_name\", { size: 256 });\n\n public fullNameIndex = this.index(this.fullName);\n\n public tableName(): string {\n return \"users\";\n }\n}\n\nexport class AuthOtpTable extends AbstractTable<AuthOtpTable> {\n public id = this.serial(\"id\").primaryKey();\n public phone = this.varchar(\"phone\", { size: 256 });\n public userId = this.int(\"user_id\").foreignKey(UsersTable, (t) => t.id);\n\n public tableName(): string {\n return \"auth_otp\";\n }\n}\n```\nIt will generate:\n```SQL\nCREATE TABLE IF NOT EXISTS auth_otp (\n\t\"id\" SERIAL PRIMARY KEY,\n\t\"phone\" character varying(256),\n\t\"user_id\" INT\n);\n\nCREATE TABLE IF NOT EXISTS users (\n\t\"id\" SERIAL PRIMARY KEY,\n\t\"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```bash\nnpm install -g drizzle-kit\n```\nCreate a `drizzle.config.yml` configuration file:\n```yaml\nmigrationRootFolder: drizzle ## all migrations will live here\ndataFolder: './src/data' ## where are all schema .ts files\n```\n \\\nThat's it, you're ready to go 🚀\n```\n> drizzle-kit migrate\n```\n \\\nYou can also run migrations in project scope\n```js\n// package.json\n{\n ...\n scripts: {\n ...\n migrate: \"drizzle-kit migrate\"\n }\n}\n\n> npm run migrate\n```\n \n\n"
43
+ "build": "esbuild ./src/cli/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild",
44
+ "tsc": "tsc"
45
+ }
51
46
  }
package/.pnpm-debug.log DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "0 debug pnpm:scope": {
3
- "selected": 1,
4
- "workspacePrefix": "/Users/alexblokh/Development/drizzle-orm"
5
- },
6
- "1 error pnpm": {
7
- "code": "ERR_PNPM_GIT_NOT_UNCLEAN",
8
- "hint": "If you want to disable Git checks on publish, set the \"git-checks\" setting to \"false\", or run again with \"--no-git-checks\".",
9
- "err": {
10
- "name": "pnpm",
11
- "message": "Unclean working tree. Commit or stash changes first.",
12
- "code": "ERR_PNPM_GIT_NOT_UNCLEAN",
13
- "stack": "pnpm: Unclean working tree. Commit or stash changes first.\n at Object.handler [as publish] (/opt/homebrew/Cellar/pnpm/6.31.0/libexec/lib/node_modules/pnpm/dist/pnpm.cjs:177031:17)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async /opt/homebrew/Cellar/pnpm/6.31.0/libexec/lib/node_modules/pnpm/dist/pnpm.cjs:182106:21\n at async run (/opt/homebrew/Cellar/pnpm/6.31.0/libexec/lib/node_modules/pnpm/dist/pnpm.cjs:182080:34)\n at async runPnpm (/opt/homebrew/Cellar/pnpm/6.31.0/libexec/lib/node_modules/pnpm/dist/pnpm.cjs:182299:5)\n at async /opt/homebrew/Cellar/pnpm/6.31.0/libexec/lib/node_modules/pnpm/dist/pnpm.cjs:182291:7"
14
- }
15
- }
16
- }