drizzle-kit 0.20.17-ff96495 → 0.20.18-08d50a4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/bin.cjs +34362 -27214
  2. package/index.d.mts +30 -60
  3. package/index.d.ts +30 -60
  4. package/package.json +21 -27
  5. package/payload.d.mts +1052 -18
  6. package/payload.d.ts +1052 -18
  7. package/payload.js +20595 -16389
  8. package/payload.mjs +20305 -16071
  9. package/utils-studio.js +41 -20
  10. package/utils-studio.mjs +41 -20
  11. package/utils.js +30 -14
  12. package/utils.mjs +30 -14
  13. package/@types/utils.d.ts +0 -12
  14. package/cli/commands/migrate.d.ts +0 -287
  15. package/cli/commands/mysqlIntrospect.d.ts +0 -50
  16. package/cli/commands/mysqlPushUtils.d.ts +0 -14
  17. package/cli/commands/pgIntrospect.d.ts +0 -59
  18. package/cli/commands/pgPushUtils.d.ts +0 -11
  19. package/cli/commands/sqliteIntrospect.d.ts +0 -103
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -58
  22. package/cli/connections.d.ts +0 -13
  23. package/cli/selector-ui.d.ts +0 -13
  24. package/cli/utils.d.ts +0 -13
  25. package/cli/validations/cli.d.ts +0 -169
  26. package/cli/validations/common.d.ts +0 -214
  27. package/cli/validations/mysql.d.ts +0 -29
  28. package/cli/validations/outputs.d.ts +0 -42
  29. package/cli/validations/pg.d.ts +0 -46
  30. package/cli/validations/sqlite.d.ts +0 -22
  31. package/cli/views.d.ts +0 -63
  32. package/global.d.ts +0 -6
  33. package/introspect-sqlite.d.ts +0 -10
  34. package/jsonDiffer.d.ts +0 -61
  35. package/jsonStatements.d.ts +0 -376
  36. package/migrationPreparator.d.ts +0 -35
  37. package/schemaValidator.d.ts +0 -1316
  38. package/serializer/index.d.ts +0 -9
  39. package/serializer/mysqlImports.d.ts +0 -7
  40. package/serializer/mysqlSchema.d.ts +0 -4650
  41. package/serializer/mysqlSerializer.d.ts +0 -7
  42. package/serializer/pgImports.d.ts +0 -11
  43. package/serializer/pgSchema.d.ts +0 -4792
  44. package/serializer/pgSerializer.d.ts +0 -7
  45. package/serializer/schemaToDrizzle.d.ts +0 -7
  46. package/serializer/sqliteImports.d.ts +0 -7
  47. package/serializer/sqliteSchema.d.ts +0 -2801
  48. package/serializer/sqliteSerializer.d.ts +0 -6
  49. package/serializer/studio.d.ts +0 -51
  50. package/snapshotsDiffer.d.ts +0 -3937
  51. package/sqlgenerator.d.ts +0 -33
  52. package/utils/words.d.ts +0 -7
  53. package/utils-studio.d.mts +0 -4
  54. package/utils-studio.d.ts +0 -4
  55. package/utils.d.ts +0 -78
