drizzle-kit 0.20.17-e041df8 → 0.20.17-e38e63d

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/bin.cjs +40864 -23061
  2. package/index.d.mts +28 -60
  3. package/index.d.ts +28 -60
  4. package/package.json +6 -16
  5. package/payload.d.mts +987 -18
  6. package/payload.d.ts +987 -18
  7. package/payload.js +19795 -16882
  8. package/payload.mjs +19840 -16902
  9. package/utils-studio.js +939 -828
  10. package/utils-studio.mjs +912 -801
  11. package/utils.js +844 -219
  12. package/utils.mjs +819 -194
  13. package/@types/utils.d.ts +0 -12
  14. package/cli/commands/migrate.d.ts +0 -287
  15. package/cli/commands/mysqlIntrospect.d.ts +0 -50
  16. package/cli/commands/mysqlPushUtils.d.ts +0 -14
  17. package/cli/commands/pgIntrospect.d.ts +0 -59
  18. package/cli/commands/pgPushUtils.d.ts +0 -11
  19. package/cli/commands/sqliteIntrospect.d.ts +0 -103
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -58
  22. package/cli/connections.d.ts +0 -13
  23. package/cli/selector-ui.d.ts +0 -13
  24. package/cli/utils.d.ts +0 -13
  25. package/cli/validations/cli.d.ts +0 -169
  26. package/cli/validations/common.d.ts +0 -214
  27. package/cli/validations/mysql.d.ts +0 -29
  28. package/cli/validations/outputs.d.ts +0 -42
  29. package/cli/validations/pg.d.ts +0 -46
  30. package/cli/validations/sqlite.d.ts +0 -22
  31. package/cli/views.d.ts +0 -63
  32. package/global.d.ts +0 -6
  33. package/introspect-sqlite.d.ts +0 -10
  34. package/jsonDiffer.d.ts +0 -61
  35. package/jsonStatements.d.ts +0 -376
  36. package/migrationPreparator.d.ts +0 -35
  37. package/schemaValidator.d.ts +0 -1316
  38. package/serializer/index.d.ts +0 -9
  39. package/serializer/mysqlImports.d.ts +0 -7
  40. package/serializer/mysqlSchema.d.ts +0 -4650
  41. package/serializer/mysqlSerializer.d.ts +0 -7
  42. package/serializer/pgImports.d.ts +0 -11
  43. package/serializer/pgSchema.d.ts +0 -4792
  44. package/serializer/pgSerializer.d.ts +0 -7
  45. package/serializer/schemaToDrizzle.d.ts +0 -7
  46. package/serializer/sqliteImports.d.ts +0 -7
  47. package/serializer/sqliteSchema.d.ts +0 -2801
  48. package/serializer/sqliteSerializer.d.ts +0 -6
  49. package/serializer/studio.d.ts +0 -51
  50. package/snapshotsDiffer.d.ts +0 -3937
  51. package/sqlgenerator.d.ts +0 -33
  52. package/utils/words.d.ts +0 -7
  53. package/utils-studio.d.mts +0 -4
  54. package/utils-studio.d.ts +0 -4
  55. package/utils.d.ts +0 -78
