drizzle-kit 0.20.17-4e262b7 → 0.20.17-7776aba

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/bin.cjs +22248 -23435
  2. package/cli/commands/migrate.d.ts +135 -152
  3. package/cli/commands/mysqlIntrospect.d.ts +79 -15
  4. package/cli/commands/mysqlPushUtils.d.ts +8 -4
  5. package/cli/commands/mysqlUp.d.ts +4 -0
  6. package/cli/commands/pgConnect.d.ts +5 -0
  7. package/cli/commands/pgIntrospect.d.ts +76 -12
  8. package/cli/commands/pgPushUtils.d.ts +6 -3
  9. package/cli/commands/pgUp.d.ts +4 -0
  10. package/cli/commands/sqliteIntrospect.d.ts +29 -26
  11. package/cli/commands/sqlitePushUtils.d.ts +10 -4
  12. package/cli/commands/sqliteUtils.d.ts +162 -0
  13. package/cli/commands/upFolders.d.ts +27 -0
  14. package/cli/commands/utils.d.ts +255 -39
  15. package/cli/validations/common.d.ts +7 -208
  16. package/cli/validations/mysql.d.ts +337 -7
  17. package/cli/validations/outputs.d.ts +0 -1
  18. package/cli/validations/pg.d.ts +405 -4
  19. package/cli/views.d.ts +5 -7
  20. package/drivers/index.d.ts +39 -0
  21. package/global.d.ts +1 -3
  22. package/index.d.mts +6 -8
  23. package/index.d.ts +6 -8
  24. package/index.js +0 -1
  25. package/introspect-mysql.d.ts +9 -0
  26. package/introspect-pg.d.ts +12 -0
  27. package/introspect-sqlite.d.ts +2 -2
  28. package/jsonDiffer.d.ts +29 -14
  29. package/jsonStatements.d.ts +11 -38
  30. package/package.json +52 -24
  31. package/payload.d.mts +5 -5
  32. package/payload.d.ts +5 -5
  33. package/payload.js +24222 -26044
  34. package/payload.mjs +19956 -21767
  35. package/schemaValidator.d.ts +286 -289
  36. package/serializer/mysqlImports.d.ts +7 -3
  37. package/serializer/mysqlSchema.d.ts +1323 -2454
  38. package/serializer/mysqlSerializer.d.ts +6 -6
  39. package/serializer/pgImports.d.ts +2 -2
  40. package/serializer/pgSchema.d.ts +1283 -1742
  41. package/serializer/pgSerializer.d.ts +2 -2
  42. package/serializer/sqliteImports.d.ts +4 -2
  43. package/serializer/sqliteSchema.d.ts +979 -553
  44. package/serializer/sqliteSerializer.d.ts +4 -4
  45. package/snapshotsDiffer.d.ts +1209 -2486
  46. package/utils/words.d.ts +1 -1
  47. package/utils-studio.d.mts +1 -0
  48. package/utils-studio.d.ts +1 -0
  49. package/utils-studio.js +849 -7058
  50. package/utils-studio.mjs +829 -7035
  51. package/utils.d.ts +141 -14
  52. package/utils.js +7161 -4625
  53. package/utils.mjs +7121 -4585
  54. package/cli/utils.d.ts +0 -12
  55. package/cli/validations/cli.d.ts +0 -169
  56. package/cli/validations/sqlite.d.ts +0 -34
package/jsonDiffer.d.ts CHANGED
@@ -1,16 +1,25 @@
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
- };
10
3
  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[];
