drizzle-kit 0.20.17-7f33638 → 0.20.17-8018c29

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 (53) hide show
  1. package/bin.cjs +57946 -11193
  2. package/index.d.mts +38 -64
  3. package/index.d.ts +38 -64
  4. package/package.json +15 -20
  5. package/payload.d.mts +987 -18
  6. package/payload.d.ts +987 -18
  7. package/payload.js +20014 -36130
  8. package/payload.mjs +19927 -36017
  9. package/utils-studio.js +207 -2641
  10. package/utils-studio.mjs +207 -2641
  11. package/utils.js +32 -26
  12. package/utils.mjs +32 -26
  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 -55
  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 -104
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -58
  22. package/cli/selector-ui.d.ts +0 -13
  23. package/cli/utils.d.ts +0 -12
  24. package/cli/validations/cli.d.ts +0 -169
  25. package/cli/validations/common.d.ts +0 -214
  26. package/cli/validations/mysql.d.ts +0 -35
  27. package/cli/validations/outputs.d.ts +0 -41
  28. package/cli/validations/pg.d.ts +0 -37
  29. package/cli/validations/sqlite.d.ts +0 -34
  30. package/cli/views.d.ts +0 -63
  31. package/global.d.ts +0 -6
  32. package/introspect-sqlite.d.ts +0 -10
  33. package/jsonDiffer.d.ts +0 -61
  34. package/jsonStatements.d.ts +0 -376
  35. package/migrationPreparator.d.ts +0 -35
  36. package/schemaValidator.d.ts +0 -1316
  37. package/serializer/index.d.ts +0 -9
  38. package/serializer/mysqlImports.d.ts +0 -7
  39. package/serializer/mysqlSchema.d.ts +0 -4964
  40. package/serializer/mysqlSerializer.d.ts +0 -7
  41. package/serializer/pgImports.d.ts +0 -11
  42. package/serializer/pgSchema.d.ts +0 -4792
  43. package/serializer/pgSerializer.d.ts +0 -7
  44. package/serializer/schemaToDrizzle.d.ts +0 -7
  45. package/serializer/sqliteImports.d.ts +0 -7
  46. package/serializer/sqliteSchema.d.ts +0 -2801
  47. package/serializer/sqliteSerializer.d.ts +0 -6
  48. package/snapshotsDiffer.d.ts +0 -3937
  49. package/sqlgenerator.d.ts +0 -33
  50. package/utils/words.d.ts +0 -7
  51. package/utils-studio.d.mts +0 -4
  52. package/utils-studio.d.ts +0 -4
  53. package/utils.d.ts +0 -72
