drizzle-kit 0.20.16 → 0.20.17-4e262b7
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +28200 -26856
- 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
@@ -1,63 +1,115 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { PgSchema } from "
|
4
|
-
import { SQLiteSchema } from "
|
5
|
-
import { MySqlSchema } from "
|
6
|
-
import { Journal } from "
|
1
|
+
import { Column, ColumnsResolverInput, ColumnsResolverOutput, Enum, ResolverInput, ResolverOutput, ResolverOutputWithMoved, Table } from "../../snapshotsDiffer";
|
2
|
+
import type { CommonSchema } from "../../schemaValidator";
|
3
|
+
import { PgSchema } from "../../serializer/pgSchema";
|
4
|
+
import { SQLiteSchema } from "../../serializer/sqliteSchema";
|
5
|
+
import { MySqlSchema } from "../../serializer/mysqlSchema";
|
6
|
+
import { Journal } from "../../utils";
|
7
7
|
import { GenerateConfig } from "./utils";
|
8
8
|
export type Named = {
|
9
9
|
name: string;
|
10
10
|
};
|
11
11
|
export type NamedWithSchema = {
|
12
12
|
name: string;
|
13
|
-
schema
|
13
|
+
schema: string;
|
14
14
|
};
|
15
|
+
export declare const schemasResolver: (input: ResolverInput<Table>) => Promise<ResolverOutput<Table>>;
|
16
|
+
export declare const tablesResolver: (input: ResolverInput<Table>) => Promise<ResolverOutputWithMoved<Table>>;
|
17
|
+
export declare const enumsResolver: (input: ResolverInput<Enum>) => Promise<ResolverOutputWithMoved<Enum>>;
|
18
|
+
export declare const columnsResolver: (input: ColumnsResolverInput<Column>) => Promise<ColumnsResolverOutput<Column>>;
|
15
19
|
export declare const prepareAndMigratePg: (config: GenerateConfig) => Promise<void>;
|
16
|
-
export declare const
|
17
|
-
schema: string | string[];
|
18
|
-
}, snapshot: MySqlSchema) => Promise<{
|
20
|
+
export declare const preparePgPush: (schemaPath: string | string[], snapshot: PgSchema, schemaFilter: string[]) => Promise<{
|
19
21
|
sqlStatements: string[];
|
20
22
|
statements: import("../../jsonStatements").JsonStatement[];
|
21
|
-
|
22
|
-
internal?: {
|
23
|
-
tables: Record<string, {
|
24
|
-
columns: Record<string, {
|
25
|
-
isDefaultAnExpression?: boolean | undefined;
|
26
|
-
} | undefined>;
|
27
|
-
} | undefined>;
|
28
|
-
} | undefined;
|
29
|
-
id: string;
|
30
|
-
prevId: string;
|
31
|
-
version: "5";
|
32
|
-
dialect: "mysql";
|
23
|
+
squashedPrev: {
|
33
24
|
tables: Record<string, {
|
34
|
-
schema?: string | undefined;
|
35
25
|
name: string;
|
36
26
|
columns: Record<string, {
|
27
|
+
name: string;
|
28
|
+
type: string;
|
29
|
+
primaryKey: boolean;
|
30
|
+
notNull: boolean;
|
31
|
+
isUnique?: any;
|
37
32
|
default?: any;
|
38
|
-
|
39
|
-
|
33
|
+
typeSchema?: string | undefined;
|
34
|
+
uniqueName?: string | undefined;
|
35
|
+
nullsNotDistinct?: boolean | undefined;
|
36
|
+
}>;
|
37
|
+
indexes: Record<string, string>;
|
38
|
+
foreignKeys: Record<string, string>;
|
39
|
+
schema: string;
|
40
|
+
compositePrimaryKeys: Record<string, string>;
|
41
|
+
uniqueConstraints: Record<string, string>;
|
42
|
+
}>;
|
43
|
+
version: "6";
|
44
|
+
dialect: "pg";
|
45
|
+
schemas: Record<string, string>;
|
46
|
+
enums: Record<string, {
|
47
|
+
name: string;
|
48
|
+
values: string[];
|
49
|
+
schema: string;
|
50
|
+
}>;
|
51
|
+
};
|
52
|
+
squashedCur: {
|
53
|
+
tables: Record<string, {
|
54
|
+
name: string;
|
55
|
+
columns: Record<string, {
|
56
|
+
name: string;
|
57
|
+
type: string;
|
58
|
+
primaryKey: boolean;
|
59
|
+
notNull: boolean;
|
60
|
+
isUnique?: any;
|
61
|
+
default?: any;
|
62
|
+
typeSchema?: string | undefined;
|
63
|
+
uniqueName?: string | undefined;
|
64
|
+
nullsNotDistinct?: boolean | undefined;
|
65
|
+
}>;
|
66
|
+
indexes: Record<string, string>;
|
67
|
+
foreignKeys: Record<string, string>;
|
68
|
+
schema: string;
|
69
|
+
compositePrimaryKeys: Record<string, string>;
|
70
|
+
uniqueConstraints: Record<string, string>;
|
71
|
+
}>;
|
72
|
+
version: "6";
|
73
|
+
dialect: "pg";
|
74
|
+
schemas: Record<string, string>;
|
75
|
+
enums: Record<string, {
|
76
|
+
name: string;
|
77
|
+
values: string[];
|
78
|
+
schema: string;
|
79
|
+
}>;
|
80
|
+
};
|
81
|
+
}>;
|
82
|
+
export declare const prepareMySQLPush: (schemaPath: string | string[], snapshot: MySqlSchema) => Promise<{
|
83
|
+
sqlStatements: string[];
|
84
|
+
statements: import("../../jsonStatements").JsonStatement[];
|
85
|
+
validatedCur: {
|
86
|
+
tables: Record<string, {
|
87
|
+
name: string;
|
88
|
+
columns: Record<string, {
|
40
89
|
name: string;
|
41
90
|
type: string;
|
42
91
|
primaryKey: boolean;
|
43
92
|
notNull: boolean;
|
93
|
+
default?: any;
|
94
|
+
onUpdate?: any;
|
95
|
+
autoincrement?: boolean | undefined;
|
44
96
|
}>;
|
45
97
|
indexes: Record<string, {
|
46
|
-
using?: "btree" | "hash" | undefined;
|
47
|
-
algorithm?: "default" | "inplace" | "copy" | undefined;
|
48
|
-
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
49
98
|
name: string;
|
50
99
|
columns: string[];
|
51
100
|
isUnique: boolean;
|
101
|
+
using?: "btree" | "hash" | undefined;
|
102
|
+
algorithm?: "default" | "inplace" | "copy" | undefined;
|
103
|
+
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
52
104
|
}>;
|
53
105
|
foreignKeys: Record<string, {
|
54
|
-
onUpdate?: string | undefined;
|
55
|
-
onDelete?: string | undefined;
|
56
106
|
name: string;
|
57
107
|
tableFrom: string;
|
58
108
|
columnsFrom: string[];
|
59
109
|
tableTo: string;
|
60
110
|
columnsTo: string[];
|
111
|
+
onUpdate?: string | undefined;
|
112
|
+
onDelete?: string | undefined;
|
61
113
|
}>;
|
62
114
|
compositePrimaryKeys: Record<string, {
|
63
115
|
name: string;
|
@@ -68,14 +120,14 @@ export declare const prepareMySQLPush: (config: {
|
|
68
120
|
columns: string[];
|
69
121
|
}>;
|
70
122
|
}>;
|
71
|
-
|
123
|
+
id: string;
|
124
|
+
prevId: string;
|
125
|
+
version: "6";
|
126
|
+
dialect: "mysql";
|
72
127
|
_meta: {
|
73
128
|
columns: Record<string, string>;
|
74
129
|
tables: Record<string, string>;
|
75
|
-
schemas: Record<string, string>;
|
76
130
|
};
|
77
|
-
};
|
78
|
-
validatedPrev: {
|
79
131
|
internal?: {
|
80
132
|
tables: Record<string, {
|
81
133
|
columns: Record<string, {
|
@@ -83,38 +135,35 @@ export declare const prepareMySQLPush: (config: {
|
|
83
135
|
} | undefined>;
|
84
136
|
} | undefined>;
|
85
137
|
} | undefined;
|
86
|
-
|
87
|
-
|
88
|
-
version: "5";
|
89
|
-
dialect: "mysql";
|
138
|
+
};
|
139
|
+
validatedPrev: {
|
90
140
|
tables: Record<string, {
|
91
|
-
schema?: string | undefined;
|
92
141
|
name: string;
|
93
142
|
columns: Record<string, {
|
94
|
-
default?: any;
|
95
|
-
onUpdate?: any;
|
96
|
-
autoincrement?: boolean | undefined;
|
97
143
|
name: string;
|
98
144
|
type: string;
|
99
145
|
primaryKey: boolean;
|
100
146
|
notNull: boolean;
|
147
|
+
default?: any;
|
148
|
+
onUpdate?: any;
|
149
|
+
autoincrement?: boolean | undefined;
|
101
150
|
}>;
|
102
151
|
indexes: Record<string, {
|
103
|
-
using?: "btree" | "hash" | undefined;
|
104
|
-
algorithm?: "default" | "inplace" | "copy" | undefined;
|
105
|
-
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
106
152
|
name: string;
|
107
153
|
columns: string[];
|
108
154
|
isUnique: boolean;
|
155
|
+
using?: "btree" | "hash" | undefined;
|
156
|
+
algorithm?: "default" | "inplace" | "copy" | undefined;
|
157
|
+
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
109
158
|
}>;
|
110
159
|
foreignKeys: Record<string, {
|
111
|
-
onUpdate?: string | undefined;
|
112
|
-
onDelete?: string | undefined;
|
113
160
|
name: string;
|
114
161
|
tableFrom: string;
|
115
162
|
columnsFrom: string[];
|
116
163
|
tableTo: string;
|
117
164
|
columnsTo: string[];
|
165
|
+
onUpdate?: string | undefined;
|
166
|
+
onDelete?: string | undefined;
|
118
167
|
}>;
|
119
168
|
compositePrimaryKeys: Record<string, {
|
120
169
|
name: string;
|
@@ -125,146 +174,114 @@ export declare const prepareMySQLPush: (config: {
|
|
125
174
|
columns: string[];
|
126
175
|
}>;
|
127
176
|
}>;
|
128
|
-
|
177
|
+
id: string;
|
178
|
+
prevId: string;
|
179
|
+
version: "6";
|
180
|
+
dialect: "mysql";
|
129
181
|
_meta: {
|
130
182
|
columns: Record<string, string>;
|
131
183
|
tables: Record<string, string>;
|
132
|
-
schemas: Record<string, string>;
|
133
184
|
};
|
185
|
+
internal?: {
|
186
|
+
tables: Record<string, {
|
187
|
+
columns: Record<string, {
|
188
|
+
isDefaultAnExpression?: boolean | undefined;
|
189
|
+
} | undefined>;
|
190
|
+
} | undefined>;
|
191
|
+
} | undefined;
|
134
192
|
};
|
135
|
-
}
|
136
|
-
export declare const
|
137
|
-
|
138
|
-
|
193
|
+
}>;
|
194
|
+
export declare const prepareAndMigrateMysql: (config: GenerateConfig) => Promise<void>;
|
195
|
+
export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
|
196
|
+
export declare const prepareSQLitePush: (schemaPath: string | string[], snapshot: SQLiteSchema) => Promise<{
|
139
197
|
sqlStatements: string[];
|
140
198
|
statements: import("../../jsonStatements").JsonStatement[];
|
141
199
|
squashedPrev: {
|
142
|
-
enums?: any;
|
143
|
-
version: "5";
|
144
|
-
dialect: "sqlite";
|
145
200
|
tables: Record<string, {
|
146
201
|
name: string;
|
147
202
|
columns: Record<string, {
|
148
|
-
default?: any;
|
149
|
-
autoincrement?: boolean | undefined;
|
150
203
|
name: string;
|
151
204
|
type: string;
|
152
205
|
primaryKey: boolean;
|
153
206
|
notNull: boolean;
|
154
|
-
}>;
|
155
|
-
indexes: Record<string, string>;
|
156
|
-
foreignKeys: Record<string, string>;
|
157
|
-
compositePrimaryKeys: Record<string, string>;
|
158
|
-
uniqueConstraints: Record<string, string>;
|
159
|
-
}>;
|
160
|
-
};
|
161
|
-
squashedCur: {
|
162
|
-
enums?: any;
|
163
|
-
version: "5";
|
164
|
-
dialect: "sqlite";
|
165
|
-
tables: Record<string, {
|
166
|
-
name: string;
|
167
|
-
columns: Record<string, {
|
168
207
|
default?: any;
|
169
208
|
autoincrement?: boolean | undefined;
|
170
|
-
name: string;
|
171
|
-
type: string;
|
172
|
-
primaryKey: boolean;
|
173
|
-
notNull: boolean;
|
174
209
|
}>;
|
175
210
|
indexes: Record<string, string>;
|
176
211
|
foreignKeys: Record<string, string>;
|
177
212
|
compositePrimaryKeys: Record<string, string>;
|
178
213
|
uniqueConstraints: Record<string, string>;
|
179
214
|
}>;
|
180
|
-
};
|
181
|
-
meta: {
|
182
|
-
schemas: {};
|
183
|
-
tables: {};
|
184
|
-
columns: {};
|
185
|
-
} | undefined;
|
186
|
-
} | undefined>;
|
187
|
-
export declare const preparePgPush: (config: {
|
188
|
-
schema: string | string[];
|
189
|
-
}, snapshot: PgSchema, schemaFilter: string[]) => Promise<{
|
190
|
-
sqlStatements: string[];
|
191
|
-
statements: import("../../jsonStatements").JsonStatement[];
|
192
|
-
squashedPrev: {
|
193
215
|
version: "5";
|
194
|
-
dialect: "
|
195
|
-
|
196
|
-
name: string;
|
197
|
-
columns: Record<string, {
|
198
|
-
isUnique?: any;
|
199
|
-
default?: any;
|
200
|
-
uniqueName?: string | undefined;
|
201
|
-
nullsNotDistinct?: boolean | undefined;
|
202
|
-
name: string;
|
203
|
-
type: string;
|
204
|
-
primaryKey: boolean;
|
205
|
-
notNull: boolean;
|
206
|
-
}>;
|
207
|
-
indexes: Record<string, string>;
|
208
|
-
foreignKeys: Record<string, string>;
|
209
|
-
schema: string;
|
210
|
-
compositePrimaryKeys: Record<string, string>;
|
211
|
-
uniqueConstraints: Record<string, string>;
|
212
|
-
}>;
|
213
|
-
schemas: Record<string, string>;
|
214
|
-
enums: Record<string, {
|
215
|
-
name: string;
|
216
|
-
values: Record<string, string>;
|
217
|
-
}>;
|
216
|
+
dialect: "sqlite";
|
217
|
+
enums?: any;
|
218
218
|
};
|
219
219
|
squashedCur: {
|
220
|
-
version: "5";
|
221
|
-
dialect: "pg";
|
222
220
|
tables: Record<string, {
|
223
221
|
name: string;
|
224
222
|
columns: Record<string, {
|
225
|
-
isUnique?: any;
|
226
|
-
default?: any;
|
227
|
-
uniqueName?: string | undefined;
|
228
|
-
nullsNotDistinct?: boolean | undefined;
|
229
223
|
name: string;
|
230
224
|
type: string;
|
231
225
|
primaryKey: boolean;
|
232
226
|
notNull: boolean;
|
227
|
+
default?: any;
|
228
|
+
autoincrement?: boolean | undefined;
|
233
229
|
}>;
|
234
230
|
indexes: Record<string, string>;
|
235
231
|
foreignKeys: Record<string, string>;
|
236
|
-
schema: string;
|
237
232
|
compositePrimaryKeys: Record<string, string>;
|
238
233
|
uniqueConstraints: Record<string, string>;
|
239
234
|
}>;
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
values: Record<string, string>;
|
244
|
-
}>;
|
235
|
+
version: "5";
|
236
|
+
dialect: "sqlite";
|
237
|
+
enums?: any;
|
245
238
|
};
|
246
|
-
|
247
|
-
export declare const prepareAndMigrateMySql: (config: GenerateConfig) => Promise<void>;
|
248
|
-
export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
|
249
|
-
export declare const prepareSQL: (prev: CommonSquashedSchema, cur: CommonSquashedSchema, dialect: Dialect, prevFull?: any, curFull?: any) => Promise<{
|
250
|
-
statements: import("../../jsonStatements").JsonStatement[];
|
251
|
-
sqlStatements: string[];
|
252
|
-
_meta: {
|
239
|
+
meta: {
|
253
240
|
schemas: {};
|
254
241
|
tables: {};
|
255
242
|
columns: {};
|
256
243
|
} | undefined;
|
257
244
|
}>;
|
245
|
+
export declare const promptColumnsConflicts: <T extends Named>(tableName: string, newColumns: T[], missingColumns: T[]) => Promise<{
|
246
|
+
created: T[];
|
247
|
+
renamed: {
|
248
|
+
from: T;
|
249
|
+
to: T;
|
250
|
+
}[];
|
251
|
+
deleted: T[];
|
252
|
+
}>;
|
253
|
+
export declare const promptNamedWithSchemasConflict: <T extends NamedWithSchema>(newItems: T[], missingItems: T[], entity: "table" | "enum") => Promise<{
|
254
|
+
created: T[];
|
255
|
+
renamed: {
|
256
|
+
from: T;
|
257
|
+
to: T;
|
258
|
+
}[];
|
259
|
+
moved: {
|
260
|
+
name: string;
|
261
|
+
schemaFrom: string;
|
262
|
+
schemaTo: string;
|
263
|
+
}[];
|
264
|
+
deleted: T[];
|
265
|
+
}>;
|
266
|
+
export declare const promptSchemasConflict: <T extends Named>(newSchemas: T[], missingSchemas: T[]) => Promise<{
|
267
|
+
created: T[];
|
268
|
+
renamed: {
|
269
|
+
from: T;
|
270
|
+
to: T;
|
271
|
+
}[];
|
272
|
+
deleted: T[];
|
273
|
+
}>;
|
258
274
|
export declare const BREAKPOINT = "--> statement-breakpoint\n";
|
259
|
-
export declare const writeResult: ({ cur, sqlStatements, journal, _meta, outFolder, breakpoints, bundle, type, }: {
|
275
|
+
export declare const writeResult: ({ cur, sqlStatements, journal, _meta, outFolder, breakpoints, name, bundle, type, }: {
|
260
276
|
cur: CommonSchema;
|
261
277
|
sqlStatements: string[];
|
262
278
|
journal: Journal;
|
263
279
|
_meta?: any;
|
264
280
|
outFolder: string;
|
265
281
|
breakpoints: boolean;
|
266
|
-
|
267
|
-
|
282
|
+
name?: string;
|
283
|
+
bundle?: boolean;
|
284
|
+
type?: "introspect" | "custom" | "none";
|
268
285
|
}) => void;
|
269
286
|
export declare const embeddedMigrations: (journal: Journal) => string;
|
270
287
|
export declare const prepareSnapshotFolderName: () => string;
|
@@ -1,104 +1,38 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
export declare const connectToMySQL: (
|
4
|
-
|
5
|
-
|
1
|
+
import type { MysqlCredentials } from "../validations/mysql";
|
2
|
+
import type { DB } from "../../utils";
|
3
|
+
export declare const connectToMySQL: (credentials: MysqlCredentials) => Promise<{
|
4
|
+
db: DB;
|
5
|
+
database: string;
|
6
6
|
}>;
|
7
|
-
export declare const
|
7
|
+
export declare const mysqlPushIntrospect: (db: DB, databaseName: string, filters: string[]) => Promise<{
|
8
8
|
schema: {
|
9
|
-
id: string;
|
10
|
-
prevId: string;
|
11
|
-
version: "5";
|
12
|
-
dialect: "mysql";
|
13
9
|
tables: Record<string, {
|
14
|
-
schema?: string | undefined;
|
15
10
|
name: string;
|
16
11
|
columns: Record<string, {
|
17
|
-
default?: any;
|
18
|
-
onUpdate?: any;
|
19
|
-
autoincrement?: boolean | undefined;
|
20
12
|
name: string;
|
21
13
|
type: string;
|
22
14
|
primaryKey: boolean;
|
23
15
|
notNull: boolean;
|
24
|
-
}>;
|
25
|
-
indexes: Record<string, {
|
26
|
-
using?: "btree" | "hash" | undefined;
|
27
|
-
algorithm?: "default" | "inplace" | "copy" | undefined;
|
28
|
-
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
29
|
-
name: string;
|
30
|
-
columns: string[];
|
31
|
-
isUnique: boolean;
|
32
|
-
}>;
|
33
|
-
foreignKeys: Record<string, {
|
34
|
-
onUpdate?: string | undefined;
|
35
|
-
onDelete?: string | undefined;
|
36
|
-
name: string;
|
37
|
-
tableFrom: string;
|
38
|
-
columnsFrom: string[];
|
39
|
-
tableTo: string;
|
40
|
-
columnsTo: string[];
|
41
|
-
}>;
|
42
|
-
compositePrimaryKeys: Record<string, {
|
43
|
-
name: string;
|
44
|
-
columns: string[];
|
45
|
-
}>;
|
46
|
-
uniqueConstraints: Record<string, {
|
47
|
-
name: string;
|
48
|
-
columns: string[];
|
49
|
-
}>;
|
50
|
-
}>;
|
51
|
-
schemas: Record<string, string>;
|
52
|
-
_meta: {
|
53
|
-
columns: Record<string, string>;
|
54
|
-
tables: Record<string, string>;
|
55
|
-
schemas: Record<string, string>;
|
56
|
-
};
|
57
|
-
};
|
58
|
-
ts: {
|
59
|
-
file: string;
|
60
|
-
imports: string;
|
61
|
-
decalrations: string;
|
62
|
-
schemaEntry: string;
|
63
|
-
};
|
64
|
-
}>;
|
65
|
-
export declare const mysqlPushIntrospect: (connection: {
|
66
|
-
client: DrizzleDbClient;
|
67
|
-
databaseName: string;
|
68
|
-
}, filters: string[]) => Promise<{
|
69
|
-
schema: {
|
70
|
-
id: string;
|
71
|
-
prevId: string;
|
72
|
-
version: "5";
|
73
|
-
dialect: "mysql";
|
74
|
-
tables: Record<string, {
|
75
|
-
schema?: string | undefined;
|
76
|
-
name: string;
|
77
|
-
columns: Record<string, {
|
78
16
|
default?: any;
|
79
17
|
onUpdate?: any;
|
80
18
|
autoincrement?: boolean | undefined;
|
81
|
-
name: string;
|
82
|
-
type: string;
|
83
|
-
primaryKey: boolean;
|
84
|
-
notNull: boolean;
|
85
19
|
}>;
|
86
20
|
indexes: Record<string, {
|
87
|
-
using?: "btree" | "hash" | undefined;
|
88
|
-
algorithm?: "default" | "inplace" | "copy" | undefined;
|
89
|
-
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
90
21
|
name: string;
|
91
22
|
columns: string[];
|
92
23
|
isUnique: boolean;
|
24
|
+
using?: "btree" | "hash" | undefined;
|
25
|
+
algorithm?: "default" | "inplace" | "copy" | undefined;
|
26
|
+
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
93
27
|
}>;
|
94
28
|
foreignKeys: Record<string, {
|
95
|
-
onUpdate?: string | undefined;
|
96
|
-
onDelete?: string | undefined;
|
97
29
|
name: string;
|
98
30
|
tableFrom: string;
|
99
31
|
columnsFrom: string[];
|
100
32
|
tableTo: string;
|
101
33
|
columnsTo: string[];
|
34
|
+
onUpdate?: string | undefined;
|
35
|
+
onDelete?: string | undefined;
|
102
36
|
}>;
|
103
37
|
compositePrimaryKeys: Record<string, {
|
104
38
|
name: string;
|
@@ -109,11 +43,13 @@ export declare const mysqlPushIntrospect: (connection: {
|
|
109
43
|
columns: string[];
|
110
44
|
}>;
|
111
45
|
}>;
|
112
|
-
|
46
|
+
id: string;
|
47
|
+
prevId: string;
|
48
|
+
version: "6";
|
49
|
+
dialect: "mysql";
|
113
50
|
_meta: {
|
114
51
|
columns: Record<string, string>;
|
115
52
|
tables: Record<string, string>;
|
116
|
-
schemas: Record<string, string>;
|
117
53
|
};
|
118
54
|
};
|
119
55
|
}>;
|
@@ -1,13 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { mysqlSchema } from "src/serializer/mysqlSchema";
|
1
|
+
import { JsonStatement } from "../../jsonStatements";
|
2
|
+
import { mysqlSchema } from "../../serializer/mysqlSchema";
|
4
3
|
import { TypeOf } from "zod";
|
4
|
+
import type { DB } from "../../utils";
|
5
5
|
export declare const filterStatements: (statements: JsonStatement[], currentSchema: TypeOf<typeof mysqlSchema>, prevSchema: TypeOf<typeof mysqlSchema>) => JsonStatement[];
|
6
|
-
export declare const logSuggestionsAndReturn: (
|
7
|
-
statements: JsonStatement[];
|
8
|
-
connection: DrizzleDbClient;
|
9
|
-
json2: TypeOf<typeof mysqlSchema>;
|
10
|
-
}) => Promise<{
|
6
|
+
export declare const logSuggestionsAndReturn: (db: DB, statements: JsonStatement[], json2: TypeOf<typeof mysqlSchema>) => Promise<{
|
11
7
|
statementsToExecute: string[];
|
12
8
|
shouldAskForApprove: boolean;
|
13
9
|
infoToPrint: string[];
|