package/payload.d.ts CHANGED
@@ -1,33 +1,1067 @@
1
- import { PgDatabase } from "drizzle-orm/pg-core";
2
- import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
3
- import { SQLiteSchema as SQLiteSchemaKit } from "./serializer/sqliteSchema";
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";
7
- export type DrizzleSnapshotJSON = PgSchemaKit;
8
- export type DrizzleSQLiteSnapshotJSON = SQLiteSchemaKit;
9
- export type DrizzleMySQLSnapshotJSON = MySQLSchemaKit;
10
- export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
11
- export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
12
- export declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
1
+ import { PgDatabase } from 'drizzle-orm/pg-core';
2
+ import * as zod from 'zod';
3
+ import { TypeOf } from 'zod';
4
+ import { MySql2Database } from 'drizzle-orm/mysql2';
5
+ import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
6
+
7
+ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
8
+ version: zod.ZodLiteral<"6">;
9
+ dialect: zod.ZodLiteral<"postgresql">;
10
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
11
+ name: zod.ZodString;
12
+ schema: zod.ZodString;
13
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
14
+ name: zod.ZodString;
15
+ type: zod.ZodString;
16
+ typeSchema: zod.ZodOptional<zod.ZodString>;
17
+ primaryKey: zod.ZodBoolean;
18
+ notNull: zod.ZodBoolean;
19
+ default: zod.ZodOptional<zod.ZodAny>;
20
+ isUnique: zod.ZodOptional<zod.ZodAny>;
21
+ uniqueName: zod.ZodOptional<zod.ZodString>;
22
+ nullsNotDistinct: zod.ZodOptional<zod.ZodBoolean>;
23
+ }, "strict", zod.ZodTypeAny, {
24
+ type: string;
25
+ name: string;
26
+ primaryKey: boolean;
27
+ notNull: boolean;
28
+ isUnique?: any;
29
+ default?: any;
30
+ typeSchema?: string | undefined;
31
+ uniqueName?: string | undefined;
32
+ nullsNotDistinct?: boolean | undefined;
33
+ }, {
34
+ type: string;
35
+ name: string;
36
+ primaryKey: boolean;
37
+ notNull: boolean;
38
+ isUnique?: any;
39
+ default?: any;
40
+ typeSchema?: string | undefined;
41
+ uniqueName?: string | undefined;
42
+ nullsNotDistinct?: boolean | undefined;
43
+ }>>;
44
+ indexes: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
45
+ name: zod.ZodString;
46
+ columns: zod.ZodArray<zod.ZodString, "many">;
47
+ isUnique: zod.ZodBoolean;
48
+ }, "strict", zod.ZodTypeAny, {
49
+ name: string;
50
+ columns: string[];
51
+ isUnique: boolean;
52
+ }, {
53
+ name: string;
54
+ columns: string[];
55
+ isUnique: boolean;
56
+ }>>;
57
+ foreignKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
58
+ name: zod.ZodString;
59
+ tableFrom: zod.ZodString;
60
+ columnsFrom: zod.ZodArray<zod.ZodString, "many">;
61
+ tableTo: zod.ZodString;
62
+ schemaTo: zod.ZodOptional<zod.ZodString>;
63
+ columnsTo: zod.ZodArray<zod.ZodString, "many">;
64
+ onUpdate: zod.ZodOptional<zod.ZodString>;
65
+ onDelete: zod.ZodOptional<zod.ZodString>;
66
+ }, "strict", zod.ZodTypeAny, {
67
+ name: string;
68
+ tableFrom: string;
69
+ columnsFrom: string[];
70
+ tableTo: string;
71
+ columnsTo: string[];
72
+ onUpdate?: string | undefined;
73
+ onDelete?: string | undefined;
74
+ schemaTo?: string | undefined;
75
+ }, {
76
+ name: string;
77
+ tableFrom: string;
78
+ columnsFrom: string[];
79
+ tableTo: string;
80
+ columnsTo: string[];
81
+ onUpdate?: string | undefined;
82
+ onDelete?: string | undefined;
83
+ schemaTo?: string | undefined;
84
+ }>>;
85
+ compositePrimaryKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
86
+ name: zod.ZodString;
87
+ columns: zod.ZodArray<zod.ZodString, "many">;
88
+ }, "strict", zod.ZodTypeAny, {
89
+ name: string;
90
+ columns: string[];
91
+ }, {
92
+ name: string;
93
+ columns: string[];
94
+ }>>;
95
+ uniqueConstraints: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
96
+ name: zod.ZodString;
97
+ columns: zod.ZodArray<zod.ZodString, "many">;
98
+ nullsNotDistinct: zod.ZodBoolean;
99
+ }, "strict", zod.ZodTypeAny, {
100
+ name: string;
101
+ columns: string[];
102
+ nullsNotDistinct: boolean;
103
+ }, {
104
+ name: string;
105
+ columns: string[];
106
+ nullsNotDistinct: boolean;
107
+ }>>>;
108
+ }, "strict", zod.ZodTypeAny, {
109
+ name: string;
110
+ columns: Record<string, {
111
+ type: string;
112
+ name: string;
113
+ primaryKey: boolean;
114
+ notNull: boolean;
115
+ isUnique?: any;
116
+ default?: any;
117
+ typeSchema?: string | undefined;
118
+ uniqueName?: string | undefined;
119
+ nullsNotDistinct?: boolean | undefined;
120
+ }>;
121
+ indexes: Record<string, {
122
+ name: string;
123
+ columns: string[];
124
+ isUnique: boolean;
125
+ }>;
126
+ foreignKeys: Record<string, {
127
+ name: string;
128
+ tableFrom: string;
129
+ columnsFrom: string[];
130
+ tableTo: string;
131
+ columnsTo: string[];
132
+ onUpdate?: string | undefined;
133
+ onDelete?: string | undefined;
134
+ schemaTo?: string | undefined;
135
+ }>;
136
+ schema: string;
137
+ compositePrimaryKeys: Record<string, {
138
+ name: string;
139
+ columns: string[];
140
+ }>;
141
+ uniqueConstraints: Record<string, {
142
+ name: string;
143
+ columns: string[];
144
+ nullsNotDistinct: boolean;
145
+ }>;
146
+ }, {
147
+ name: string;
148
+ columns: Record<string, {
149
+ type: string;
150
+ name: string;
151
+ primaryKey: boolean;
152
+ notNull: boolean;
153
+ isUnique?: any;
154
+ default?: any;
155
+ typeSchema?: string | undefined;
156
+ uniqueName?: string | undefined;
157
+ nullsNotDistinct?: boolean | undefined;
158
+ }>;
159
+ indexes: Record<string, {
160
+ name: string;
161
+ columns: string[];
162
+ isUnique: boolean;
163
+ }>;
164
+ foreignKeys: Record<string, {
165
+ name: string;
166
+ tableFrom: string;
167
+ columnsFrom: string[];
168
+ tableTo: string;
169
+ columnsTo: string[];
170
+ onUpdate?: string | undefined;
171
+ onDelete?: string | undefined;
172
+ schemaTo?: string | undefined;
173
+ }>;
174
+ schema: string;
175
+ compositePrimaryKeys: Record<string, {
176
+ name: string;
177
+ columns: string[];
178
+ }>;
179
+ uniqueConstraints?: Record<string, {
180
+ name: string;
181
+ columns: string[];
182
+ nullsNotDistinct: boolean;
183
+ }> | undefined;
184
+ }>>;
185
+ enums: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
186
+ name: zod.ZodString;
187
+ schema: zod.ZodString;
188
+ values: zod.ZodArray<zod.ZodString, "many">;
189
+ }, "strict", zod.ZodTypeAny, {
190
+ values: string[];
191
+ name: string;
192
+ schema: string;
193
+ }, {
194
+ values: string[];
195
+ name: string;
196
+ schema: string;
197
+ }>>;
198
+ schemas: zod.ZodRecord<zod.ZodString, zod.ZodString>;
199
+ _meta: zod.ZodObject<{
200
+ schemas: zod.ZodRecord<zod.ZodString, zod.ZodString>;
201
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
202
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodString>;
203
+ }, "strip", zod.ZodTypeAny, {
204
+ columns: Record<string, string>;
205
+ tables: Record<string, string>;
206
+ schemas: Record<string, string>;
207
+ }, {
208
+ columns: Record<string, string>;
209
+ tables: Record<string, string>;
210
+ schemas: Record<string, string>;
211
+ }>;
212
+ internal: zod.ZodOptional<zod.ZodObject<{
213
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodObject<{
214
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodObject<{
215
+ isArray: zod.ZodOptional<zod.ZodBoolean>;
216
+ dimensions: zod.ZodOptional<zod.ZodNumber>;
217
+ rawType: zod.ZodOptional<zod.ZodString>;
218
+ }, "strip", zod.ZodTypeAny, {
219
+ isArray?: boolean | undefined;
220
+ dimensions?: number | undefined;
221
+ rawType?: string | undefined;
222
+ }, {
223
+ isArray?: boolean | undefined;
224
+ dimensions?: number | undefined;
225
+ rawType?: string | undefined;
226
+ }>>>;
227
+ }, "strip", zod.ZodTypeAny, {
228
+ columns: Record<string, {
229
+ isArray?: boolean | undefined;
230
+ dimensions?: number | undefined;
231
+ rawType?: string | undefined;
232
+ } | undefined>;
233
+ }, {
234
+ columns: Record<string, {
235
+ isArray?: boolean | undefined;
236
+ dimensions?: number | undefined;
237
+ rawType?: string | undefined;
238
+ } | undefined>;
239
+ }>>>;
240
+ }, "strip", zod.ZodTypeAny, {
241
+ tables: Record<string, {
242
+ columns: Record<string, {
243
+ isArray?: boolean | undefined;
244
+ dimensions?: number | undefined;
245
+ rawType?: string | undefined;
246
+ } | undefined>;
247
+ } | undefined>;
248
+ }, {
249
+ tables: Record<string, {
250
+ columns: Record<string, {
251
+ isArray?: boolean | undefined;
252
+ dimensions?: number | undefined;
253
+ rawType?: string | undefined;
254
+ } | undefined>;
255
+ } | undefined>;
256
+ }>>;
257
+ }, {
258
+ id: zod.ZodString;
259
+ prevId: zod.ZodString;
260
+ }>, "strip", zod.ZodTypeAny, {
261
+ tables: Record<string, {
262
+ name: string;
263
+ columns: Record<string, {
264
+ type: string;
265
+ name: string;
266
+ primaryKey: boolean;
267
+ notNull: boolean;
268
+ isUnique?: any;
269
+ default?: any;
270
+ typeSchema?: string | undefined;
271
+ uniqueName?: string | undefined;
272
+ nullsNotDistinct?: boolean | undefined;
273
+ }>;
274
+ indexes: Record<string, {
275
+ name: string;
276
+ columns: string[];
277
+ isUnique: boolean;
278
+ }>;
279
+ foreignKeys: Record<string, {
280
+ name: string;
281
+ tableFrom: string;
282
+ columnsFrom: string[];
283
+ tableTo: string;
284
+ columnsTo: string[];
285
+ onUpdate?: string | undefined;
286
+ onDelete?: string | undefined;
287
+ schemaTo?: string | undefined;
288
+ }>;
289
+ schema: string;
290
+ compositePrimaryKeys: Record<string, {
291
+ name: string;
292
+ columns: string[];
293
+ }>;
294
+ uniqueConstraints: Record<string, {
295
+ name: string;
296
+ columns: string[];
297
+ nullsNotDistinct: boolean;
298
+ }>;
299
+ }>;
300
+ id: string;
301
+ prevId: string;
302
+ version: "6";
303
+ dialect: "postgresql";
304
+ schemas: Record<string, string>;
305
+ _meta: {
306
+ columns: Record<string, string>;
307
+ tables: Record<string, string>;
308
+ schemas: Record<string, string>;
309
+ };
310
+ enums: Record<string, {
311
+ values: string[];
312
+ name: string;
313
+ schema: string;
314
+ }>;
315
+ internal?: {
316
+ tables: Record<string, {
317
+ columns: Record<string, {
318
+ isArray?: boolean | undefined;
319
+ dimensions?: number | undefined;
320
+ rawType?: string | undefined;
321
+ } | undefined>;
322
+ } | undefined>;
323
+ } | undefined;
324
+ }, {
325
+ tables: Record<string, {
326
+ name: string;
327
+ columns: Record<string, {
328
+ type: string;
329
+ name: string;
330
+ primaryKey: boolean;
331
+ notNull: boolean;
332
+ isUnique?: any;
333
+ default?: any;
334
+ typeSchema?: string | undefined;
335
+ uniqueName?: string | undefined;
336
+ nullsNotDistinct?: boolean | undefined;
337
+ }>;
338
+ indexes: Record<string, {
339
+ name: string;
340
+ columns: string[];
341
+ isUnique: boolean;
342
+ }>;
343
+ foreignKeys: Record<string, {
344
+ name: string;
345
+ tableFrom: string;
346
+ columnsFrom: string[];
347
+ tableTo: string;
348
+ columnsTo: string[];
349
+ onUpdate?: string | undefined;
350
+ onDelete?: string | undefined;
351
+ schemaTo?: string | undefined;
352
+ }>;
353
+ schema: string;
354
+ compositePrimaryKeys: Record<string, {
355
+ name: string;
356
+ columns: string[];
357
+ }>;
358
+ uniqueConstraints?: Record<string, {
359
+ name: string;
360
+ columns: string[];
361
+ nullsNotDistinct: boolean;
362
+ }> | undefined;
363
+ }>;
364
+ id: string;
365
+ prevId: string;
366
+ version: "6";
367
+ dialect: "postgresql";
368
+ schemas: Record<string, string>;
369
+ _meta: {
370
+ columns: Record<string, string>;
371
+ tables: Record<string, string>;
372
+ schemas: Record<string, string>;
373
+ };
374
+ enums: Record<string, {
375
+ values: string[];
376
+ name: string;
377
+ schema: string;
378
+ }>;
379
+ internal?: {
380
+ tables: Record<string, {
381
+ columns: Record<string, {
382
+ isArray?: boolean | undefined;
383
+ dimensions?: number | undefined;
384
+ rawType?: string | undefined;
385
+ } | undefined>;
386
+ } | undefined>;
387
+ } | undefined;
388
+ }>;
389
+ type PgSchema = TypeOf<typeof pgSchema>;
390
+
391
+ declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
392
+ version: zod.ZodLiteral<"6">;
393
+ dialect: zod.ZodEnum<["sqlite"]>;
394
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
395
+ name: zod.ZodString;
396
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
397
+ name: zod.ZodString;
398
+ type: zod.ZodString;
399
+ primaryKey: zod.ZodBoolean;
400
+ notNull: zod.ZodBoolean;
401
+ autoincrement: zod.ZodOptional<zod.ZodBoolean>;
402
+ default: zod.ZodOptional<zod.ZodAny>;
403
+ }, "strict", zod.ZodTypeAny, {
404
+ type: string;
405
+ name: string;
406
+ primaryKey: boolean;
407
+ notNull: boolean;
408
+ default?: any;
409
+ autoincrement?: boolean | undefined;
410
+ }, {
411
+ type: string;
412
+ name: string;
413
+ primaryKey: boolean;
414
+ notNull: boolean;
415
+ default?: any;
416
+ autoincrement?: boolean | undefined;
417
+ }>>;
418
+ indexes: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
419
+ name: zod.ZodString;
420
+ columns: zod.ZodArray<zod.ZodString, "many">;
421
+ where: zod.ZodOptional<zod.ZodString>;
422
+ isUnique: zod.ZodBoolean;
423
+ }, "strict", zod.ZodTypeAny, {
424
+ name: string;
425
+ columns: string[];
426
+ isUnique: boolean;
427
+ where?: string | undefined;
428
+ }, {
429
+ name: string;
430
+ columns: string[];
431
+ isUnique: boolean;
432
+ where?: string | undefined;
433
+ }>>;
434
+ foreignKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
435
+ name: zod.ZodString;
436
+ tableFrom: zod.ZodString;
437
+ columnsFrom: zod.ZodArray<zod.ZodString, "many">;
438
+ tableTo: zod.ZodString;
439
+ columnsTo: zod.ZodArray<zod.ZodString, "many">;
440
+ onUpdate: zod.ZodOptional<zod.ZodString>;
441
+ onDelete: zod.ZodOptional<zod.ZodString>;
442
+ }, "strict", zod.ZodTypeAny, {
443
+ name: string;
444
+ tableFrom: string;
445
+ columnsFrom: string[];
446
+ tableTo: string;
447
+ columnsTo: string[];
448
+ onUpdate?: string | undefined;
449
+ onDelete?: string | undefined;
450
+ }, {
451
+ name: string;
452
+ tableFrom: string;
453
+ columnsFrom: string[];
454
+ tableTo: string;
455
+ columnsTo: string[];
456
+ onUpdate?: string | undefined;
457
+ onDelete?: string | undefined;
458
+ }>>;
459
+ compositePrimaryKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
460
+ columns: zod.ZodArray<zod.ZodString, "many">;
461
+ name: zod.ZodOptional<zod.ZodString>;
462
+ }, "strict", zod.ZodTypeAny, {
463
+ columns: string[];
464
+ name?: string | undefined;
465
+ }, {
466
+ columns: string[];
467
+ name?: string | undefined;
468
+ }>>;
469
+ uniqueConstraints: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
470
+ name: zod.ZodString;
471
+ columns: zod.ZodArray<zod.ZodString, "many">;
472
+ }, "strict", zod.ZodTypeAny, {
473
+ name: string;
474
+ columns: string[];
475
+ }, {
476
+ name: string;
477
+ columns: string[];
478
+ }>>>;
479
+ }, "strict", zod.ZodTypeAny, {
480
+ name: string;
481
+ columns: Record<string, {
482
+ type: string;
483
+ name: string;
484
+ primaryKey: boolean;
485
+ notNull: boolean;
486
+ default?: any;
487
+ autoincrement?: boolean | undefined;
488
+ }>;
489
+ indexes: Record<string, {
490
+ name: string;
491
+ columns: string[];
492
+ isUnique: boolean;
493
+ where?: string | undefined;
494
+ }>;
495
+ foreignKeys: Record<string, {
496
+ name: string;
497
+ tableFrom: string;
498
+ columnsFrom: string[];
499
+ tableTo: string;
500
+ columnsTo: string[];
501
+ onUpdate?: string | undefined;
502
+ onDelete?: string | undefined;
503
+ }>;
504
+ compositePrimaryKeys: Record<string, {
505
+ columns: string[];
506
+ name?: string | undefined;
507
+ }>;
508
+ uniqueConstraints: Record<string, {
509
+ name: string;
510
+ columns: string[];
511
+ }>;
512
+ }, {
513
+ name: string;
514
+ columns: Record<string, {
515
+ type: string;
516
+ name: string;
517
+ primaryKey: boolean;
518
+ notNull: boolean;
519
+ default?: any;
520
+ autoincrement?: boolean | undefined;
521
+ }>;
522
+ indexes: Record<string, {
523
+ name: string;
524
+ columns: string[];
525
+ isUnique: boolean;
526
+ where?: string | undefined;
527
+ }>;
528
+ foreignKeys: Record<string, {
529
+ name: string;
530
+ tableFrom: string;
531
+ columnsFrom: string[];
532
+ tableTo: string;
533
+ columnsTo: string[];
534
+ onUpdate?: string | undefined;
535
+ onDelete?: string | undefined;
536
+ }>;
537
+ compositePrimaryKeys: Record<string, {
538
+ columns: string[];
539
+ name?: string | undefined;
540
+ }>;
541
+ uniqueConstraints?: Record<string, {
542
+ name: string;
543
+ columns: string[];
544
+ }> | undefined;
545
+ }>>;
546
+ enums: zod.ZodObject<{}, "strip", zod.ZodTypeAny, {}, {}>;
547
+ _meta: zod.ZodObject<{
548
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
549
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodString>;
550
+ }, "strip", zod.ZodTypeAny, {
551
+ columns: Record<string, string>;
552
+ tables: Record<string, string>;
553
+ }, {
554
+ columns: Record<string, string>;
555
+ tables: Record<string, string>;
556
+ }>;
557
+ }, {
558
+ id: zod.ZodString;
559
+ prevId: zod.ZodString;
560
+ }>, "strict", zod.ZodTypeAny, {
561
+ tables: Record<string, {
562
+ name: string;
563
+ columns: Record<string, {
564
+ type: string;
565
+ name: string;
566
+ primaryKey: boolean;
567
+ notNull: boolean;
568
+ default?: any;
569
+ autoincrement?: boolean | undefined;
570
+ }>;
571
+ indexes: Record<string, {
572
+ name: string;
573
+ columns: string[];
574
+ isUnique: boolean;
575
+ where?: string | undefined;
576
+ }>;
577
+ foreignKeys: Record<string, {
578
+ name: string;
579
+ tableFrom: string;
580
+ columnsFrom: string[];
581
+ tableTo: string;
582
+ columnsTo: string[];
583
+ onUpdate?: string | undefined;
584
+ onDelete?: string | undefined;
585
+ }>;
586
+ compositePrimaryKeys: Record<string, {
587
+ columns: string[];
588
+ name?: string | undefined;
589
+ }>;
590
+ uniqueConstraints: Record<string, {
591
+ name: string;
592
+ columns: string[];
593
+ }>;
594
+ }>;
595
+ id: string;
596
+ prevId: string;
597
+ version: "6";
598
+ dialect: "sqlite";
599
+ _meta: {
600
+ columns: Record<string, string>;
601
+ tables: Record<string, string>;
602
+ };
603
+ enums: {};
604
+ }, {
605
+ tables: Record<string, {
606
+ name: string;
607
+ columns: Record<string, {
608
+ type: string;
609
+ name: string;
610
+ primaryKey: boolean;
611
+ notNull: boolean;
612
+ default?: any;
613
+ autoincrement?: boolean | undefined;
614
+ }>;
615
+ indexes: Record<string, {
616
+ name: string;
617
+ columns: string[];
618
+ isUnique: boolean;
619
+ where?: string | undefined;
620
+ }>;
621
+ foreignKeys: Record<string, {
622
+ name: string;
623
+ tableFrom: string;
624
+ columnsFrom: string[];
625
+ tableTo: string;
626
+ columnsTo: string[];
627
+ onUpdate?: string | undefined;
628
+ onDelete?: string | undefined;
629
+ }>;
630
+ compositePrimaryKeys: Record<string, {
631
+ columns: string[];
632
+ name?: string | undefined;
633
+ }>;
634
+ uniqueConstraints?: Record<string, {
635
+ name: string;
636
+ columns: string[];
637
+ }> | undefined;
638
+ }>;
639
+ id: string;
640
+ prevId: string;
641
+ version: "6";
642
+ dialect: "sqlite";
643
+ _meta: {
644
+ columns: Record<string, string>;
645
+ tables: Record<string, string>;
646
+ };
647
+ enums: {};
648
+ }>;
649
+ type SQLiteSchema = TypeOf<typeof schema$1>;
650
+
651
+ declare const schema: zod.ZodObject<zod.objectUtil.extendShape<{
652
+ version: zod.ZodLiteral<"5">;
653
+ dialect: zod.ZodLiteral<"mysql">;
654
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
655
+ name: zod.ZodString;
656
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
657
+ name: zod.ZodString;
658
+ type: zod.ZodString;
659
+ primaryKey: zod.ZodBoolean;
660
+ notNull: zod.ZodBoolean;
661
+ autoincrement: zod.ZodOptional<zod.ZodBoolean>;
662
+ default: zod.ZodOptional<zod.ZodAny>;
663
+ onUpdate: zod.ZodOptional<zod.ZodAny>;
664
+ }, "strict", zod.ZodTypeAny, {
665
+ type: string;
666
+ name: string;
667
+ primaryKey: boolean;
668
+ notNull: boolean;
669
+ default?: any;
670
+ onUpdate?: any;
671
+ autoincrement?: boolean | undefined;
672
+ }, {
673
+ type: string;
674
+ name: string;
675
+ primaryKey: boolean;
676
+ notNull: boolean;
677
+ default?: any;
678
+ onUpdate?: any;
679
+ autoincrement?: boolean | undefined;
680
+ }>>;
681
+ indexes: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
682
+ name: zod.ZodString;
683
+ columns: zod.ZodArray<zod.ZodString, "many">;
684
+ isUnique: zod.ZodBoolean;
685
+ using: zod.ZodOptional<zod.ZodEnum<["btree", "hash"]>>;
686
+ algorithm: zod.ZodOptional<zod.ZodEnum<["default", "inplace", "copy"]>>;
687
+ lock: zod.ZodOptional<zod.ZodEnum<["default", "none", "shared", "exclusive"]>>;
688
+ }, "strict", zod.ZodTypeAny, {
689
+ name: string;
690
+ columns: string[];
691
+ isUnique: boolean;
692
+ using?: "btree" | "hash" | undefined;
693
+ algorithm?: "default" | "inplace" | "copy" | undefined;
694
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
695
+ }, {
696
+ name: string;
697
+ columns: string[];
698
+ isUnique: boolean;
699
+ using?: "btree" | "hash" | undefined;
700
+ algorithm?: "default" | "inplace" | "copy" | undefined;
701
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
702
+ }>>;
703
+ foreignKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
704
+ name: zod.ZodString;
705
+ tableFrom: zod.ZodString;
706
+ columnsFrom: zod.ZodArray<zod.ZodString, "many">;
707
+ tableTo: zod.ZodString;
708
+ columnsTo: zod.ZodArray<zod.ZodString, "many">;
709
+ onUpdate: zod.ZodOptional<zod.ZodString>;
710
+ onDelete: zod.ZodOptional<zod.ZodString>;
711
+ }, "strict", zod.ZodTypeAny, {
712
+ name: string;
713
+ tableFrom: string;
714
+ columnsFrom: string[];
715
+ tableTo: string;
716
+ columnsTo: string[];
717
+ onUpdate?: string | undefined;
718
+ onDelete?: string | undefined;
719
+ }, {
720
+ name: string;
721
+ tableFrom: string;
722
+ columnsFrom: string[];
723
+ tableTo: string;
724
+ columnsTo: string[];
725
+ onUpdate?: string | undefined;
726
+ onDelete?: string | undefined;
727
+ }>>;
728
+ compositePrimaryKeys: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
729
+ name: zod.ZodString;
730
+ columns: zod.ZodArray<zod.ZodString, "many">;
731
+ }, "strict", zod.ZodTypeAny, {
732
+ name: string;
733
+ columns: string[];
734
+ }, {
735
+ name: string;
736
+ columns: string[];
737
+ }>>;
738
+ uniqueConstraints: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
739
+ name: zod.ZodString;
740
+ columns: zod.ZodArray<zod.ZodString, "many">;
741
+ }, "strict", zod.ZodTypeAny, {
742
+ name: string;
743
+ columns: string[];
744
+ }, {
745
+ name: string;
746
+ columns: string[];
747
+ }>>>;
748
+ }, "strict", zod.ZodTypeAny, {
749
+ name: string;
750
+ columns: Record<string, {
751
+ type: string;
752
+ name: string;
753
+ primaryKey: boolean;
754
+ notNull: boolean;
755
+ default?: any;
756
+ onUpdate?: any;
757
+ autoincrement?: boolean | undefined;
758
+ }>;
759
+ indexes: Record<string, {
760
+ name: string;
761
+ columns: string[];
762
+ isUnique: boolean;
763
+ using?: "btree" | "hash" | undefined;
764
+ algorithm?: "default" | "inplace" | "copy" | undefined;
765
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
766
+ }>;
767
+ foreignKeys: Record<string, {
768
+ name: string;
769
+ tableFrom: string;
770
+ columnsFrom: string[];
771
+ tableTo: string;
772
+ columnsTo: string[];
773
+ onUpdate?: string | undefined;
774
+ onDelete?: string | undefined;
775
+ }>;
776
+ compositePrimaryKeys: Record<string, {
777
+ name: string;
778
+ columns: string[];
779
+ }>;
780
+ uniqueConstraints: Record<string, {
781
+ name: string;
782
+ columns: string[];
783
+ }>;
784
+ }, {
785
+ name: string;
786
+ columns: Record<string, {
787
+ type: string;
788
+ name: string;
789
+ primaryKey: boolean;
790
+ notNull: boolean;
791
+ default?: any;
792
+ onUpdate?: any;
793
+ autoincrement?: boolean | undefined;
794
+ }>;
795
+ indexes: Record<string, {
796
+ name: string;
797
+ columns: string[];
798
+ isUnique: boolean;
799
+ using?: "btree" | "hash" | undefined;
800
+ algorithm?: "default" | "inplace" | "copy" | undefined;
801
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
802
+ }>;
803
+ foreignKeys: Record<string, {
804
+ name: string;
805
+ tableFrom: string;
806
+ columnsFrom: string[];
807
+ tableTo: string;
808
+ columnsTo: string[];
809
+ onUpdate?: string | undefined;
810
+ onDelete?: string | undefined;
811
+ }>;
812
+ compositePrimaryKeys: Record<string, {
813
+ name: string;
814
+ columns: string[];
815
+ }>;
816
+ uniqueConstraints?: Record<string, {
817
+ name: string;
818
+ columns: string[];
819
+ }> | undefined;
820
+ }>>;
821
+ _meta: zod.ZodObject<{
822
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
823
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodString>;
824
+ }, "strip", zod.ZodTypeAny, {
825
+ columns: Record<string, string>;
826
+ tables: Record<string, string>;
827
+ }, {
828
+ columns: Record<string, string>;
829
+ tables: Record<string, string>;
830
+ }>;
831
+ internal: zod.ZodOptional<zod.ZodObject<{
832
+ tables: zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodObject<{
833
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodOptional<zod.ZodObject<{
834
+ isDefaultAnExpression: zod.ZodOptional<zod.ZodBoolean>;
835
+ }, "strip", zod.ZodTypeAny, {
836
+ isDefaultAnExpression?: boolean | undefined;
837
+ }, {
838
+ isDefaultAnExpression?: boolean | undefined;
839
+ }>>>;
840
+ }, "strip", zod.ZodTypeAny, {
841
+ columns: Record<string, {
842
+ isDefaultAnExpression?: boolean | undefined;
843
+ } | undefined>;
844
+ }, {
845
+ columns: Record<string, {
846
+ isDefaultAnExpression?: boolean | undefined;
847
+ } | undefined>;
848
+ }>>>;
849
+ }, "strip", zod.ZodTypeAny, {
850
+ tables: Record<string, {
851
+ columns: Record<string, {
852
+ isDefaultAnExpression?: boolean | undefined;
853
+ } | undefined>;
854
+ } | undefined>;
855
+ }, {
856
+ tables: Record<string, {
857
+ columns: Record<string, {
858
+ isDefaultAnExpression?: boolean | undefined;
859
+ } | undefined>;
860
+ } | undefined>;
861
+ }>>;
862
+ }, {
863
+ id: zod.ZodString;
864
+ prevId: zod.ZodString;
865
+ }>, "strip", zod.ZodTypeAny, {
866
+ tables: Record<string, {
867
+ name: string;
868
+ columns: Record<string, {
869
+ type: string;
870
+ name: string;
871
+ primaryKey: boolean;
872
+ notNull: boolean;
873
+ default?: any;
874
+ onUpdate?: any;
875
+ autoincrement?: boolean | undefined;
876
+ }>;
877
+ indexes: Record<string, {
878
+ name: string;
879
+ columns: string[];
880
+ isUnique: boolean;
881
+ using?: "btree" | "hash" | undefined;
882
+ algorithm?: "default" | "inplace" | "copy" | undefined;
883
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
884
+ }>;
885
+ foreignKeys: Record<string, {
886
+ name: string;
887
+ tableFrom: string;
888
+ columnsFrom: string[];
889
+ tableTo: string;
890
+ columnsTo: string[];
891
+ onUpdate?: string | undefined;
892
+ onDelete?: string | undefined;
893
+ }>;
894
+ compositePrimaryKeys: Record<string, {
895
+ name: string;
896
+ columns: string[];
897
+ }>;
898
+ uniqueConstraints: Record<string, {
899
+ name: string;
900
+ columns: string[];
901
+ }>;
902
+ }>;
903
+ id: string;
904
+ prevId: string;
905
+ version: "5";
906
+ dialect: "mysql";
907
+ _meta: {
908
+ columns: Record<string, string>;
909
+ tables: Record<string, string>;
910
+ };
911
+ internal?: {
912
+ tables: Record<string, {
913
+ columns: Record<string, {
914
+ isDefaultAnExpression?: boolean | undefined;
915
+ } | undefined>;
916
+ } | undefined>;
917
+ } | undefined;
918
+ }, {
919
+ tables: Record<string, {
920
+ name: string;
921
+ columns: Record<string, {
922
+ type: string;
923
+ name: string;
924
+ primaryKey: boolean;
925
+ notNull: boolean;
926
+ default?: any;
927
+ onUpdate?: any;
928
+ autoincrement?: boolean | undefined;
929
+ }>;
930
+ indexes: Record<string, {
931
+ name: string;
932
+ columns: string[];
933
+ isUnique: boolean;
934
+ using?: "btree" | "hash" | undefined;
935
+ algorithm?: "default" | "inplace" | "copy" | undefined;
936
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
937
+ }>;
938
+ foreignKeys: Record<string, {
939
+ name: string;
940
+ tableFrom: string;
941
+ columnsFrom: string[];
942
+ tableTo: string;
943
+ columnsTo: string[];
944
+ onUpdate?: string | undefined;
945
+ onDelete?: string | undefined;
946
+ }>;
947
+ compositePrimaryKeys: Record<string, {
948
+ name: string;
949
+ columns: string[];
950
+ }>;
951
+ uniqueConstraints?: Record<string, {
952
+ name: string;
953
+ columns: string[];
954
+ }> | undefined;
955
+ }>;
956
+ id: string;
957
+ prevId: string;
958
+ version: "5";
959
+ dialect: "mysql";
960
+ _meta: {
961
+ columns: Record<string, string>;
962
+ tables: Record<string, string>;
963
+ };
964
+ internal?: {
965
+ tables: Record<string, {
966
+ columns: Record<string, {
967
+ isDefaultAnExpression?: boolean | undefined;
968
+ } | undefined>;
969
+ } | undefined>;
970
+ } | undefined;
971
+ }>;
972
+ type MySqlSchema = TypeOf<typeof schema>;
973
+
974
+ type DrizzleSnapshotJSON = PgSchema;
975
+ type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
976
+ type DrizzleMySQLSnapshotJSON = MySqlSchema;
977
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchema;
978
+ declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
979
+ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
13
980
  hasDataLoss: boolean;
