drizzle-kit 0.20.14-a77266f → 0.20.14-d8f1e46

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