drizzle-kit 0.20.18-d190692 → 0.20.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/@types/utils.d.ts +12 -0
  2. package/bin.cjs +55769 -103683
  3. package/cli/commands/migrate.d.ts +270 -0
  4. package/cli/commands/mysqlIntrospect.d.ts +119 -0
  5. package/cli/commands/mysqlPushUtils.d.ts +18 -0
  6. package/cli/commands/mysqlUp.d.ts +4 -0
  7. package/cli/commands/pgConnect.d.ts +5 -0
  8. package/cli/commands/pgIntrospect.d.ts +123 -0
  9. package/cli/commands/pgPushUtils.d.ts +14 -0
  10. package/cli/commands/pgUp.d.ts +4 -0
  11. package/cli/commands/sqliteIntrospect.d.ts +107 -0
  12. package/cli/commands/sqlitePushUtils.d.ts +21 -0
  13. package/cli/commands/sqliteUtils.d.ts +162 -0
  14. package/cli/commands/upFolders.d.ts +27 -0
  15. package/cli/commands/utils.d.ts +274 -0
  16. package/cli/selector-ui.d.ts +13 -0
  17. package/cli/validations/common.d.ts +13 -0
  18. package/cli/validations/mysql.d.ts +365 -0
  19. package/cli/validations/outputs.d.ts +40 -0
  20. package/cli/validations/pg.d.ts +438 -0
  21. package/cli/views.d.ts +61 -0
  22. package/drivers/index.d.ts +39 -0
  23. package/global.d.ts +4 -0
  24. package/index.d.mts +68 -46
  25. package/index.d.ts +68 -46
  26. package/index.js +0 -1
  27. package/introspect-mysql.d.ts +9 -0
  28. package/introspect-pg.d.ts +12 -0
  29. package/introspect-sqlite.d.ts +10 -0
  30. package/jsonDiffer.d.ts +76 -0
  31. package/jsonStatements.d.ts +349 -0
  32. package/migrationPreparator.d.ts +35 -0
  33. package/package.json +64 -31
  34. package/payload.d.mts +18 -1052
  35. package/payload.d.ts +18 -1052
  36. package/payload.js +33563 -19279
  37. package/payload.mjs +33457 -19180
  38. package/schemaValidator.d.ts +1313 -0
  39. package/serializer/index.d.ts +9 -0
  40. package/serializer/mysqlImports.d.ts +11 -0
  41. package/serializer/mysqlSchema.d.ts +3833 -0
  42. package/serializer/mysqlSerializer.d.ts +7 -0
  43. package/serializer/pgImports.d.ts +11 -0
  44. package/serializer/pgSchema.d.ts +4333 -0
  45. package/serializer/pgSerializer.d.ts +7 -0
  46. package/serializer/schemaToDrizzle.d.ts +7 -0
  47. package/serializer/sqliteImports.d.ts +9 -0
  48. package/serializer/sqliteSchema.d.ts +3227 -0
  49. package/serializer/sqliteSerializer.d.ts +6 -0
  50. package/snapshotsDiffer.d.ts +2660 -0
  51. package/sqlgenerator.d.ts +33 -0
  52. package/utils/words.d.ts +7 -0
  53. package/utils-studio.d.mts +5 -0
  54. package/utils-studio.d.ts +5 -0
  55. package/utils-studio.js +809 -4584
  56. package/utils-studio.mjs +793 -4565
  57. package/utils.d.ts +199 -0
  58. package/utils.js +7165 -4635
  59. package/utils.mjs +7125 -4595
