drizzle-kit 0.20.17-9d75ea5 → 0.20.17-a1c0ab3

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 (55) hide show
  1. package/bin.cjs +24438 -16499
  2. package/index.d.mts +30 -14
  3. package/index.d.ts +30 -14
  4. package/package.json +5 -16
  5. package/payload.d.mts +1052 -18
  6. package/payload.d.ts +1052 -18
  7. package/payload.js +19866 -16902
  8. package/payload.mjs +19887 -16903
  9. package/utils-studio.js +949 -822
  10. package/utils-studio.mjs +922 -795
  11. package/utils.js +859 -218
  12. package/utils.mjs +834 -193
  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 -41
  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 -3936
  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,5 +1,15 @@
1
- import { Dialect } from "./schemaValidator";
2
- export type Config = {
1
+ import { SslOptions } from 'mysql2';
2
+ import * as zod from 'zod';
3
+ import { TypeOf } from 'zod';
4
+
5
+ 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">]>;
6
+ type Driver = TypeOf<typeof driver>;
7
+
8
+ declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
9
+ type Dialect = TypeOf<typeof dialect>;
10
+
11
+ type Verify<T, U extends T> = U;
12
+ type Config = {
3
13
  dialect: Dialect;
4
14
  out?: string;
5
15
  breakpoints?: boolean;
@@ -8,13 +18,16 @@ export type Config = {
8
18
  schema?: string | string[];
9
19
  verbose?: boolean;
10
20
  strict?: boolean;
11
- } & {
21
+ migrations?: {
22
+ table?: string;
23
+ schema?: string;
24
+ };
12
25
  introspect?: {
13
26
  casing: "camel" | "preserve";
14
27
  };
15
28
  } & ({
16
- dialect: "sqlite";
17
- driver: "turso";
29
+ dialect: Verify<Dialect, "sqlite">;
30
+ driver: Verify<Driver, "turso">;
18
31
  dbCredentials: {
19
32
  url: string;
20
33
  authToken?: string;
@@ -25,7 +38,7 @@ export type Config = {
25
38
  url: string;
26
39
  };
27
40
  } | {
28
- dialect: "postgresql";
41
+ dialect: Verify<Dialect, "postgresql">;
29
42
  dbCredentials: {
30
43
  host: string;
31
44
  port?: number;
@@ -37,33 +50,36 @@ export type Config = {
37
50
  url: string;
38
51
  };
39
52
  } | {
40
- dialect: "postgresql";
41
- driver: "aws-data-api";
53
+ dialect: Verify<Dialect, "postgresql">;
54
+ driver: Verify<Driver, "aws-data-api">;
42
55
  dbCredentials: {
43
56
  database: string;
44
57
  secretArn: string;
45
58
  resourceArn: string;
46
59
  };
47
60
  } | {
48
- dialect: "mysql";
61
+ dialect: Verify<Dialect, "mysql">;
49
62
  dbCredentials: {
50
63
  host: string;
51
64
  port?: number;
52
65
  user?: string;
53
66
  password?: string;
54
67
  database: string;
68
+ ssl?: string | SslOptions;
55
69
  } | {
56
70
  url: string;
57
71
  };
58
72
  } | {
59
- dialect: "sqlite";
60
- driver: "d1-http";
73
+ dialect: Verify<Dialect, "sqlite">;
74
+ driver: Verify<Driver, "d1">;
61
75
  dbCredentials: {
62
76
  wranglerConfigPath: string;
63
77
  dbName: string;
64
78
  };
65
79
  } | {
66
- dialect: "sqlite";
67
- driver: "expo";
80
+ dialect: Verify<Dialect, "sqlite">;
81
+ driver: Verify<Driver, "expo">;
68
82
  } | {});
69
- export declare function defineConfig(config: Config): Config;
83
+ declare function defineConfig(config: Config): Config;
84
+
85
+ export { type Config, defineConfig };
package/index.d.ts CHANGED
@@ -1,5 +1,15 @@
1
- import { Dialect } from "./schemaValidator";
2
- export type Config = {
1
+ import { SslOptions } from 'mysql2';
2
+ import * as zod from 'zod';
3
+ import { TypeOf } from 'zod';
4
+
5
+ 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">]>;
6
+ type Driver = TypeOf<typeof driver>;
7
+
8
+ declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
9
+ type Dialect = TypeOf<typeof dialect>;
10
+
11
+ type Verify<T, U extends T> = U;
12
+ type Config = {
3
13
  dialect: Dialect;
4
14
  out?: string;
5
15
  breakpoints?: boolean;
@@ -8,13 +18,16 @@ export type Config = {
8
18
  schema?: string | string[];
9
19
  verbose?: boolean;
10
20
  strict?: boolean;
11
- } & {
21
+ migrations?: {
22
+ table?: string;
23
+ schema?: string;
24
+ };
12
25
  introspect?: {
13
26
  casing: "camel" | "preserve";
14
27
  };
15
28
  } & ({
16
- dialect: "sqlite";
17
- driver: "turso";
29
+ dialect: Verify<Dialect, "sqlite">;
30
+ driver: Verify<Driver, "turso">;
18
31
  dbCredentials: {
19
32
  url: string;
20
33
  authToken?: string;
@@ -25,7 +38,7 @@ export type Config = {
25
38
  url: string;
26
39
  };
27
40
  } | {
28
- dialect: "postgresql";
41
+ dialect: Verify<Dialect, "postgresql">;
29
42
  dbCredentials: {
30
43
  host: string;
31
44
  port?: number;
@@ -37,33 +50,36 @@ export type Config = {
37
50
  url: string;
38
51
  };
39
52
  } | {
40
- dialect: "postgresql";
41
- driver: "aws-data-api";
53
+ dialect: Verify<Dialect, "postgresql">;
54
+ driver: Verify<Driver, "aws-data-api">;
42
55
  dbCredentials: {
43
56
  database: string;
44
57
  secretArn: string;
45
58
  resourceArn: string;
46
59
  };
47
60
  } | {
48
- dialect: "mysql";
61
+ dialect: Verify<Dialect, "mysql">;
49
62
  dbCredentials: {
50
63
  host: string;
51
64
  port?: number;
52
65
  user?: string;
53
66
  password?: string;
54
67
  database: string;
68
+ ssl?: string | SslOptions;
55
69
  } | {
56
70
  url: string;
57
71
  };
58
72
  } | {
59
- dialect: "sqlite";
60
- driver: "d1-http";
73
+ dialect: Verify<Dialect, "sqlite">;
74
+ driver: Verify<Driver, "d1">;
61
75
  dbCredentials: {
62
76
  wranglerConfigPath: string;
63
77
  dbName: string;
64
78
  };
65
79
  } | {
66
- dialect: "sqlite";
67
- driver: "expo";
80
+ dialect: Verify<Dialect, "sqlite">;
81
+ driver: Verify<Driver, "expo">;
68
82
  } | {});
69
- export declare function defineConfig(config: Config): Config;
83
+ declare function defineConfig(config: Config): Config;
84
+
85
+ export { type Config, defineConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.17-9d75ea5",
3
+ "version": "0.20.17-a1c0ab3",
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",
@@ -67,7 +67,7 @@
67
67
  "dockerode": "^3.3.4",
68
68
  "dotenv": "^16.0.3",
69
69
  "drizzle-kit": "0.20.14",
70
- "drizzle-orm": "0.30.5-ab9feb7",
70
+ "drizzle-orm": "0.30.9-f9be0ab",
71
71
  "esbuild-node-externals": "^1.9.0",
72
72
  "eslint": "^8.57.0",
73
73
  "eslint-config-prettier": "^9.1.0",
@@ -77,6 +77,7 @@
77
77
  "pg": "^8.11.3",
78
78
  "postgres": "^3.4.4",
79
79
  "prettier": "^2.8.1",
80
+ "tsup": "^8.0.2",
80
81
  "tsx": "^3.12.1",
81
82
  "typescript": "^5.4.3",
82
83
  "uuid": "^9.0.1",
@@ -98,18 +99,6 @@
98
99
  "types": "./index.d.mts",
99
100
  "default": "./index.mjs"
100
101
  },
101
- "./utils-studio": {
102
- "import": {
103
- "types": "./utils-studio.d.mts",
104
- "default": "./utils-studio.mjs"
105
- },
106
- "require": {
107
- "types": "./utils-studio.d.ts",
108
- "default": "./utils-studio.js"
109
- },
110
- "types": "./utils-studio.d.mts",
111
- "default": "./utils-studio.mjs"
112
- },
113
102
  "./payload": {
114
103
  "import": {
115
104
  "types": "./payload.d.mts",