package/index.d.mts CHANGED
@@ -1,51 +1,14 @@
1
- import { Dialect } from "./schemaValidator";
2
- export type DbConnection = {
3
- driver: "turso";
4
- dbCredentials: {
5
- url: string;
6
- authToken?: string;
7
- };
8
- } | {
9
- driver: "better-sqlite";
10
- dbCredentials: {
11
- url: string;
12
- };
13
- } | {
14
- driver: "libsql";
15
- dbCredentials: {
16
- url: string;
17
- };
18
- } | {
19
- driver: "d1";
20
- dbCredentials: {
21
- wranglerConfigPath: string;
22
- dbName: string;
23
- };
24
- } | {
25
- driver: "pg";
26
- dbCredentials: {
27
- host: string;
28
- port?: number;
29
- user?: string;
30
- password?: string;
31
- database: string;
32
- ssl?: boolean;
33
- } | {
34
- connectionString: string;
35
- };
36
- } | {
37
- driver: "mysql2";
38
- dbCredentials: {
39
- host: string;
40
- port?: number;
41
- user?: string;
42
- password?: string;
43
- database: string;
44
- } | {
45
- uri: string;
46
- };
47
- };
48
- export type Config = {
1
+ import * as zod from 'zod';
2
+ import { TypeOf } from 'zod';
3
+
4
+ declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
5
+ type Driver = TypeOf<typeof driver>;
6
+
7
+ declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
8
+ type Dialect = TypeOf<typeof dialect>;
9
+
10
+ type Verify<T, U extends T> = U;
11
+ type Config = {
49
12
  dialect: Dialect;
50
13
  out?: string;
51
14
  breakpoints?: boolean;
@@ -54,13 +17,16 @@ export type Config = {
54
17
  schema?: string | string[];
55
18
  verbose?: boolean;
56
19
  strict?: boolean;
57
- } & {
20
+ migrations?: {
21
+ table?: string;
22
+ schema?: string;
23
+ };
58
24
  introspect?: {
59
25
  casing: "camel" | "preserve";
60
26
  };
61
27
  } & ({
62
- dialect: "sqlite";
63
- driver: "turso";
28
+ dialect: Verify<Dialect, "sqlite">;
29
+ driver: Verify<Driver, "turso">;
64
30
  dbCredentials: {
65
31
  url: string;
66
32
  authToken?: string;
@@ -71,7 +37,7 @@ export type Config = {
71
37
  url: string;
72
38
  };
73
39
  } | {
74
- dialect: "pg";
40
+ dialect: Verify<Dialect, "postgresql">;
75
41
  dbCredentials: {
76
42
  host: string;
77
43
  port?: number;
@@ -83,15 +49,15 @@ export type Config = {
83
49
  url: string;
84
50
  };
85
51
  } | {
86
- dialect: "pg";
87
- driver: "aws-data-api";
52
+ dialect: Verify<Dialect, "postgresql">;
53
+ driver: Verify<Driver, "aws-data-api">;
88
54
  dbCredentials: {
89
55
  database: string;
90
56
  secretArn: string;
91
57
  resourceArn: string;
92
58
  };
93
59
  } | {
94
- dialect: "mysql";
60
+ dialect: Verify<Dialect, "mysql">;
95
61
  dbCredentials: {
96
62
  host: string;
97
63
  port?: number;
@@ -102,14 +68,16 @@ export type Config = {
102
68
  url: string;
103
69
  };
104
70
  } | {
105
- dialect: "sqlite";
106
- driver: "d1-http";
71
+ dialect: Verify<Dialect, "sqlite">;
72
+ driver: Verify<Driver, "d1">;
107
73
  dbCredentials: {
108
74
  wranglerConfigPath: string;
109
75
  dbName: string;
110
76
  };
111
77
  } | {
112
- dialect: "sqlite";
113
- driver: "expo";
78
+ dialect: Verify<Dialect, "sqlite">;
79
+ driver: Verify<Driver, "expo">;
114
80
  } | {});
115
- export declare function defineConfig(config: Config): Config;
81
+ declare function defineConfig(config: Config): Config;
82
+
83
+ export { type Config, defineConfig };
package/index.d.ts CHANGED
@@ -1,51 +1,14 @@
1
- import { Dialect } from "./schemaValidator";
2
- export type DbConnection = {
3
- driver: "turso";
4
- dbCredentials: {
5
- url: string;
6
- authToken?: string;
7
- };
8
- } | {
9
- driver: "better-sqlite";
10
- dbCredentials: {
11
- url: string;
12
- };
13
- } | {
14
- driver: "libsql";
15
- dbCredentials: {
16
- url: string;
17
- };
18
- } | {
19
- driver: "d1";
20
- dbCredentials: {
21
- wranglerConfigPath: string;
22
- dbName: string;
23
- };
24
- } | {
25
- driver: "pg";
26
- dbCredentials: {
27
- host: string;
28
- port?: number;
29
- user?: string;
30
- password?: string;
31
- database: string;
32
- ssl?: boolean;
33
- } | {
34
- connectionString: string;
35
- };
36
- } | {
37
- driver: "mysql2";
38
- dbCredentials: {
39
- host: string;
40
- port?: number;
41
- user?: string;
42
- password?: string;
43
- database: string;
44
- } | {
45
- uri: string;
46
- };
47
- };
48
- export type Config = {
1
+ import * as zod from 'zod';
2
+ import { TypeOf } from 'zod';
3
+
4
+ declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
5
+ type Driver = TypeOf<typeof driver>;
6
+
7
+ declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
8
+ type Dialect = TypeOf<typeof dialect>;
9
+
10
+ type Verify<T, U extends T> = U;
11
+ type Config = {
49
12
  dialect: Dialect;
50
13
  out?: string;
51
14
  breakpoints?: boolean;
@@ -54,13 +17,16 @@ export type Config = {
54
17
  schema?: string | string[];
55
18
  verbose?: boolean;
56
19
  strict?: boolean;
57
- } & {
20
+ migrations?: {
21
+ table?: string;
22
+ schema?: string;
23
+ };
58
24
  introspect?: {
59
25
  casing: "camel" | "preserve";
60
26
  };
61
27
  } & ({
62
- dialect: "sqlite";
63
- driver: "turso";
28
+ dialect: Verify<Dialect, "sqlite">;
29
+ driver: Verify<Driver, "turso">;
64
30
  dbCredentials: {
65
31
  url: string;
66
32
  authToken?: string;
@@ -71,7 +37,7 @@ export type Config = {
71
37
  url: string;
72
38
  };
73
39
  } | {
74
- dialect: "pg";
40
+ dialect: Verify<Dialect, "postgresql">;
75
41
  dbCredentials: {
76
42
  host: string;
77
43
  port?: number;
@@ -83,15 +49,15 @@ export type Config = {
83
49
  url: string;
84
50
  };
85
51
  } | {
86
- dialect: "pg";
87
- driver: "aws-data-api";
52
+ dialect: Verify<Dialect, "postgresql">;
53
+ driver: Verify<Driver, "aws-data-api">;
88
54
  dbCredentials: {
89
55
  database: string;
90
56
  secretArn: string;
91
57
  resourceArn: string;
92
58
  };
93
59
  } | {
94
- dialect: "mysql";
60
+ dialect: Verify<Dialect, "mysql">;
95
61
  dbCredentials: {
96
62
  host: string;
97
63
  port?: number;
@@ -102,14 +68,16 @@ export type Config = {
102
68
  url: string;
103
69
  };
104
70
  } | {
105
- dialect: "sqlite";
106
- driver: "d1-http";
71
+ dialect: Verify<Dialect, "sqlite">;
72
+ driver: Verify<Driver, "d1">;
107
73
  dbCredentials: {
108
74
  wranglerConfigPath: string;
109
75
  dbName: string;
110
76
  };
111
77
  } | {
112
- dialect: "sqlite";
113
- driver: "expo";
78
+ dialect: Verify<Dialect, "sqlite">;
79
+ driver: Verify<Driver, "expo">;
114
80
  } | {});
115
- export declare function defineConfig(config: Config): Config;
81
+ declare function defineConfig(config: Config): Config;
82
+
83
+ export { type Config, defineConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.17-e041df8",
3
+ "version": "0.20.17-e38e63d",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -12,8 +12,7 @@
12
12
  "migrate:old": "drizzle-kit generate:mysql",
13
13
  "cli": "tsx ./src/cli/index.ts",
14
14
  "test": "vitest",
15
- "mts": "cp dist/index.d.ts dist/index.d.mts && cp dist/utils-studio.d.ts dist/utils-studio.d.mts && cp dist/payload.d.ts dist/payload.d.mts",
16
- "build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && pnpm mts && tsx build.ts",
15
+ "build": "rm -rf ./dist && tsx build.ts && cp package.json dist/ && attw --pack dist",
17
16
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
18
17
  "packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
19
18
  "tsc": "tsc -p tsconfig.build.json",
@@ -42,6 +41,7 @@
42
41
  "zod": "^3.20.2"
43
42
  },
44
43
  "devDependencies": {
44
+ "@arethetypeswrong/cli": "^0.15.3",
45
45
  "@aws-sdk/client-rds-data": "^3.556.0",
46
46
  "@cloudflare/workers-types": "^4.20230518.0",
47
47
  "@electric-sql/pglite": "^0.1.3",
@@ -61,12 +61,13 @@
61
61
  "@types/ws": "^8.5.10",
62
62
  "@typescript-eslint/eslint-plugin": "^7.2.0",
63
63
  "@typescript-eslint/parser": "^7.2.0",
64
+ "@vercel/postgres": "^0.8.0",
64
65
  "ava": "^5.1.0",
65
66
  "better-sqlite3": "^9.4.3",
66
67
  "dockerode": "^3.3.4",
67
68
  "dotenv": "^16.0.3",
68
69
  "drizzle-kit": "0.20.14",
69
- "drizzle-orm": "0.30.5-ab9feb7",
70
+ "drizzle-orm": "0.30.9-f9be0ab",
70
71
  "esbuild-node-externals": "^1.9.0",
71
72
  "eslint": "^8.57.0",
72
73
  "eslint-config-prettier": "^9.1.0",
@@ -76,6 +77,7 @@
76
77
  "pg": "^8.11.3",
77
78
  "postgres": "^3.4.4",
78
79
  "prettier": "^2.8.1",
80
+ "tsup": "^8.0.2",
79
81
  "tsx": "^3.12.1",
80
82
  "typescript": "^5.4.3",
81
83
  "uuid": "^9.0.1",
@@ -97,18 +99,6 @@
97
99
  "types": "./index.d.mts",
98
100
  "default": "./index.mjs"
99
101
  },
100
- "./utils-studio": {
101
- "import": {
102
- "types": "./utils-studio.d.mts",
103
- "default": "./utils-studio.mjs"
104
- },
105
- "require": {
106
- "types": "./utils-studio.d.ts",
107
- "default": "./utils-studio.js"
108
- },
109
- "types": "./utils-studio.d.mts",
110
- "default": "./utils-studio.mjs"
111
- },
112
102
  "./payload": {
113
103
  "import": {
114
104
  "types": "./payload.d.mts",