@@ -0,0 +1,365 @@
1
+ import { TypeOf } from "zod";
2
+ export declare const mysqlConnectionCli: import("zod").ZodUnion<[import("zod").ZodObject<{
3
+ driver: import("zod").ZodLiteral<"mysql2">;
4
+ host: import("zod").ZodString;
5
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
6
+ user: import("zod").ZodDefault<import("zod").ZodString>;
7
+ password: import("zod").ZodOptional<import("zod").ZodString>;
8
+ database: import("zod").ZodString;
9
+ }, "strip", import("zod").ZodTypeAny, {
10
+ port?: number | undefined;
11
+ password?: string | undefined;
12
+ driver: "mysql2";
13
+ host: string;
14
+ user: string;
15
+ database: string;
16
+ }, {
17
+ port?: number | undefined;
18
+ user?: string | undefined;
19
+ password?: string | undefined;
20
+ driver: "mysql2";
21
+ host: string;
22
+ database: string;
23
+ }>, import("zod").ZodObject<{
24
+ driver: import("zod").ZodLiteral<"mysql2">;
25
+ uri: import("zod").ZodString;
26
+ }, "strip", import("zod").ZodTypeAny, {
27
+ driver: "mysql2";
28
+ uri: string;
29
+ }, {
30
+ driver: "mysql2";
31
+ uri: string;
32
+ }>]>;
33
+ export declare const mysql2credentials: import("zod").ZodUnion<[import("zod").ZodObject<{
34
+ host: import("zod").ZodString;
35
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
36
+ user: import("zod").ZodDefault<import("zod").ZodString>;
37
+ password: import("zod").ZodOptional<import("zod").ZodString>;
38
+ database: import("zod").ZodString;
39
+ }, "strip", import("zod").ZodTypeAny, {
40
+ port?: number | undefined;
41
+ password?: string | undefined;
42
+ host: string;
43
+ user: string;
44
+ database: string;
45
+ }, {
46
+ port?: number | undefined;
47
+ user?: string | undefined;
48
+ password?: string | undefined;
49
+ host: string;
50
+ database: string;
51
+ }>, import("zod").ZodObject<{
52
+ uri: import("zod").ZodString;
53
+ }, "strip", import("zod").ZodTypeAny, {
54
+ uri: string;
55
+ }, {
56
+ uri: string;
57
+ }>]>;
58
+ export declare const mysqlConnectionConfig: import("zod").ZodObject<{
59
+ driver: import("zod").ZodLiteral<"mysql2">;
60
+ dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
61
+ host: import("zod").ZodString;
62
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
63
+ user: import("zod").ZodDefault<import("zod").ZodString>;
64
+ password: import("zod").ZodOptional<import("zod").ZodString>;
65
+ database: import("zod").ZodString;
66
+ }, "strip", import("zod").ZodTypeAny, {
67
+ port?: number | undefined;
68
+ password?: string | undefined;
69
+ host: string;
70
+ user: string;
71
+ database: string;
72
+ }, {
73
+ port?: number | undefined;
74
+ user?: string | undefined;
75
+ password?: string | undefined;
76
+ host: string;
77
+ database: string;
78
+ }>, import("zod").ZodObject<{
79
+ uri: import("zod").ZodString;
80
+ }, "strip", import("zod").ZodTypeAny, {
81
+ uri: string;
82
+ }, {
83
+ uri: string;
84
+ }>]>;
85
+ }, "strip", import("zod").ZodTypeAny, {
86
+ driver: "mysql2";
87
+ dbCredentials: {
88
+ port?: number | undefined;
89
+ password?: string | undefined;
90
+ host: string;
91
+ user: string;
92
+ database: string;
93
+ } | {
94
+ uri: string;
95
+ };
96
+ }, {
97
+ driver: "mysql2";
98
+ dbCredentials: {
99
+ port?: number | undefined;
100
+ user?: string | undefined;
101
+ password?: string | undefined;
102
+ host: string;
103
+ database: string;
104
+ } | {
105
+ uri: string;
106
+ };
107
+ }>;
108
+ export declare const mysqlConfigIntrospectSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
109
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
110
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
111
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
112
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
113
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
114
+ introspect: import("zod").ZodDefault<import("zod").ZodObject<{
115
+ casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
116
+ }, "strip", import("zod").ZodTypeAny, {
117
+ casing: "camel" | "preserve";
118
+ }, {
119
+ casing?: "camel" | "preserve" | undefined;
120
+ }>>;
121
+ }, "strip", import("zod").ZodTypeAny, {
122
+ schema?: string | string[] | undefined;
123
+ tablesFilter?: string | string[] | undefined;
124
+ out: string;
125
+ breakpoints: boolean;
126
+ schemaFilter: string | string[];
127
+ introspect: {
128
+ casing: "camel" | "preserve";
129
+ };
130
+ }, {
131
+ schema?: string | string[] | undefined;
132
+ out?: string | undefined;
133
+ breakpoints?: boolean | undefined;
134
+ tablesFilter?: string | string[] | undefined;
135
+ schemaFilter?: string | string[] | undefined;
136
+ introspect?: {
137
+ casing?: "camel" | "preserve" | undefined;
138
+ } | undefined;
139
+ }>, import("zod").ZodObject<{
140
+ driver: import("zod").ZodLiteral<"mysql2">;
141
+ dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
142
+ host: import("zod").ZodString;
143
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
144
+ user: import("zod").ZodDefault<import("zod").ZodString>;
145
+ password: import("zod").ZodOptional<import("zod").ZodString>;
146
+ database: import("zod").ZodString;
147
+ }, "strip", import("zod").ZodTypeAny, {
148
+ port?: number | undefined;
149
+ password?: string | undefined;
150
+ host: string;
151
+ user: string;
152
+ database: string;
153
+ }, {
154
+ port?: number | undefined;
155
+ user?: string | undefined;
156
+ password?: string | undefined;
157
+ host: string;
158
+ database: string;
159
+ }>, import("zod").ZodObject<{
160
+ uri: import("zod").ZodString;
161
+ }, "strip", import("zod").ZodTypeAny, {
162
+ uri: string;
163
+ }, {
164
+ uri: string;
165
+ }>]>;
166
+ }, "strip", import("zod").ZodTypeAny, {
167
+ driver: "mysql2";
168
+ dbCredentials: {
169
+ port?: number | undefined;
170
+ password?: string | undefined;
171
+ host: string;
172
+ user: string;
173
+ database: string;
174
+ } | {
175
+ uri: string;
176
+ };
177
+ }, {
178
+ driver: "mysql2";
179
+ dbCredentials: {
180
+ port?: number | undefined;
181
+ user?: string | undefined;
182
+ password?: string | undefined;
183
+ host: string;
184
+ database: string;
185
+ } | {
186
+ uri: string;
187
+ };
188
+ }>>;
189
+ export declare const mysqlCliIntrospectParams: import("zod").ZodIntersection<import("zod").ZodObject<{
190
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
191
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
192
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
193
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
194
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
195
+ introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
196
+ }, "strip", import("zod").ZodTypeAny, {
197
+ schema?: string | string[] | undefined;
198
+ tablesFilter?: string | string[] | undefined;
199
+ out: string;
200
+ breakpoints: boolean;
201
+ schemaFilter: string | string[];
202
+ introspectCasing: "camel" | "preserve";
203
+ }, {
204
+ schema?: string | string[] | undefined;
205
+ out?: string | undefined;
206
+ breakpoints?: boolean | undefined;
207
+ tablesFilter?: string | string[] | undefined;
208
+ schemaFilter?: string | string[] | undefined;
209
+ introspectCasing?: "camel" | "preserve" | undefined;
210
+ }>, import("zod").ZodUnion<[import("zod").ZodObject<{
211
+ driver: import("zod").ZodLiteral<"mysql2">;
212
+ host: import("zod").ZodString;
213
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
214
+ user: import("zod").ZodDefault<import("zod").ZodString>;
215
+ password: import("zod").ZodOptional<import("zod").ZodString>;
216
+ database: import("zod").ZodString;
217
+ }, "strip", import("zod").ZodTypeAny, {
218
+ port?: number | undefined;
219
+ password?: string | undefined;
220
+ driver: "mysql2";
221
+ host: string;
222
+ user: string;
223
+ database: string;
224
+ }, {
225
+ port?: number | undefined;
226
+ user?: string | undefined;
227
+ password?: string | undefined;
228
+ driver: "mysql2";
229
+ host: string;
230
+ database: string;
231
+ }>, import("zod").ZodObject<{
232
+ driver: import("zod").ZodLiteral<"mysql2">;
233
+ uri: import("zod").ZodString;
234
+ }, "strip", import("zod").ZodTypeAny, {
235
+ driver: "mysql2";
236
+ uri: string;
237
+ }, {
238
+ driver: "mysql2";
239
+ uri: string;
240
+ }>]>>;
241
+ export declare const mysqlCliPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
242
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
243
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
244
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
245
+ verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
246
+ strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
247
+ }, "strip", import("zod").ZodTypeAny, {
248
+ tablesFilter?: string | string[] | undefined;
249
+ strict: boolean;
250
+ schema: string | string[];
251
+ schemaFilter: string | string[];
252
+ verbose: boolean;
253
+ }, {
254
+ strict?: boolean | undefined;
255
+ tablesFilter?: string | string[] | undefined;
256
+ schemaFilter?: string | string[] | undefined;
257
+ verbose?: boolean | undefined;
258
+ schema: string | string[];
259
+ }>, import("zod").ZodUnion<[import("zod").ZodObject<{
260
+ driver: import("zod").ZodLiteral<"mysql2">;
261
+ host: import("zod").ZodString;
262
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
263
+ user: import("zod").ZodDefault<import("zod").ZodString>;
264
+ password: import("zod").ZodOptional<import("zod").ZodString>;
265
+ database: import("zod").ZodString;
266
+ }, "strip", import("zod").ZodTypeAny, {
267
+ port?: number | undefined;
268
+ password?: string | undefined;
269
+ driver: "mysql2";
270
+ host: string;
271
+ user: string;
272
+ database: string;
273
+ }, {
274
+ port?: number | undefined;
275
+ user?: string | undefined;
276
+ password?: string | undefined;
277
+ driver: "mysql2";
278
+ host: string;
279
+ database: string;
280
+ }>, import("zod").ZodObject<{
281
+ driver: import("zod").ZodLiteral<"mysql2">;
282
+ uri: import("zod").ZodString;
283
+ }, "strip", import("zod").ZodTypeAny, {
284
+ driver: "mysql2";
285
+ uri: string;
286
+ }, {
287
+ driver: "mysql2";
288
+ uri: string;
289
+ }>]>>;
290
+ export declare const mysqlConfigPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
291
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
292
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
293
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
294
+ verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
295
+ strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
296
+ }, "strip", import("zod").ZodTypeAny, {
297
+ tablesFilter?: string | string[] | undefined;
298
+ strict: boolean;
299
+ schema: string | string[];
300
+ schemaFilter: string | string[];
301
+ verbose: boolean;
302
+ }, {
303
+ strict?: boolean | undefined;
304
+ tablesFilter?: string | string[] | undefined;
305
+ schemaFilter?: string | string[] | undefined;
306
+ verbose?: boolean | undefined;
307
+ schema: string | string[];
308
+ }>, import("zod").ZodObject<{
309
+ driver: import("zod").ZodLiteral<"mysql2">;
310
+ dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
311
+ host: import("zod").ZodString;
312
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
313
+ user: import("zod").ZodDefault<import("zod").ZodString>;
314
+ password: import("zod").ZodOptional<import("zod").ZodString>;
315
+ database: import("zod").ZodString;
316
+ }, "strip", import("zod").ZodTypeAny, {
317
+ port?: number | undefined;
318
+ password?: string | undefined;
319
+ host: string;
320
+ user: string;
321
+ database: string;
322
+ }, {
323
+ port?: number | undefined;
324
+ user?: string | undefined;
325
+ password?: string | undefined;
326
+ host: string;
327
+ database: string;
328
+ }>, import("zod").ZodObject<{
329
+ uri: import("zod").ZodString;
330
+ }, "strip", import("zod").ZodTypeAny, {
331
+ uri: string;
332
+ }, {
333
+ uri: string;
334
+ }>]>;
335
+ }, "strip", import("zod").ZodTypeAny, {
336
+ driver: "mysql2";
337
+ dbCredentials: {
338
+ port?: number | undefined;
339
+ password?: string | undefined;
340
+ host: string;
341
+ user: string;
342
+ database: string;
343
+ } | {
344
+ uri: string;
345
+ };
346
+ }, {
347
+ driver: "mysql2";
348
+ dbCredentials: {
349
+ port?: number | undefined;
350
+ user?: string | undefined;
351
+ password?: string | undefined;
352
+ host: string;
353
+ database: string;
354
+ } | {
355
+ uri: string;
356
+ };
357
+ }>>;
358
+ export type MySQLPushConfig = TypeOf<typeof mysqlConfigPushParams>;
359
+ export type MySQLConfigIntrospect = TypeOf<typeof mysqlConfigIntrospectSchema>;
360
+ export type MySQLCliIntrospect = TypeOf<typeof mysqlCliIntrospectParams>;
361
+ export type MySQLConnectionConfig = TypeOf<typeof mysqlConnectionConfig>;
362
+ export declare const printCliConnectionIssues: (options: any) => void;
363
+ export declare const printConfigConnectionIssues: (options: any) => void;
364
+ export declare const validateMySqlIntrospect: (options: Record<string, any>) => Promise<MySQLConfigIntrospect>;
365
+ export declare const validateMySqlPush: (options: Record<string, unknown>) => Promise<MySQLPushConfig>;
@@ -0,0 +1,40 @@
1
+ export declare const withStyle: {
2
+ error: (str: string) => string;
3
+ warning: (str: string) => string;
4
+ errorWarning: (str: string) => string;
5
+ fullWarning: (str: string) => string;
6
+ suggestion: (str: string) => string;
7
+ };
8
+ export declare const outputs: {
9
+ studio: {
10
+ drivers: (param: string) => string;
11
+ noCredentials: () => string;
12
+ noDriver: () => string;
13
+ };
14
+ common: {
15
+ ambiguousParams: (command: string) => string;
16
+ schema: (command: string) => string;
17
+ schemaConfig: (command: string) => string;
18
+ };
19
+ postgres: {
20
+ connection: {
21
+ driver: () => string;
22
+ required: () => string;
23
+ };
24
+ };
25
+ mysql: {
26
+ connection: {
27
+ driver: () => string;
28
+ required: () => string;
29
+ };
30
+ };
31
+ sqlite: {
32
+ connection: {
33
+ driver: () => string;
34
+ url: (driver: string) => string;
35
+ authToken: (driver: string) => string;
36
+ };
37
+ introspect: {};
38
+ push: {};
39
+ };
40
+ };