drizzle-kit 0.20.17-7776aba → 0.20.17-7a1dd7a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/bin.cjs +82842 -42140
  2. package/cli/commands/migrate.d.ts +152 -135
  3. package/cli/commands/mysqlIntrospect.d.ts +10 -79
  4. package/cli/commands/mysqlPushUtils.d.ts +4 -8
  5. package/cli/commands/pgIntrospect.d.ts +12 -76
  6. package/cli/commands/pgPushUtils.d.ts +3 -6
  7. package/cli/commands/sqliteIntrospect.d.ts +25 -29
  8. package/cli/commands/sqlitePushUtils.d.ts +4 -10
  9. package/cli/commands/utils.d.ts +39 -255
  10. package/cli/connections.d.ts +13 -0
  11. package/cli/utils.d.ts +13 -0
  12. package/cli/validations/cli.d.ts +169 -0
  13. package/cli/validations/common.d.ts +208 -7
  14. package/cli/validations/mysql.d.ts +6 -342
  15. package/cli/validations/outputs.d.ts +2 -0
  16. package/cli/validations/pg.d.ts +17 -409
  17. package/cli/validations/sqlite.d.ts +22 -0
  18. package/cli/views.d.ts +7 -5
  19. package/global.d.ts +3 -1
  20. package/index.d.mts +25 -17
  21. package/index.d.ts +25 -17
  22. package/index.js +1 -0
  23. package/introspect-sqlite.d.ts +2 -2
  24. package/jsonDiffer.d.ts +14 -29
  25. package/jsonStatements.d.ts +38 -11
  26. package/package.json +29 -51
  27. package/payload.d.mts +5 -5
  28. package/payload.d.ts +5 -5
  29. package/payload.js +15576 -32175
  30. package/payload.mjs +17078 -33688
  31. package/schemaValidator.d.ts +286 -283
  32. package/serializer/mysqlImports.d.ts +3 -7
  33. package/serializer/mysqlSchema.d.ts +2170 -1353
  34. package/serializer/mysqlSerializer.d.ts +6 -6
  35. package/serializer/pgImports.d.ts +2 -2
  36. package/serializer/pgSchema.d.ts +1741 -1282
  37. package/serializer/pgSerializer.d.ts +2 -2
  38. package/serializer/sqliteImports.d.ts +2 -4
  39. package/serializer/sqliteSchema.d.ts +553 -979
  40. package/serializer/sqliteSerializer.d.ts +4 -4
  41. package/serializer/studio.d.ts +51 -0
  42. package/snapshotsDiffer.d.ts +2486 -1209
  43. package/utils/words.d.ts +1 -1
  44. package/utils-studio.d.mts +0 -1
  45. package/utils-studio.d.ts +0 -1
  46. package/utils-studio.js +4557 -803
  47. package/utils-studio.mjs +4533 -782
  48. package/utils.d.ts +20 -141
  49. package/utils.js +4370 -6916
  50. package/utils.mjs +4583 -7129
  51. package/cli/commands/mysqlUp.d.ts +0 -4
  52. package/cli/commands/pgConnect.d.ts +0 -5
  53. package/cli/commands/pgUp.d.ts +0 -4
  54. package/cli/commands/sqliteUtils.d.ts +0 -162
  55. package/cli/commands/upFolders.d.ts +0 -27
  56. package/drivers/index.d.ts +0 -39
  57. package/introspect-mysql.d.ts +0 -9
  58. package/introspect-pg.d.ts +0 -12
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Dialect } from "./schemaValidator";
1
2
  export type DbConnection = {
2
3
  driver: "turso";
3
4
  dbCredentials: {
@@ -45,35 +46,32 @@ export type DbConnection = {
45
46
  };
46
47
  };
47
48
  export type Config = {
48
- out?: string | undefined;
49
- breakpoints?: boolean | undefined;
50
- tablesFilter?: string | string[] | undefined;
51
- schemaFilter?: string | string[] | undefined;
49
+ dialect: Dialect;
50
+ out?: string;
51
+ breakpoints?: boolean;
52
+ tablesFilter?: string | string[];
53
+ schemaFilter?: string | string[];
52
54
  schema?: string | string[];
53
- verbose?: boolean | undefined;
54
- strict?: boolean | undefined;
55
+ verbose?: boolean;
56
+ strict?: boolean;
55
57
  } & {
56
58
  introspect?: {
57
59
  casing: "camel" | "preserve";
58
60
  };
59
61
  } & ({
62
+ dialect: "sqlite";
60
63
  driver: "turso";
61
64
  dbCredentials: {
62
65
  url: string;
63
66
  authToken?: string;
64
67
  };
65
68
  } | {
66
- driver: "better-sqlite";
69
+ dialect: "sqlite";
67
70
  dbCredentials: {
68
71
  url: string;
69
72
  };
70
73
  } | {
71
- driver: "libsql";
72
- dbCredentials: {
73
- url: string;
74
- };
75
- } | {
76
- driver: "pg";
74
+ dialect: "pg";
77
75
  dbCredentials: {
78
76
  host: string;
79
77
  port?: number;
@@ -82,10 +80,18 @@ export type Config = {
82
80
  database: string;
83
81
  ssl?: boolean;
84
82
  } | {
85
- connectionString: string;
83
+ url: string;
86
84
  };
87
85
  } | {
88
- driver: "mysql2";
86
+ dialect: "pg";
87
+ driver: "aws-data-api";
88
+ dbCredentials: {
89
+ database: string;
90
+ secretArn: string;
91
+ resourceArn: string;
92
+ };
93
+ } | {
94
+ dialect: "mysql";
89
95
  dbCredentials: {
90
96
  host: string;
91
97
  port?: number;
@@ -93,15 +99,17 @@ export type Config = {
93
99
  password?: string;
94
100
  database: string;
95
101
  } | {
96
- uri: string;
102
+ url: string;
97
103
  };
98
104
  } | {
99
- driver: "d1";
105
+ dialect: "sqlite";
106
+ driver: "d1-http";
100
107
  dbCredentials: {
101
108
  wranglerConfigPath: string;
102
109
  dbName: string;
103
110
  };
104
111
  } | {
112
+ dialect: "sqlite";
105
113
  driver: "expo";
106
114
  } | {});
107
115
  export declare function defineConfig(config: Config): Config;
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,8 +1,8 @@
1
1
  import "./@types/utils";
2
- import type { ConfigIntrospectCasing } from "./cli/commands/utils";
2
+ import type { Casing } from "./cli/validations/common";
3
3
  import type { SQLiteSchemaInternal } from "./serializer/sqliteSchema";
4
4
  export declare const indexName: (tableName: string, columns: string[]) => string;
5
- export declare const schemaToTypeScript: (schema: SQLiteSchemaInternal, casing: ConfigIntrospectCasing["casing"]) => {
5
+ export declare const schemaToTypeScript: (schema: SQLiteSchemaInternal, casing: Casing) => {
6
6
  file: string;
7
7
  imports: string;
8
8
  decalrations: string;
package/jsonDiffer.d.ts CHANGED
@@ -1,25 +1,16 @@
1
1
  export function diffForRenamedTables(pairs: any): any;
2
2
  export function diffForRenamedColumn(t1: any, t2: any): any;
3
+ export function diffSchemasOrTables(left: any, right: any): {
4
+ added: any[];
5
+ deleted: any[];
6
+ };
7
+ export function diffColumns(left: any, right: any): {
8
+ [k: string]: any;
9
+ };
3
10
  export function applyJsonDiff(json1: any, json2: any): {
4
- addedTables?: undefined;
5
- deletedTables?: undefined;
6
- alteredTablesWithColumns?: undefined;
7
- addedEnums?: undefined;
8
- deletedEnums?: undefined;
9
- alteredEnums?: undefined;
10
- addedSchemas?: undefined;
11
- deletedSchemas?: undefined;
12
- } | {
13
- addedTables: any[];
14
- deletedTables: any[];
15
11
  alteredTablesWithColumns: {
16
12
  name: any;
17
- schema: {
18
- type: string;
19
- value: any;
20
- };
21
- deleted: any[];
22
- added: any[];
13
+ schema: any;
23
14
  altered: any[];
24
15
  addedIndexes: {
25
16
  [k: string]: any;
@@ -58,19 +49,13 @@ export function applyJsonDiff(json1: any, json2: any): {
58
49
  [k: string]: any;
59
50
  };
60
51
  }[];
61
- addedEnums: {
62
- name: any;
63
- values: any[];
64
- }[];
65
- deletedEnums: {
66
- name: any;
67
- values: any[];
68
- }[];
69
52
  alteredEnums: {
70
- name: string;
71
- addedValues: any[];
53
+ name: any;
54
+ schema: any;
55
+ addedValues: {
56
+ before: any;
57
+ value: any;
58
+ }[];
72
59
  deletedValues: any[];
73
60
  }[];
74
- addedSchemas: any[];
75
- deletedSchemas: any[];
76
61
  };
@@ -1,4 +1,4 @@
1
- import { CommonSquashedSchema, Dialect } from "./schemaValidator";
1
+ import { CommonSquashedSchema } from "./schemaValidator";
2
2
  import { MySqlSchema } from "./serializer/mysqlSchema";
3
3
  import { PgSchema } from "./serializer/pgSchema";
4
4
  import { AlteredColumn, Column, Table } from "./snapshotsDiffer";
@@ -34,12 +34,32 @@ export interface JsonRenameTableStatement {
34
34
  export interface JsonCreateEnumStatement {
35
35
  type: "create_type_enum";
36
36
  name: string;
37
+ schema: string;
37
38
  values: string[];
38
39
  }
40
+ export interface JsonDropEnumStatement {
41
+ type: "drop_type_enum";
42
+ name: string;
43
+ schema: string;
44
+ }
45
+ export interface JsonMoveEnumStatement {
46
+ type: "move_type_enum";
47
+ name: string;
48
+ schemaFrom: string;
49
+ schemaTo: string;
50
+ }
51
+ export interface JsonRenameEnumStatement {
52
+ type: "rename_type_enum";
53
+ nameFrom: string;
54
+ nameTo: string;
55
+ schema: string;
56
+ }
39
57
  export interface JsonAddValueToEnumStatement {
40
58
  type: "alter_type_add_value";
41
59
  name: string;
60
+ schema: string;
42
61
  value: string;
62
+ before: string;
43
63
  }
44
64
  export interface JsonDropColumnStatement {
45
65
  type: "alter_table_drop_column";
@@ -120,7 +140,8 @@ export interface JsonAlterCompositePK {
120
140
  export interface JsonAlterTableSetSchema {
121
141
  type: "alter_table_set_schema";
122
142
  tableName: string;
123
- schema: string;
143
+ schemaFrom: string;
144
+ schemaTo: string;
124
145
  }
125
146
  export interface JsonAlterTableRemoveFromSchema {
126
147
  type: "alter_table_remove_from_schema";
@@ -292,14 +313,20 @@ export interface JsonRenameSchema {
292
313
  to: string;
293
314
  }
294
315
  export type JsonAlterColumnStatement = JsonRenameColumnStatement | JsonAlterColumnTypeStatement | JsonAlterColumnSetDefaultStatement | JsonAlterColumnDropDefaultStatement | JsonAlterColumnSetNotNullStatement | JsonAlterColumnDropNotNullStatement | JsonAlterColumnDropOnUpdateStatement | JsonAlterColumnSetOnUpdateStatement | JsonAlterColumnDropAutoincrementStatement | JsonAlterColumnSetAutoincrementStatement | JsonAlterColumnSetPrimaryKeyStatement | JsonAlterColumnDropPrimaryKeyStatement;
295
- export type JsonStatement = JsonAlterColumnStatement | JsonCreateTableStatement | JsonDropTableStatement | JsonRenameTableStatement | JsonCreateEnumStatement | JsonAddValueToEnumStatement | JsonDropColumnStatement | JsonAddColumnStatement | JsonCreateIndexStatement | JsonCreateReferenceStatement | JsonAlterReferenceStatement | JsonDeleteReferenceStatement | JsonDropIndexStatement | JsonReferenceStatement | JsonSqliteCreateTableStatement | JsonSqliteAddColumnStatement | JsonCreateCompositePK | JsonDeleteCompositePK | JsonAlterCompositePK | JsonCreateUniqueConstraint | JsonDeleteUniqueConstraint | JsonAlterUniqueConstraint | JsonCreateSchema | JsonDropSchema | JsonRenameSchema | JsonAlterTableSetSchema | JsonAlterTableRemoveFromSchema | JsonAlterTableSetNewSchema;
316
+ export type JsonStatement = JsonAlterColumnStatement | JsonCreateTableStatement | JsonDropTableStatement | JsonRenameTableStatement | JsonCreateEnumStatement | JsonDropEnumStatement | JsonMoveEnumStatement | JsonRenameEnumStatement | JsonAddValueToEnumStatement | JsonDropColumnStatement | JsonAddColumnStatement | JsonCreateIndexStatement | JsonCreateReferenceStatement | JsonAlterReferenceStatement | JsonDeleteReferenceStatement | JsonDropIndexStatement | JsonReferenceStatement | JsonSqliteCreateTableStatement | JsonSqliteAddColumnStatement | JsonCreateCompositePK | JsonDeleteCompositePK | JsonAlterCompositePK | JsonCreateUniqueConstraint | JsonDeleteUniqueConstraint | JsonAlterUniqueConstraint | JsonCreateSchema | JsonDropSchema | JsonRenameSchema | JsonAlterTableSetSchema | JsonAlterTableRemoveFromSchema | JsonAlterTableSetNewSchema;
296
317
  export declare const preparePgCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
297
- export declare const prepareMySqlCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
318
+ export declare const prepareMySqlCreateTableJson: (table: Table, json2: MySqlSchema) => JsonCreateTableStatement;
298
319
  export declare const prepareSQLiteCreateTable: (table: Table) => JsonSqliteCreateTableStatement;
299
320
  export declare const prepareDropTableJson: (table: Table) => JsonDropTableStatement;
300
321
  export declare const prepareRenameTableJson: (tableFrom: Table, tableTo: Table) => JsonRenameTableStatement;
301
- export declare const prepareCreateEnumJson: (name: string, values: string[]) => JsonCreateEnumStatement;
302
- export declare const prepareAddValuesToEnumJson: (name: string, values: string[]) => JsonAddValueToEnumStatement[];
322
+ export declare const prepareCreateEnumJson: (name: string, schema: string, values: string[]) => JsonCreateEnumStatement;
323
+ export declare const prepareAddValuesToEnumJson: (name: string, schema: string, values: {
324
+ value: string;
325
+ before: string;
326
+ }[]) => JsonAddValueToEnumStatement[];
327
+ export declare const prepareDropEnumJson: (name: string, schema: string) => JsonDropEnumStatement;
328
+ export declare const prepareMoveEnumJson: (name: string, schemaFrom: string, schemaTo: string) => JsonMoveEnumStatement;
329
+ export declare const prepareRenameEnumJson: (nameFrom: string, nameTo: string, schema: string) => JsonRenameEnumStatement;
303
330
  export declare const prepareCreateSchemasJson: (values: string[]) => JsonCreateSchema[];
304
331
  export declare const prepareRenameSchemasJson: (values: {
305
332
  from: string;
@@ -310,11 +337,11 @@ export declare const prepareRenameColumns: (tableName: string, schema: string, p
310
337
  from: Column;
311
338
  to: Column;
312
339
  }[]) => JsonRenameColumnStatement[];
313
- export declare const prepareAlterTableColumnsJson: (tableName: string, schema: string, deleted: Column[], added: Column[], altered: AlteredColumn[], addedFk: Record<string, string>, json2: CommonSquashedSchema, dialect?: Dialect) => {
314
- addColumns: JsonStatement[];
315
- dropColumns: JsonDropColumnStatement[];
316
- alterColumns: JsonAlterColumnStatement[];
317
- };
340
+ export declare const _prepareDropColumns: (taleName: string, schema: string, columns: Column[]) => JsonDropColumnStatement[];
341
+ export declare const _prepareAddColumns: (tableName: string, schema: string, columns: Column[]) => JsonAddColumnStatement[];
342
+ export declare const prepareAlterColumnsMysql: (tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
343
+ export declare const preparePgAlterColumns: (_tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
344
+ export declare const prepareSqliteAlterColumns: (tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
318
345
  export declare const prepareCreateIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonCreateIndexStatement[];
319
346
  export declare const prepareCreateReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonCreateReferenceStatement[];
320
347
  export declare const prepareDropReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonDeleteReferenceStatement[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.17-7776aba",
3
+ "version": "0.20.17-7a1dd7a",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -8,57 +8,22 @@
8
8
  "drizzle-kit": "./bin.cjs"
9
9
  },
10
10
  "scripts": {
11
- "test:pg:push": "drizzle-kit push:pg",
12
11
  "payload": "tsx ./dev/payload.ts",
13
12
  "migrate:old": "drizzle-kit generate:mysql",
14
- "push": "node -r esbuild-register ./src/cli/index.ts push:mysql",
15
- "push:sqlite": "node -r ./src/loader.mjs ./src/cli/index.ts push:sqlite",
16
- "try1": "tsx ./src/t.ts",
17
- "migrate:old:mysql": "drizzle-kit generate:mysql --out ./dev/migrations-mysql --schema ./dev/migrations-mysql/schema.ts",
18
- "start:pg": "node -r esbuild-register ./src/cli/index.ts generate:pg",
19
- "start:sqlite": "node -r esbuild-register ./src/cli/index.ts generate:sqlite",
20
- "start:mysql": "node -r esbuild-register ./src/cli/index.ts generate:mysql",
21
- "check:pg": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/migrations --dialect pg",
22
- "introspect:mysql": "node -r esbuild-register ./src/cli/index.ts introspect:mysql --config drizzle.config2.ts",
23
- "introspect:sqlite": "node -r esbuild-register ./src/cli/index.ts introspect:sqlite --driver=sqlite",
24
- "introspect:pg": "node -r esbuild-register ./src/cli/index.ts introspect:pg --out ./dev/introspect-pg --connectionString=postgresql://postgres@localhost:5432/introspect",
25
- "drop": "node -r esbuild-register ./src/cli/index.ts drop",
26
- "up:pg": "node -r esbuild-register ./src/cli/index.ts up:pg --out ./dev/migrations-pg",
27
- "up:mysql": "node -r esbuild-register ./src/cli/index.ts up:mysql --out ./dev/migrations-mysql",
28
- "check:equedi": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/equedi --dialect pg",
29
- "run": "node -r esbuild-register index.ts",
30
- "watch": "esbuild ./src/clie/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --external:pg-native --sourcemap --watch",
31
- "diff": "esbuild ./src/clie/index.ts ./dev/diff.ts",
32
- "prepare:mysql": "node -r esbuild-register dev/mysql/index.ts",
33
- "prepare:pg": "node -r esbuild-register dev/index.ts",
34
- "prepare-snapshot": "node -r esbuild-register ./dev/prepare-snapshot prepare ./dev/data",
35
- "sim": "node -r esbuild-register ./dev/simulate.ts",
36
- "sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
37
- "test": "ava test --timeout=60s",
38
- "build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && pnpm mts && tsx build.ts",
13
+ "cli": "tsx ./src/cli/index.ts",
14
+ "test": "vitest",
39
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",
40
17
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
41
18
  "packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
42
19
  "tsc": "tsc -p tsconfig.build.json",
43
- "pub": "cp package.json readme.md dist/ && cd dist && npm publish",
44
- "studio": "tsx ./src/cli/index.ts studio --verbose --port=3000",
45
- "studio:dev": "tsx ./src/cli/index.ts studio --verbose"
46
- },
47
- "ava": {
48
- "files": [
49
- "test/**/*.ts"
50
- ],
51
- "extensions": {
52
- "ts": "module"
53
- },
54
- "nodeArguments": [
55
- "--loader=tsx"
56
- ]
20
+ "pub": "cp package.json readme.md dist/ && cd dist && npm publish"
57
21
  },
58
22
  "dependencies": {
59
23
  "@esbuild-kit/esm-loader": "^2.5.5",
60
24
  "@hono/node-server": "^1.9.0",
61
25
  "@hono/zod-validator": "^0.2.0",
26
+ "@types/json-diff": "^1.0.3",
62
27
  "camelcase": "^7.0.1",
63
28
  "chalk": "^5.2.0",
64
29
  "commander": "^9.4.1",
@@ -70,40 +35,53 @@
70
35
  "hono": "^4.1.4",
71
36
  "json-diff": "0.9.0",
72
37
  "minimatch": "^7.4.3",
38
+ "pluralize": "^8.0.0",
73
39
  "semver": "^7.5.4",
74
40
  "superjson": "^2.2.1",
41
+ "ws": "^8.16.0",
75
42
  "zod": "^3.20.2"
76
43
  },
77
44
  "devDependencies": {
45
+ "@aws-sdk/client-rds-data": "^3.556.0",
78
46
  "@cloudflare/workers-types": "^4.20230518.0",
47
+ "@electric-sql/pglite": "^0.1.3",
79
48
  "@libsql/client": "^0.4.2",
49
+ "@neondatabase/serverless": "^0.9.1",
50
+ "@originjs/vite-plugin-commonjs": "^1.0.3",
51
+ "@planetscale/database": "^1.16.0",
80
52
  "@types/better-sqlite3": "^7.6.4",
81
- "@types/dockerode": "^3.3.14",
53
+ "@types/dockerode": "^3.3.28",
82
54
  "@types/glob": "^8.1.0",
83
55
  "@types/minimatch": "^5.1.2",
84
56
  "@types/node": "^18.11.15",
85
57
  "@types/pg": "^8.10.7",
58
+ "@types/pluralize": "^0.0.33",
86
59
  "@types/semver": "^7.5.5",
87
- "@typescript-eslint/eslint-plugin": "^5.46.1",
88
- "@typescript-eslint/parser": "^5.46.1",
60
+ "@types/uuid": "^9.0.8",
61
+ "@types/ws": "^8.5.10",
62
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
63
+ "@typescript-eslint/parser": "^7.2.0",
64
+ "@vercel/postgres": "^0.8.0",
89
65
  "ava": "^5.1.0",
90
66
  "better-sqlite3": "^9.4.3",
91
67
  "dockerode": "^3.3.4",
92
68
  "dotenv": "^16.0.3",
93
69
  "drizzle-kit": "0.20.14",
94
- "drizzle-orm": "0.30.5",
70
+ "drizzle-orm": "0.30.5-ab9feb7",
95
71
  "esbuild-node-externals": "^1.9.0",
96
- "eslint": "^8.29.0",
97
- "eslint-config-prettier": "^8.5.0",
98
- "eslint-plugin-prettier": "^4.2.1",
72
+ "eslint": "^8.57.0",
73
+ "eslint-config-prettier": "^9.1.0",
74
+ "eslint-plugin-prettier": "^5.1.3",
99
75
  "get-port": "^6.1.2",
100
76
  "mysql2": "2.3.3",
101
77
  "pg": "^8.11.3",
102
- "postgres": "^3.3.5",
78
+ "postgres": "^3.4.4",
103
79
  "prettier": "^2.8.1",
104
80
  "tsx": "^3.12.1",
105
- "typescript": "^4.9.4",
106
- "uvu": "^0.5.6",
81
+ "typescript": "^5.4.3",
82
+ "uuid": "^9.0.1",
83
+ "vite-tsconfig-paths": "^4.3.2",
84
+ "vitest": "^1.4.0",
107
85
  "wrangler": "^3.22.1",
108
86
  "zx": "^7.2.2"
109
87
  },
package/payload.d.mts CHANGED
@@ -2,14 +2,14 @@ import { PgDatabase } from "drizzle-orm/pg-core";
2
2
  import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
3
3
  import { SQLiteSchema as SQLiteSchemaKit } from "./serializer/sqliteSchema";
4
4
  import { MySqlSchema as MySQLSchemaKit } from "./serializer/mysqlSchema";
5
- import { MySql2Database } from "drizzle-orm/mysql2";
6
- import { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
5
+ import type { MySql2Database } from "drizzle-orm/mysql2";
6
+ import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
7
7
  export type DrizzleSnapshotJSON = PgSchemaKit;
8
8
  export type DrizzleSQLiteSnapshotJSON = SQLiteSchemaKit;
9
9
  export type DrizzleMySQLSnapshotJSON = MySQLSchemaKit;
10
10
  export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
11
11
  export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
12
- export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
12
+ export declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
13
13
  hasDataLoss: boolean;
14
14
  warnings: string[];
15
15
  statementsToExecute: string[];
@@ -17,7 +17,7 @@ export declare const pushSchema: (imports: Record<string, unknown>, db: PgDataba
17
17
  }>;
18
18
  export declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchemaKit>;
19
19
  export declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
20
- export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: BetterSQLite3Database<any>) => Promise<{
20
+ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
21
21
  hasDataLoss: boolean;
22
22
  warnings: string[];
23
23
  statementsToExecute: string[];
@@ -25,7 +25,7 @@ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: Be
25
25
  }>;
26
26
  export declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySQLSchemaKit>;
27
27
  export declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
28
- export declare const pushMySQLSchema: (imports: Record<string, unknown>, db: MySql2Database<any>, databaseName: string) => Promise<{
28
+ export declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
29
29
  hasDataLoss: boolean;
30
30
  warnings: string[];
31
31
  statementsToExecute: string[];
package/payload.d.ts CHANGED
@@ -2,14 +2,14 @@ import { PgDatabase } from "drizzle-orm/pg-core";
2
2
  import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
3
3
  import { SQLiteSchema as SQLiteSchemaKit } from "./serializer/sqliteSchema";
4
4
  import { MySqlSchema as MySQLSchemaKit } from "./serializer/mysqlSchema";
5
- import { MySql2Database } from "drizzle-orm/mysql2";
6
- import { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
5
+ import type { MySql2Database } from "drizzle-orm/mysql2";
6
+ import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
7
7
  export type DrizzleSnapshotJSON = PgSchemaKit;
8
8
  export type DrizzleSQLiteSnapshotJSON = SQLiteSchemaKit;
9
9
  export type DrizzleMySQLSnapshotJSON = MySQLSchemaKit;
10
10
  export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
11
11
  export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
12
- export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
12
+ export declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
13
13
  hasDataLoss: boolean;
14
14
  warnings: string[];
15
15
  statementsToExecute: string[];
@@ -17,7 +17,7 @@ export declare const pushSchema: (imports: Record<string, unknown>, db: PgDataba
17
17
  }>;
18
18
  export declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchemaKit>;
19
19
  export declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
20
- export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: BetterSQLite3Database<any>) => Promise<{
20
+ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
21
21
  hasDataLoss: boolean;
22
22
  warnings: string[];
23
23
  statementsToExecute: string[];
@@ -25,7 +25,7 @@ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: Be
25
25
  }>;
26
26
  export declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySQLSchemaKit>;
27
27
  export declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
28
- export declare const pushMySQLSchema: (imports: Record<string, unknown>, db: MySql2Database<any>, databaseName: string) => Promise<{
28
+ export declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
29
29
  hasDataLoss: boolean;
30
30
  warnings: string[];
31
31
  statementsToExecute: string[];