drizzle-kit 0.20.16-ca9dd07 → 0.20.17-4e262b7
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +28058 -26871
- package/cli/commands/migrate.d.ts +152 -135
- package/cli/commands/mysqlIntrospect.d.ts +15 -79
- package/cli/commands/mysqlPushUtils.d.ts +4 -8
- package/cli/commands/pgIntrospect.d.ts +12 -76
- package/cli/commands/pgPushUtils.d.ts +3 -6
- package/cli/commands/sqliteIntrospect.d.ts +26 -29
- package/cli/commands/sqlitePushUtils.d.ts +4 -10
- package/cli/commands/utils.d.ts +39 -255
- package/cli/utils.d.ts +12 -0
- package/cli/validations/cli.d.ts +169 -0
- package/cli/validations/common.d.ts +208 -7
- package/cli/validations/mysql.d.ts +7 -337
- package/cli/validations/outputs.d.ts +1 -0
- package/cli/validations/pg.d.ts +4 -405
- package/cli/validations/sqlite.d.ts +34 -0
- package/cli/views.d.ts +7 -5
- package/global.d.ts +3 -1
- package/index.d.mts +8 -6
- package/index.d.ts +8 -6
- package/index.js +1 -0
- package/introspect-sqlite.d.ts +2 -2
- package/jsonDiffer.d.ts +14 -29
- package/jsonStatements.d.ts +38 -11
- package/package.json +24 -52
- package/payload.d.mts +5 -5
- package/payload.d.ts +5 -5
- package/payload.js +34054 -32232
- package/payload.mjs +26477 -24666
- package/schemaValidator.d.ts +289 -286
- package/serializer/mysqlImports.d.ts +3 -7
- package/serializer/mysqlSchema.d.ts +2501 -1370
- package/serializer/mysqlSerializer.d.ts +6 -6
- package/serializer/pgImports.d.ts +2 -2
- package/serializer/pgSchema.d.ts +1741 -1282
- package/serializer/pgSerializer.d.ts +2 -2
- package/serializer/sqliteImports.d.ts +2 -4
- package/serializer/sqliteSchema.d.ts +553 -979
- package/serializer/sqliteSerializer.d.ts +4 -4
- package/snapshotsDiffer.d.ts +2486 -1209
- package/utils/words.d.ts +1 -1
- package/utils-studio.d.mts +0 -1
- package/utils-studio.d.ts +0 -1
- package/utils-studio.js +7056 -847
- package/utils-studio.mjs +7034 -828
- package/utils.d.ts +14 -141
- package/utils.js +4380 -6916
- package/utils.mjs +4593 -7129
- package/cli/commands/mysqlUp.d.ts +0 -4
- package/cli/commands/pgConnect.d.ts +0 -5
- package/cli/commands/pgUp.d.ts +0 -4
- package/cli/commands/sqliteUtils.d.ts +0 -162
- package/cli/commands/upFolders.d.ts +0 -27
- package/drivers/index.d.ts +0 -39
- package/introspect-mysql.d.ts +0 -9
- package/introspect-pg.d.ts +0 -12
package/jsonStatements.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CommonSquashedSchema
|
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
|
-
|
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:
|
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,
|
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
|
314
|
-
|
315
|
-
|
316
|
-
|
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.
|
3
|
+
"version": "0.20.17-4e262b7",
|
4
4
|
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
|
5
5
|
"author": "Drizzle Team",
|
6
6
|
"license": "MIT",
|
@@ -8,55 +8,20 @@
|
|
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
|
-
"
|
15
|
-
"
|
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",
|
24
|
+
"@types/json-diff": "^1.0.3",
|
60
25
|
"@hono/node-server": "^1.9.0",
|
61
26
|
"@hono/zod-validator": "^0.2.0",
|
62
27
|
"camelcase": "^7.0.1",
|
@@ -70,40 +35,47 @@
|
|
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",
|
75
41
|
"zod": "^3.20.2"
|
76
42
|
},
|
77
43
|
"devDependencies": {
|
78
44
|
"@cloudflare/workers-types": "^4.20230518.0",
|
45
|
+
"@electric-sql/pglite": "^0.1.3",
|
79
46
|
"@libsql/client": "^0.4.2",
|
47
|
+
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
80
48
|
"@types/better-sqlite3": "^7.6.4",
|
81
|
-
"@types/dockerode": "^3.3.
|
49
|
+
"@types/dockerode": "^3.3.28",
|
82
50
|
"@types/glob": "^8.1.0",
|
83
51
|
"@types/minimatch": "^5.1.2",
|
84
52
|
"@types/node": "^18.11.15",
|
85
53
|
"@types/pg": "^8.10.7",
|
54
|
+
"@types/pluralize": "^0.0.33",
|
86
55
|
"@types/semver": "^7.5.5",
|
87
|
-
"@
|
88
|
-
"@typescript-eslint/
|
89
|
-
"
|
90
|
-
"better-sqlite3": "^9.4.3",
|
56
|
+
"@types/uuid": "^9.0.8",
|
57
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
58
|
+
"@typescript-eslint/parser": "^7.2.0",
|
91
59
|
"dockerode": "^3.3.4",
|
92
60
|
"dotenv": "^16.0.3",
|
61
|
+
"drizzle-orm": "0.30.5-ab9feb7",
|
62
|
+
"ava": "^5.1.0",
|
63
|
+
"better-sqlite3": "^9.4.3",
|
93
64
|
"drizzle-kit": "0.20.14",
|
94
|
-
"drizzle-orm": "0.30.5",
|
95
65
|
"esbuild-node-externals": "^1.9.0",
|
96
|
-
"eslint": "^8.
|
97
|
-
"eslint-config-prettier": "^
|
98
|
-
"eslint-plugin-prettier": "^
|
66
|
+
"eslint": "^8.57.0",
|
67
|
+
"eslint-config-prettier": "^9.1.0",
|
68
|
+
"eslint-plugin-prettier": "^5.1.3",
|
99
69
|
"get-port": "^6.1.2",
|
100
70
|
"mysql2": "2.3.3",
|
101
71
|
"pg": "^8.11.3",
|
102
72
|
"postgres": "^3.3.5",
|
103
73
|
"prettier": "^2.8.1",
|
104
74
|
"tsx": "^3.12.1",
|
105
|
-
"typescript": "^4.
|
106
|
-
"
|
75
|
+
"typescript": "^5.4.3",
|
76
|
+
"uuid": "^9.0.1",
|
77
|
+
"vite-tsconfig-paths": "^4.3.2",
|
78
|
+
"vitest": "^1.4.0",
|
107
79
|
"wrangler": "^3.22.1",
|
108
80
|
"zx": "^7.2.2"
|
109
81
|
},
|
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>,
|
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>,
|
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>,
|
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>,
|
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>,
|
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>,
|
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[];
|