14
981
  warnings: string[];
15
982
  statementsToExecute: string[];
16
983
  apply: () => Promise<void>;
17
984
  }>;
18
- export declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchemaKit>;
19
- export declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
20
- export declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
985
+ declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
986
+ declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
987
+ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
21
988
  hasDataLoss: boolean;
22
989
  warnings: string[];
23
990
  statementsToExecute: string[];
24
991
  apply: () => Promise<void>;
25
992
  }>;
26
- export declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySQLSchemaKit>;
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<{
993
+ declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySqlSchema>;
994
+ declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
995
+ declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
29
996
  hasDataLoss: boolean;
30
997
  warnings: string[];
31
998
  statementsToExecute: string[];
32
999
  apply: () => Promise<void>;
33
1000
  }>;
1001
+ declare const upPgSnapshot: (snapshot: Record<string, unknown>) => {
1002
+ version: "6";
1003
+ dialect: "postgresql";
1004
+ tables: Record<string, {
1005
+ name: string;
1006
+ schema: string;
1007
+ columns: Record<string, {
1008
+ type: string;
1009
+ name: string;
1010
+ primaryKey: boolean;
1011
+ notNull: boolean;
1012
+ typeSchema?: string | undefined;
1013
+ default?: any;
1014
+ isUnique?: any;
1015
+ uniqueName?: string | undefined;
1016
+ nullsNotDistinct?: boolean | undefined;
1017
+ }>;
1018
+ indexes: Record<string, {
1019
+ name: string;
1020
+ columns: string[];
1021
+ isUnique: boolean;
1022
+ }>;
1023
+ foreignKeys: Record<string, {
1024
+ name: string;
1025
+ tableFrom: string;
1026
+ columnsFrom: string[];
1027
+ tableTo: string;
1028
+ columnsTo: string[];
1029
+ schemaTo?: string | undefined;
1030
+ onUpdate?: string | undefined;
1031
+ onDelete?: string | undefined;
1032
+ }>;
1033
+ compositePrimaryKeys: Record<string, {
1034
+ name: string;
1035
+ columns: string[];
1036
+ }>;
1037
+ uniqueConstraints: Record<string, {
1038
+ name: string;
1039
+ columns: string[];
1040
+ nullsNotDistinct: boolean;
1041
+ }>;
1042
+ }>;
1043
+ enums: Record<string, {
1044
+ values: string[];
1045
+ name: string;
1046
+ schema: string;
1047
+ }>;
1048
+ schemas: Record<string, string>;
1049
+ _meta: {
1050
+ tables: Record<string, string>;
1051
+ columns: Record<string, string>;
1052
+ schemas: Record<string, string>;
1053
+ };
1054
+ id: string;
1055
+ prevId: string;
1056
+ internal?: {
1057
+ tables: Record<string, {
1058
+ columns: Record<string, {
1059
+ isArray?: boolean | undefined;
1060
+ dimensions?: number | undefined;
1061
+ rawType?: string | undefined;
1062
+ } | undefined>;
1063
+ } | undefined>;
1064
+ } | undefined;
1065
+ };
1066
+
1067
+ export { type DrizzleMySQLSnapshotJSON, type DrizzleSQLiteSnapshotJSON, type DrizzleSnapshotJSON, generateDrizzleJson, generateMigration, generateMySQLDrizzleJson, generateMySQLMigration, generateSQLiteDrizzleJson, generateSQLiteMigration, pushMySQLSchema, pushSQLiteSchema, pushSchema, upPgSnapshot };