package/index.d.mts CHANGED
@@ -1,52 +1,15 @@
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 = {
49
- dialect?: Dialect;
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 = {
12
+ dialect: Dialect;
50
13
  out?: string;
51
14
  breakpoints?: boolean;
52
15
  tablesFilter?: string | string[];
@@ -54,28 +17,27 @@ 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
- driver: "turso";
28
+ dialect: Verify<Dialect, "sqlite">;
29
+ driver: Verify<Driver, "turso">;
63
30
  dbCredentials: {
64
31
  url: string;
65
32
  authToken?: string;
66
33
  };
67
34
  } | {
68
- driver: "better-sqlite";
69
- dbCredentials: {
70
- url: string;
71
- };
72
- } | {
73
- driver: "libsql";
35
+ dialect: "sqlite";
74
36
  dbCredentials: {
75
37
  url: string;
76
38
  };
77
39
  } | {
78
- driver: "pg";
40
+ dialect: Verify<Dialect, "postgresql">;
79
41
  dbCredentials: {
80
42
  host: string;
81
43
  port?: number;
@@ -84,10 +46,18 @@ export type Config = {
84
46
  database: string;
85
47
  ssl?: boolean;
86
48
  } | {
87
- connectionString: string;
49
+ url: string;
88
50
  };
89
51
  } | {
90
- driver: "mysql2";
52
+ dialect: Verify<Dialect, "postgresql">;
53
+ driver: Verify<Driver, "aws-data-api">;
54
+ dbCredentials: {
55
+ database: string;
56
+ secretArn: string;
57
+ resourceArn: string;
58
+ };
59
+ } | {
60
+ dialect: Verify<Dialect, "mysql">;
91
61
  dbCredentials: {
92
62
  host: string;
93
63
  port?: number;
@@ -95,15 +65,19 @@ export type Config = {
95
65
  password?: string;
96
66
  database: string;
97
67
  } | {
98
- uri: string;
68
+ url: string;
99
69
  };
100
70
  } | {
101
- driver: "d1";
71
+ dialect: Verify<Dialect, "sqlite">;
72
+ driver: Verify<Driver, "d1">;
102
73
  dbCredentials: {
103
74
  wranglerConfigPath: string;
104
75
  dbName: string;
105
76
  };
106
77
  } | {
107
- driver: "expo";
78
+ dialect: Verify<Dialect, "sqlite">;
79
+ driver: Verify<Driver, "expo">;
108
80
  } | {});
109
- 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,52 +1,15 @@
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 = {
49
- dialect?: Dialect;
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 = {
12
+ dialect: Dialect;
50
13
  out?: string;
51
14
  breakpoints?: boolean;
52
15
  tablesFilter?: string | string[];
@@ -54,28 +17,27 @@ 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
- driver: "turso";
28
+ dialect: Verify<Dialect, "sqlite">;
29
+ driver: Verify<Driver, "turso">;
63
30
  dbCredentials: {
64
31
  url: string;
65
32
  authToken?: string;
66
33
  };
67
34
  } | {
68
- driver: "better-sqlite";
69
- dbCredentials: {
70
- url: string;
71
- };
72
- } | {
73
- driver: "libsql";
35
+ dialect: "sqlite";
74
36
  dbCredentials: {
75
37
  url: string;
76
38
  };
77
39
  } | {
78
- driver: "pg";
40
+ dialect: Verify<Dialect, "postgresql">;
79
41
  dbCredentials: {
80
42
  host: string;
81
43
  port?: number;
@@ -84,10 +46,18 @@ export type Config = {
84
46
  database: string;
85
47
  ssl?: boolean;
86
48
  } | {
87
- connectionString: string;
49
+ url: string;
88
50
  };
89
51
  } | {
90
- driver: "mysql2";
52
+ dialect: Verify<Dialect, "postgresql">;
53
+ driver: Verify<Driver, "aws-data-api">;
54
+ dbCredentials: {
55
+ database: string;
56
+ secretArn: string;
57
+ resourceArn: string;
58
+ };
59
+ } | {
60
+ dialect: Verify<Dialect, "mysql">;
91
61
  dbCredentials: {
92
62
  host: string;
93
63
  port?: number;
@@ -95,15 +65,19 @@ export type Config = {
95
65
  password?: string;
96
66
  database: string;
97
67
  } | {
98
- uri: string;
68
+ url: string;
99
69
  };
100
70
  } | {
101
- driver: "d1";
71
+ dialect: Verify<Dialect, "sqlite">;
72
+ driver: Verify<Driver, "d1">;
102
73
  dbCredentials: {
103
74
  wranglerConfigPath: string;
104
75
  dbName: string;
105
76
  };
106
77
  } | {
107
- driver: "expo";
78
+ dialect: Verify<Dialect, "sqlite">;
79
+ driver: Verify<Driver, "expo">;
108
80
  } | {});
109
- 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-7f33638",
3
+ "version": "0.20.17-8018c29",
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",
@@ -21,9 +20,9 @@
21
20
  },
22
21
  "dependencies": {
23
22
  "@esbuild-kit/esm-loader": "^2.5.5",
24
- "@types/json-diff": "^1.0.3",
25
23
  "@hono/node-server": "^1.9.0",
26
24
  "@hono/zod-validator": "^0.2.0",
25
+ "@types/json-diff": "^1.0.3",
27
26
  "camelcase": "^7.0.1",
28
27
  "chalk": "^5.2.0",
29
28
  "commander": "^9.4.1",
@@ -38,13 +37,18 @@
38
37
  "pluralize": "^8.0.0",
39
38
  "semver": "^7.5.4",
40
39
  "superjson": "^2.2.1",
40
+ "ws": "^8.16.0",
41
41
  "zod": "^3.20.2"
42
42
  },
43
43
  "devDependencies": {
44
+ "@arethetypeswrong/cli": "^0.15.3",
45
+ "@aws-sdk/client-rds-data": "^3.556.0",
44
46
  "@cloudflare/workers-types": "^4.20230518.0",
45
47
  "@electric-sql/pglite": "^0.1.3",
46
48
  "@libsql/client": "^0.4.2",
49
+ "@neondatabase/serverless": "^0.9.1",
47
50
  "@originjs/vite-plugin-commonjs": "^1.0.3",
51
+ "@planetscale/database": "^1.16.0",
48
52
  "@types/better-sqlite3": "^7.6.4",
49
53
  "@types/dockerode": "^3.3.28",
50
54
  "@types/glob": "^8.1.0",
@@ -54,14 +58,16 @@
54
58
  "@types/pluralize": "^0.0.33",
55
59
  "@types/semver": "^7.5.5",
56
60
  "@types/uuid": "^9.0.8",
61
+ "@types/ws": "^8.5.10",
57
62
  "@typescript-eslint/eslint-plugin": "^7.2.0",
58
63
  "@typescript-eslint/parser": "^7.2.0",
59
- "dockerode": "^3.3.4",
60
- "dotenv": "^16.0.3",
61
- "drizzle-orm": "0.30.5-ab9feb7",
64
+ "@vercel/postgres": "^0.8.0",
62
65
  "ava": "^5.1.0",
63
66
  "better-sqlite3": "^9.4.3",
67
+ "dockerode": "^3.3.4",
68
+ "dotenv": "^16.0.3",
64
69
  "drizzle-kit": "0.20.14",
70
+ "drizzle-orm": "0.30.9-f9be0ab",
65
71
  "esbuild-node-externals": "^1.9.0",
66
72
  "eslint": "^8.57.0",
67
73
  "eslint-config-prettier": "^9.1.0",
@@ -69,8 +75,9 @@
69
75
  "get-port": "^6.1.2",
70
76
  "mysql2": "2.3.3",
71
77
  "pg": "^8.11.3",
72
- "postgres": "^3.3.5",
78
+ "postgres": "^3.4.4",
73
79
  "prettier": "^2.8.1",
80
+ "tsup": "^8.0.2",
74
81
  "tsx": "^3.12.1",
75
82
  "typescript": "^5.4.3",
76
83
  "uuid": "^9.0.1",
@@ -92,18 +99,6 @@
92
99
  "types": "./index.d.mts",
93
100
  "default": "./index.mjs"
94
101
  },
95
- "./utils-studio": {
96
- "import": {
97
- "types": "./utils-studio.d.mts",
98
- "default": "./utils-studio.mjs"
99
- },
100
- "require": {
101
- "types": "./utils-studio.d.ts",
102
- "default": "./utils-studio.js"
103
- },
104
- "types": "./utils-studio.d.mts",
105
- "default": "./utils-studio.mjs"
106
- },
107
102
  "./payload": {
108
103
  "import": {
109
104
  "types": "./payload.d.mts",