11
15
  alteredTablesWithColumns: {
12
16
  name: any;
13
- schema: any;
17
+ schema: {
18
+ type: string;
19
+ value: any;
20
+ };
21
+ deleted: any[];
22
+ added: any[];
14
23
  altered: any[];
15
24
  addedIndexes: {
16
25
  [k: string]: any;
@@ -49,13 +58,19 @@ export function applyJsonDiff(json1: any, json2: any): {
49
58
  [k: string]: any;
50
59
  };
51
60
  }[];
52
- alteredEnums: {
61
+ addedEnums: {
53
62
  name: any;
54
- schema: any;
55
- addedValues: {
56
- before: any;
57
- value: any;
58
- }[];
63
+ values: any[];
64
+ }[];
65
+ deletedEnums: {
66
+ name: any;
67
+ values: any[];
68
+ }[];
69
+ alteredEnums: {
70
+ name: string;
71
+ addedValues: any[];
59
72
  deletedValues: any[];
60
73
  }[];
74
+ addedSchemas: any[];
75
+ deletedSchemas: any[];
61
76
  };
@@ -1,4 +1,4 @@
1
- import { CommonSquashedSchema } from "./schemaValidator";
1
+ import { CommonSquashedSchema, Dialect } 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,32 +34,12 @@ export interface JsonRenameTableStatement {
34
34
  export interface JsonCreateEnumStatement {
35
35
  type: "create_type_enum";
36
36
  name: string;
37
- schema: string;
38
37
  values: string[];
39
38
  }
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
- }
57
39
  export interface JsonAddValueToEnumStatement {
58
40
  type: "alter_type_add_value";
59
41
  name: string;
60
- schema: string;
61
42
  value: string;
62
- before: string;
63
43
  }
64
44
  export interface JsonDropColumnStatement {
65
45
  type: "alter_table_drop_column";
@@ -140,8 +120,7 @@ export interface JsonAlterCompositePK {
140
120
  export interface JsonAlterTableSetSchema {
141
121
  type: "alter_table_set_schema";
142
122
  tableName: string;
143
- schemaFrom: string;
144
- schemaTo: string;
123
+ schema: string;
145
124
  }
146
125
  export interface JsonAlterTableRemoveFromSchema {
147
126
  type: "alter_table_remove_from_schema";
@@ -313,20 +292,14 @@ export interface JsonRenameSchema {
313
292
  to: string;
314
293
  }
315
294
  export type JsonAlterColumnStatement = JsonRenameColumnStatement | JsonAlterColumnTypeStatement | JsonAlterColumnSetDefaultStatement | JsonAlterColumnDropDefaultStatement | JsonAlterColumnSetNotNullStatement | JsonAlterColumnDropNotNullStatement | JsonAlterColumnDropOnUpdateStatement | JsonAlterColumnSetOnUpdateStatement | JsonAlterColumnDropAutoincrementStatement | JsonAlterColumnSetAutoincrementStatement | JsonAlterColumnSetPrimaryKeyStatement | JsonAlterColumnDropPrimaryKeyStatement;
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;
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;
317
296
  export declare const preparePgCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
318
- export declare const prepareMySqlCreateTableJson: (table: Table, json2: MySqlSchema) => JsonCreateTableStatement;
297
+ export declare const prepareMySqlCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
319
298
  export declare const prepareSQLiteCreateTable: (table: Table) => JsonSqliteCreateTableStatement;
320
299
  export declare const prepareDropTableJson: (table: Table) => JsonDropTableStatement;
321
300
  export declare const prepareRenameTableJson: (tableFrom: Table, tableTo: Table) => JsonRenameTableStatement;
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;
301
+ export declare const prepareCreateEnumJson: (name: string, values: string[]) => JsonCreateEnumStatement;
302
+ export declare const prepareAddValuesToEnumJson: (name: string, values: string[]) => JsonAddValueToEnumStatement[];
330
303
  export declare const prepareCreateSchemasJson: (values: string[]) => JsonCreateSchema[];
331
304
  export declare const prepareRenameSchemasJson: (values: {
332
305
  from: string;
@@ -337,11 +310,11 @@ export declare const prepareRenameColumns: (tableName: string, schema: string, p
337
310
  from: Column;
338
311
  to: Column;
339
312
  }[]) => JsonRenameColumnStatement[];
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[];
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
+ };
345
318
  export declare const prepareCreateIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonCreateIndexStatement[];
346
319
  export declare const prepareCreateReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonCreateReferenceStatement[];
347
320
  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-4e262b7",
3
+ "version": "0.20.17-7776aba",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -8,20 +8,55 @@
8
8
  "drizzle-kit": "./bin.cjs"
9
9
  },
10
10
  "scripts": {
11
+ "test:pg:push": "drizzle-kit push:pg",
11
12
  "payload": "tsx ./dev/payload.ts",
12
13
  "migrate:old": "drizzle-kit generate:mysql",
13
- "cli": "tsx ./src/cli/index.ts",
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",
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",
16
38
  "build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && pnpm mts && tsx build.ts",
39
+ "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",
17
40
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
18
41
  "packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
19
42
  "tsc": "tsc -p tsconfig.build.json",
20
- "pub": "cp package.json readme.md dist/ && cd dist && npm publish"
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
+ ]
21
57
  },
22
58
  "dependencies": {
23
59
  "@esbuild-kit/esm-loader": "^2.5.5",
24
- "@types/json-diff": "^1.0.3",
25
60
  "@hono/node-server": "^1.9.0",
26
61
  "@hono/zod-validator": "^0.2.0",
27
62
  "camelcase": "^7.0.1",
@@ -35,47 +70,40 @@
35
70
  "hono": "^4.1.4",
36
71
  "json-diff": "0.9.0",
37
72
  "minimatch": "^7.4.3",
38
- "pluralize": "^8.0.0",
39
73
  "semver": "^7.5.4",
40
74
  "superjson": "^2.2.1",
41
75
  "zod": "^3.20.2"
42
76
  },
43
77
  "devDependencies": {
44
78
  "@cloudflare/workers-types": "^4.20230518.0",
45
- "@electric-sql/pglite": "^0.1.3",
46
79
  "@libsql/client": "^0.4.2",
47
- "@originjs/vite-plugin-commonjs": "^1.0.3",
48
80
  "@types/better-sqlite3": "^7.6.4",
49
- "@types/dockerode": "^3.3.28",
81
+ "@types/dockerode": "^3.3.14",
50
82
  "@types/glob": "^8.1.0",
51
83
  "@types/minimatch": "^5.1.2",
52
84
  "@types/node": "^18.11.15",
53
85
  "@types/pg": "^8.10.7",
54
- "@types/pluralize": "^0.0.33",
55
86
  "@types/semver": "^7.5.5",
56
- "@types/uuid": "^9.0.8",
57
- "@typescript-eslint/eslint-plugin": "^7.2.0",
58
- "@typescript-eslint/parser": "^7.2.0",
59
- "dockerode": "^3.3.4",
60
- "dotenv": "^16.0.3",
61
- "drizzle-orm": "0.30.5-ab9feb7",
87
+ "@typescript-eslint/eslint-plugin": "^5.46.1",
88
+ "@typescript-eslint/parser": "^5.46.1",
62
89
  "ava": "^5.1.0",
63
90
  "better-sqlite3": "^9.4.3",
91
+ "dockerode": "^3.3.4",
92
+ "dotenv": "^16.0.3",
64
93
  "drizzle-kit": "0.20.14",
94
+ "drizzle-orm": "0.30.5",
65
95
  "esbuild-node-externals": "^1.9.0",
66
- "eslint": "^8.57.0",
67
- "eslint-config-prettier": "^9.1.0",
68
- "eslint-plugin-prettier": "^5.1.3",
96
+ "eslint": "^8.29.0",
97
+ "eslint-config-prettier": "^8.5.0",
98
+ "eslint-plugin-prettier": "^4.2.1",
69
99
  "get-port": "^6.1.2",
70
100
  "mysql2": "2.3.3",
71
101
  "pg": "^8.11.3",
72
102
  "postgres": "^3.3.5",
73
103
  "prettier": "^2.8.1",
74
104
  "tsx": "^3.12.1",
75
- "typescript": "^5.4.3",
76
- "uuid": "^9.0.1",
77
- "vite-tsconfig-paths": "^4.3.2",
78
- "vitest": "^1.4.0",
105
+ "typescript": "^4.9.4",
106
+ "uvu": "^0.5.6",
79
107
  "wrangler": "^3.22.1",
80
108
  "zx": "^7.2.2"
81
109
  },
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 type { MySql2Database } from "drizzle-orm/mysql2";
6
- import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
5
+ import { MySql2Database } from "drizzle-orm/mysql2";
6
+ import { 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>, drizzleInstance: PgDatabase<any>) => Promise<{
12
+ export declare const pushSchema: (imports: Record<string, unknown>, db: 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>, drizzleInsta
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>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
20
+ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: 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>, drizzl
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>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
28
+ export declare const pushMySQLSchema: (imports: Record<string, unknown>, db: 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 type { MySql2Database } from "drizzle-orm/mysql2";
6
- import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
5
+ import { MySql2Database } from "drizzle-orm/mysql2";
6
+ import { 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>, drizzleInstance: PgDatabase<any>) => Promise<{
12
+ export declare const pushSchema: (imports: Record<string, unknown>, db: 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>, drizzleInsta
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>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
20
+ export declare const pushSQLiteSchema: (imports: Record<string, unknown>, db: 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>, drizzl
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>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
28
+ export declare const pushMySQLSchema: (imports: Record<string, unknown>, db: MySql2Database<any>, databaseName: string) => Promise<{
29
29
  hasDataLoss: boolean;
30
30
  warnings: string[];
31
31
  statementsToExecute: string[];