frg-data-diff 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +628 -0
  2. package/dist/apply/apply-diff.d.ts +24 -0
  3. package/dist/apply/apply-diff.js +205 -0
  4. package/dist/apply/conflict.d.ts +20 -0
  5. package/dist/apply/conflict.js +14 -0
  6. package/dist/apply/plan.d.ts +13 -0
  7. package/dist/apply/plan.js +37 -0
  8. package/dist/cli/apply.d.ts +8 -0
  9. package/dist/cli/apply.js +270 -0
  10. package/dist/cli/generator.d.ts +9 -0
  11. package/dist/cli/generator.js +804 -0
  12. package/dist/cli/pg-triggers.d.ts +2 -0
  13. package/dist/cli/pg-triggers.js +185 -0
  14. package/dist/cli/root.d.ts +8 -0
  15. package/dist/cli/root.js +231 -0
  16. package/dist/cli/sql.d.ts +9 -0
  17. package/dist/cli/sql.js +158 -0
  18. package/dist/config/config-schema.d.ts +380 -0
  19. package/dist/config/config-schema.js +95 -0
  20. package/dist/config/load-config.d.ts +12 -0
  21. package/dist/config/load-config.js +87 -0
  22. package/dist/config/resolve-options.d.ts +95 -0
  23. package/dist/config/resolve-options.js +183 -0
  24. package/dist/config/write-config.d.ts +18 -0
  25. package/dist/config/write-config.js +103 -0
  26. package/dist/db/connection.d.ts +28 -0
  27. package/dist/db/connection.js +34 -0
  28. package/dist/db/metadata.d.ts +70 -0
  29. package/dist/db/metadata.js +238 -0
  30. package/dist/db/pg-triggers.d.ts +27 -0
  31. package/dist/db/pg-triggers.js +59 -0
  32. package/dist/db/sql.d.ts +72 -0
  33. package/dist/db/sql.js +250 -0
  34. package/dist/diff/diff-schema.d.ts +380 -0
  35. package/dist/diff/diff-schema.js +67 -0
  36. package/dist/diff/generate-diff.d.ts +20 -0
  37. package/dist/diff/generate-diff.js +224 -0
  38. package/dist/diff/pg-triggers-diff.d.ts +11 -0
  39. package/dist/diff/pg-triggers-diff.js +161 -0
  40. package/dist/diff/serialize-value.d.ts +35 -0
  41. package/dist/diff/serialize-value.js +242 -0
  42. package/dist/diff/write-diff-yaml.d.ts +3 -0
  43. package/dist/diff/write-diff-yaml.js +48 -0
  44. package/dist/schema-diff/generate-schema-diff.d.ts +12 -0
  45. package/dist/schema-diff/generate-schema-diff.js +355 -0
  46. package/dist/schema-diff/generate-schema-sql.d.ts +20 -0
  47. package/dist/schema-diff/generate-schema-sql.js +187 -0
  48. package/dist/schema-diff/schema-diff-schema.d.ts +1088 -0
  49. package/dist/schema-diff/schema-diff-schema.js +70 -0
  50. package/dist/shared/env-values.d.ts +11 -0
  51. package/dist/shared/env-values.js +100 -0
  52. package/dist/shared/generator-wizard.d.ts +10 -0
  53. package/dist/shared/generator-wizard.js +337 -0
  54. package/dist/shared/identifiers.d.ts +24 -0
  55. package/dist/shared/identifiers.js +45 -0
  56. package/dist/shared/prompts.d.ts +26 -0
  57. package/dist/shared/prompts.js +104 -0
  58. package/dist/shared/summary.d.ts +33 -0
  59. package/dist/shared/summary.js +41 -0
  60. package/dist/sql/generate-sql.d.ts +19 -0
  61. package/dist/sql/generate-sql.js +223 -0
  62. package/package.json +39 -0
@@ -0,0 +1,1088 @@
1
+ import { z } from "zod";
2
+ declare const schemaColumnDefinitionSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ type: z.ZodString;
5
+ nullable: z.ZodBoolean;
6
+ default: z.ZodNullable<z.ZodString>;
7
+ isGenerated: z.ZodBoolean;
8
+ generationExpression: z.ZodNullable<z.ZodString>;
9
+ ordinalPosition: z.ZodNumber;
10
+ }, "strip", z.ZodTypeAny, {
11
+ type: string;
12
+ default: string | null;
13
+ name: string;
14
+ nullable: boolean;
15
+ isGenerated: boolean;
16
+ generationExpression: string | null;
17
+ ordinalPosition: number;
18
+ }, {
19
+ type: string;
20
+ default: string | null;
21
+ name: string;
22
+ nullable: boolean;
23
+ isGenerated: boolean;
24
+ generationExpression: string | null;
25
+ ordinalPosition: number;
26
+ }>;
27
+ declare const schemaColumnChangeSchema: z.ZodObject<{
28
+ column: z.ZodString;
29
+ from: z.ZodObject<{
30
+ name: z.ZodString;
31
+ type: z.ZodString;
32
+ nullable: z.ZodBoolean;
33
+ default: z.ZodNullable<z.ZodString>;
34
+ isGenerated: z.ZodBoolean;
35
+ generationExpression: z.ZodNullable<z.ZodString>;
36
+ ordinalPosition: z.ZodNumber;
37
+ }, "strip", z.ZodTypeAny, {
38
+ type: string;
39
+ default: string | null;
40
+ name: string;
41
+ nullable: boolean;
42
+ isGenerated: boolean;
43
+ generationExpression: string | null;
44
+ ordinalPosition: number;
45
+ }, {
46
+ type: string;
47
+ default: string | null;
48
+ name: string;
49
+ nullable: boolean;
50
+ isGenerated: boolean;
51
+ generationExpression: string | null;
52
+ ordinalPosition: number;
53
+ }>;
54
+ to: z.ZodObject<{
55
+ name: z.ZodString;
56
+ type: z.ZodString;
57
+ nullable: z.ZodBoolean;
58
+ default: z.ZodNullable<z.ZodString>;
59
+ isGenerated: z.ZodBoolean;
60
+ generationExpression: z.ZodNullable<z.ZodString>;
61
+ ordinalPosition: z.ZodNumber;
62
+ }, "strip", z.ZodTypeAny, {
63
+ type: string;
64
+ default: string | null;
65
+ name: string;
66
+ nullable: boolean;
67
+ isGenerated: boolean;
68
+ generationExpression: string | null;
69
+ ordinalPosition: number;
70
+ }, {
71
+ type: string;
72
+ default: string | null;
73
+ name: string;
74
+ nullable: boolean;
75
+ isGenerated: boolean;
76
+ generationExpression: string | null;
77
+ ordinalPosition: number;
78
+ }>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ from: {
81
+ type: string;
82
+ default: string | null;
83
+ name: string;
84
+ nullable: boolean;
85
+ isGenerated: boolean;
86
+ generationExpression: string | null;
87
+ ordinalPosition: number;
88
+ };
89
+ to: {
90
+ type: string;
91
+ default: string | null;
92
+ name: string;
93
+ nullable: boolean;
94
+ isGenerated: boolean;
95
+ generationExpression: string | null;
96
+ ordinalPosition: number;
97
+ };
98
+ column: string;
99
+ }, {
100
+ from: {
101
+ type: string;
102
+ default: string | null;
103
+ name: string;
104
+ nullable: boolean;
105
+ isGenerated: boolean;
106
+ generationExpression: string | null;
107
+ ordinalPosition: number;
108
+ };
109
+ to: {
110
+ type: string;
111
+ default: string | null;
112
+ name: string;
113
+ nullable: boolean;
114
+ isGenerated: boolean;
115
+ generationExpression: string | null;
116
+ ordinalPosition: number;
117
+ };
118
+ column: string;
119
+ }>;
120
+ declare const schemaCreateTableSchema: z.ZodObject<{
121
+ columns: z.ZodArray<z.ZodObject<{
122
+ name: z.ZodString;
123
+ type: z.ZodString;
124
+ nullable: z.ZodBoolean;
125
+ default: z.ZodNullable<z.ZodString>;
126
+ isGenerated: z.ZodBoolean;
127
+ generationExpression: z.ZodNullable<z.ZodString>;
128
+ ordinalPosition: z.ZodNumber;
129
+ }, "strip", z.ZodTypeAny, {
130
+ type: string;
131
+ default: string | null;
132
+ name: string;
133
+ nullable: boolean;
134
+ isGenerated: boolean;
135
+ generationExpression: string | null;
136
+ ordinalPosition: number;
137
+ }, {
138
+ type: string;
139
+ default: string | null;
140
+ name: string;
141
+ nullable: boolean;
142
+ isGenerated: boolean;
143
+ generationExpression: string | null;
144
+ ordinalPosition: number;
145
+ }>, "many">;
146
+ primaryKey: z.ZodArray<z.ZodString, "many">;
147
+ }, "strip", z.ZodTypeAny, {
148
+ primaryKey: string[];
149
+ columns: {
150
+ type: string;
151
+ default: string | null;
152
+ name: string;
153
+ nullable: boolean;
154
+ isGenerated: boolean;
155
+ generationExpression: string | null;
156
+ ordinalPosition: number;
157
+ }[];
158
+ }, {
159
+ primaryKey: string[];
160
+ columns: {
161
+ type: string;
162
+ default: string | null;
163
+ name: string;
164
+ nullable: boolean;
165
+ isGenerated: boolean;
166
+ generationExpression: string | null;
167
+ ordinalPosition: number;
168
+ }[];
169
+ }>;
170
+ declare const schemaPrimaryKeyChangeSchema: z.ZodObject<{
171
+ from: z.ZodArray<z.ZodString, "many">;
172
+ to: z.ZodArray<z.ZodString, "many">;
173
+ dropConstraintName: z.ZodNullable<z.ZodString>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ from: string[];
176
+ to: string[];
177
+ dropConstraintName: string | null;
178
+ }, {
179
+ from: string[];
180
+ to: string[];
181
+ dropConstraintName: string | null;
182
+ }>;
183
+ declare const schemaTableDiffSchema: z.ZodObject<{
184
+ table: z.ZodString;
185
+ schema: z.ZodString;
186
+ sourceExists: z.ZodBoolean;
187
+ destExists: z.ZodBoolean;
188
+ createTable: z.ZodNullable<z.ZodObject<{
189
+ columns: z.ZodArray<z.ZodObject<{
190
+ name: z.ZodString;
191
+ type: z.ZodString;
192
+ nullable: z.ZodBoolean;
193
+ default: z.ZodNullable<z.ZodString>;
194
+ isGenerated: z.ZodBoolean;
195
+ generationExpression: z.ZodNullable<z.ZodString>;
196
+ ordinalPosition: z.ZodNumber;
197
+ }, "strip", z.ZodTypeAny, {
198
+ type: string;
199
+ default: string | null;
200
+ name: string;
201
+ nullable: boolean;
202
+ isGenerated: boolean;
203
+ generationExpression: string | null;
204
+ ordinalPosition: number;
205
+ }, {
206
+ type: string;
207
+ default: string | null;
208
+ name: string;
209
+ nullable: boolean;
210
+ isGenerated: boolean;
211
+ generationExpression: string | null;
212
+ ordinalPosition: number;
213
+ }>, "many">;
214
+ primaryKey: z.ZodArray<z.ZodString, "many">;
215
+ }, "strip", z.ZodTypeAny, {
216
+ primaryKey: string[];
217
+ columns: {
218
+ type: string;
219
+ default: string | null;
220
+ name: string;
221
+ nullable: boolean;
222
+ isGenerated: boolean;
223
+ generationExpression: string | null;
224
+ ordinalPosition: number;
225
+ }[];
226
+ }, {
227
+ primaryKey: string[];
228
+ columns: {
229
+ type: string;
230
+ default: string | null;
231
+ name: string;
232
+ nullable: boolean;
233
+ isGenerated: boolean;
234
+ generationExpression: string | null;
235
+ ordinalPosition: number;
236
+ }[];
237
+ }>>;
238
+ dropTable: z.ZodBoolean;
239
+ addColumns: z.ZodArray<z.ZodObject<{
240
+ name: z.ZodString;
241
+ type: z.ZodString;
242
+ nullable: z.ZodBoolean;
243
+ default: z.ZodNullable<z.ZodString>;
244
+ isGenerated: z.ZodBoolean;
245
+ generationExpression: z.ZodNullable<z.ZodString>;
246
+ ordinalPosition: z.ZodNumber;
247
+ }, "strip", z.ZodTypeAny, {
248
+ type: string;
249
+ default: string | null;
250
+ name: string;
251
+ nullable: boolean;
252
+ isGenerated: boolean;
253
+ generationExpression: string | null;
254
+ ordinalPosition: number;
255
+ }, {
256
+ type: string;
257
+ default: string | null;
258
+ name: string;
259
+ nullable: boolean;
260
+ isGenerated: boolean;
261
+ generationExpression: string | null;
262
+ ordinalPosition: number;
263
+ }>, "many">;
264
+ alterColumns: z.ZodArray<z.ZodObject<{
265
+ column: z.ZodString;
266
+ from: z.ZodObject<{
267
+ name: z.ZodString;
268
+ type: z.ZodString;
269
+ nullable: z.ZodBoolean;
270
+ default: z.ZodNullable<z.ZodString>;
271
+ isGenerated: z.ZodBoolean;
272
+ generationExpression: z.ZodNullable<z.ZodString>;
273
+ ordinalPosition: z.ZodNumber;
274
+ }, "strip", z.ZodTypeAny, {
275
+ type: string;
276
+ default: string | null;
277
+ name: string;
278
+ nullable: boolean;
279
+ isGenerated: boolean;
280
+ generationExpression: string | null;
281
+ ordinalPosition: number;
282
+ }, {
283
+ type: string;
284
+ default: string | null;
285
+ name: string;
286
+ nullable: boolean;
287
+ isGenerated: boolean;
288
+ generationExpression: string | null;
289
+ ordinalPosition: number;
290
+ }>;
291
+ to: z.ZodObject<{
292
+ name: z.ZodString;
293
+ type: z.ZodString;
294
+ nullable: z.ZodBoolean;
295
+ default: z.ZodNullable<z.ZodString>;
296
+ isGenerated: z.ZodBoolean;
297
+ generationExpression: z.ZodNullable<z.ZodString>;
298
+ ordinalPosition: z.ZodNumber;
299
+ }, "strip", z.ZodTypeAny, {
300
+ type: string;
301
+ default: string | null;
302
+ name: string;
303
+ nullable: boolean;
304
+ isGenerated: boolean;
305
+ generationExpression: string | null;
306
+ ordinalPosition: number;
307
+ }, {
308
+ type: string;
309
+ default: string | null;
310
+ name: string;
311
+ nullable: boolean;
312
+ isGenerated: boolean;
313
+ generationExpression: string | null;
314
+ ordinalPosition: number;
315
+ }>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ from: {
318
+ type: string;
319
+ default: string | null;
320
+ name: string;
321
+ nullable: boolean;
322
+ isGenerated: boolean;
323
+ generationExpression: string | null;
324
+ ordinalPosition: number;
325
+ };
326
+ to: {
327
+ type: string;
328
+ default: string | null;
329
+ name: string;
330
+ nullable: boolean;
331
+ isGenerated: boolean;
332
+ generationExpression: string | null;
333
+ ordinalPosition: number;
334
+ };
335
+ column: string;
336
+ }, {
337
+ from: {
338
+ type: string;
339
+ default: string | null;
340
+ name: string;
341
+ nullable: boolean;
342
+ isGenerated: boolean;
343
+ generationExpression: string | null;
344
+ ordinalPosition: number;
345
+ };
346
+ to: {
347
+ type: string;
348
+ default: string | null;
349
+ name: string;
350
+ nullable: boolean;
351
+ isGenerated: boolean;
352
+ generationExpression: string | null;
353
+ ordinalPosition: number;
354
+ };
355
+ column: string;
356
+ }>, "many">;
357
+ dropColumns: z.ZodArray<z.ZodObject<{
358
+ name: z.ZodString;
359
+ type: z.ZodString;
360
+ nullable: z.ZodBoolean;
361
+ default: z.ZodNullable<z.ZodString>;
362
+ isGenerated: z.ZodBoolean;
363
+ generationExpression: z.ZodNullable<z.ZodString>;
364
+ ordinalPosition: z.ZodNumber;
365
+ }, "strip", z.ZodTypeAny, {
366
+ type: string;
367
+ default: string | null;
368
+ name: string;
369
+ nullable: boolean;
370
+ isGenerated: boolean;
371
+ generationExpression: string | null;
372
+ ordinalPosition: number;
373
+ }, {
374
+ type: string;
375
+ default: string | null;
376
+ name: string;
377
+ nullable: boolean;
378
+ isGenerated: boolean;
379
+ generationExpression: string | null;
380
+ ordinalPosition: number;
381
+ }>, "many">;
382
+ primaryKeyChange: z.ZodNullable<z.ZodObject<{
383
+ from: z.ZodArray<z.ZodString, "many">;
384
+ to: z.ZodArray<z.ZodString, "many">;
385
+ dropConstraintName: z.ZodNullable<z.ZodString>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ from: string[];
388
+ to: string[];
389
+ dropConstraintName: string | null;
390
+ }, {
391
+ from: string[];
392
+ to: string[];
393
+ dropConstraintName: string | null;
394
+ }>>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ schema: string;
397
+ table: string;
398
+ sourceExists: boolean;
399
+ destExists: boolean;
400
+ createTable: {
401
+ primaryKey: string[];
402
+ columns: {
403
+ type: string;
404
+ default: string | null;
405
+ name: string;
406
+ nullable: boolean;
407
+ isGenerated: boolean;
408
+ generationExpression: string | null;
409
+ ordinalPosition: number;
410
+ }[];
411
+ } | null;
412
+ dropTable: boolean;
413
+ addColumns: {
414
+ type: string;
415
+ default: string | null;
416
+ name: string;
417
+ nullable: boolean;
418
+ isGenerated: boolean;
419
+ generationExpression: string | null;
420
+ ordinalPosition: number;
421
+ }[];
422
+ alterColumns: {
423
+ from: {
424
+ type: string;
425
+ default: string | null;
426
+ name: string;
427
+ nullable: boolean;
428
+ isGenerated: boolean;
429
+ generationExpression: string | null;
430
+ ordinalPosition: number;
431
+ };
432
+ to: {
433
+ type: string;
434
+ default: string | null;
435
+ name: string;
436
+ nullable: boolean;
437
+ isGenerated: boolean;
438
+ generationExpression: string | null;
439
+ ordinalPosition: number;
440
+ };
441
+ column: string;
442
+ }[];
443
+ dropColumns: {
444
+ type: string;
445
+ default: string | null;
446
+ name: string;
447
+ nullable: boolean;
448
+ isGenerated: boolean;
449
+ generationExpression: string | null;
450
+ ordinalPosition: number;
451
+ }[];
452
+ primaryKeyChange: {
453
+ from: string[];
454
+ to: string[];
455
+ dropConstraintName: string | null;
456
+ } | null;
457
+ }, {
458
+ schema: string;
459
+ table: string;
460
+ sourceExists: boolean;
461
+ destExists: boolean;
462
+ createTable: {
463
+ primaryKey: string[];
464
+ columns: {
465
+ type: string;
466
+ default: string | null;
467
+ name: string;
468
+ nullable: boolean;
469
+ isGenerated: boolean;
470
+ generationExpression: string | null;
471
+ ordinalPosition: number;
472
+ }[];
473
+ } | null;
474
+ dropTable: boolean;
475
+ addColumns: {
476
+ type: string;
477
+ default: string | null;
478
+ name: string;
479
+ nullable: boolean;
480
+ isGenerated: boolean;
481
+ generationExpression: string | null;
482
+ ordinalPosition: number;
483
+ }[];
484
+ alterColumns: {
485
+ from: {
486
+ type: string;
487
+ default: string | null;
488
+ name: string;
489
+ nullable: boolean;
490
+ isGenerated: boolean;
491
+ generationExpression: string | null;
492
+ ordinalPosition: number;
493
+ };
494
+ to: {
495
+ type: string;
496
+ default: string | null;
497
+ name: string;
498
+ nullable: boolean;
499
+ isGenerated: boolean;
500
+ generationExpression: string | null;
501
+ ordinalPosition: number;
502
+ };
503
+ column: string;
504
+ }[];
505
+ dropColumns: {
506
+ type: string;
507
+ default: string | null;
508
+ name: string;
509
+ nullable: boolean;
510
+ isGenerated: boolean;
511
+ generationExpression: string | null;
512
+ ordinalPosition: number;
513
+ }[];
514
+ primaryKeyChange: {
515
+ from: string[];
516
+ to: string[];
517
+ dropConstraintName: string | null;
518
+ } | null;
519
+ }>;
520
+ export declare const schemaDiffJsonSchema: z.ZodObject<{
521
+ format: z.ZodLiteral<"postgres-schema-diff-json/v1">;
522
+ generatedAt: z.ZodString;
523
+ source: z.ZodObject<{
524
+ schema: z.ZodString;
525
+ }, "strip", z.ZodTypeAny, {
526
+ schema: string;
527
+ }, {
528
+ schema: string;
529
+ }>;
530
+ dest: z.ZodObject<{
531
+ schema: z.ZodString;
532
+ }, "strip", z.ZodTypeAny, {
533
+ schema: string;
534
+ }, {
535
+ schema: string;
536
+ }>;
537
+ options: z.ZodObject<{
538
+ tables: z.ZodArray<z.ZodString, "many">;
539
+ excludedTables: z.ZodArray<z.ZodString, "many">;
540
+ }, "strip", z.ZodTypeAny, {
541
+ tables: string[];
542
+ excludedTables: string[];
543
+ }, {
544
+ tables: string[];
545
+ excludedTables: string[];
546
+ }>;
547
+ tables: z.ZodArray<z.ZodObject<{
548
+ table: z.ZodString;
549
+ schema: z.ZodString;
550
+ sourceExists: z.ZodBoolean;
551
+ destExists: z.ZodBoolean;
552
+ createTable: z.ZodNullable<z.ZodObject<{
553
+ columns: z.ZodArray<z.ZodObject<{
554
+ name: z.ZodString;
555
+ type: z.ZodString;
556
+ nullable: z.ZodBoolean;
557
+ default: z.ZodNullable<z.ZodString>;
558
+ isGenerated: z.ZodBoolean;
559
+ generationExpression: z.ZodNullable<z.ZodString>;
560
+ ordinalPosition: z.ZodNumber;
561
+ }, "strip", z.ZodTypeAny, {
562
+ type: string;
563
+ default: string | null;
564
+ name: string;
565
+ nullable: boolean;
566
+ isGenerated: boolean;
567
+ generationExpression: string | null;
568
+ ordinalPosition: number;
569
+ }, {
570
+ type: string;
571
+ default: string | null;
572
+ name: string;
573
+ nullable: boolean;
574
+ isGenerated: boolean;
575
+ generationExpression: string | null;
576
+ ordinalPosition: number;
577
+ }>, "many">;
578
+ primaryKey: z.ZodArray<z.ZodString, "many">;
579
+ }, "strip", z.ZodTypeAny, {
580
+ primaryKey: string[];
581
+ columns: {
582
+ type: string;
583
+ default: string | null;
584
+ name: string;
585
+ nullable: boolean;
586
+ isGenerated: boolean;
587
+ generationExpression: string | null;
588
+ ordinalPosition: number;
589
+ }[];
590
+ }, {
591
+ primaryKey: string[];
592
+ columns: {
593
+ type: string;
594
+ default: string | null;
595
+ name: string;
596
+ nullable: boolean;
597
+ isGenerated: boolean;
598
+ generationExpression: string | null;
599
+ ordinalPosition: number;
600
+ }[];
601
+ }>>;
602
+ dropTable: z.ZodBoolean;
603
+ addColumns: z.ZodArray<z.ZodObject<{
604
+ name: z.ZodString;
605
+ type: z.ZodString;
606
+ nullable: z.ZodBoolean;
607
+ default: z.ZodNullable<z.ZodString>;
608
+ isGenerated: z.ZodBoolean;
609
+ generationExpression: z.ZodNullable<z.ZodString>;
610
+ ordinalPosition: z.ZodNumber;
611
+ }, "strip", z.ZodTypeAny, {
612
+ type: string;
613
+ default: string | null;
614
+ name: string;
615
+ nullable: boolean;
616
+ isGenerated: boolean;
617
+ generationExpression: string | null;
618
+ ordinalPosition: number;
619
+ }, {
620
+ type: string;
621
+ default: string | null;
622
+ name: string;
623
+ nullable: boolean;
624
+ isGenerated: boolean;
625
+ generationExpression: string | null;
626
+ ordinalPosition: number;
627
+ }>, "many">;
628
+ alterColumns: z.ZodArray<z.ZodObject<{
629
+ column: z.ZodString;
630
+ from: z.ZodObject<{
631
+ name: z.ZodString;
632
+ type: z.ZodString;
633
+ nullable: z.ZodBoolean;
634
+ default: z.ZodNullable<z.ZodString>;
635
+ isGenerated: z.ZodBoolean;
636
+ generationExpression: z.ZodNullable<z.ZodString>;
637
+ ordinalPosition: z.ZodNumber;
638
+ }, "strip", z.ZodTypeAny, {
639
+ type: string;
640
+ default: string | null;
641
+ name: string;
642
+ nullable: boolean;
643
+ isGenerated: boolean;
644
+ generationExpression: string | null;
645
+ ordinalPosition: number;
646
+ }, {
647
+ type: string;
648
+ default: string | null;
649
+ name: string;
650
+ nullable: boolean;
651
+ isGenerated: boolean;
652
+ generationExpression: string | null;
653
+ ordinalPosition: number;
654
+ }>;
655
+ to: z.ZodObject<{
656
+ name: z.ZodString;
657
+ type: z.ZodString;
658
+ nullable: z.ZodBoolean;
659
+ default: z.ZodNullable<z.ZodString>;
660
+ isGenerated: z.ZodBoolean;
661
+ generationExpression: z.ZodNullable<z.ZodString>;
662
+ ordinalPosition: z.ZodNumber;
663
+ }, "strip", z.ZodTypeAny, {
664
+ type: string;
665
+ default: string | null;
666
+ name: string;
667
+ nullable: boolean;
668
+ isGenerated: boolean;
669
+ generationExpression: string | null;
670
+ ordinalPosition: number;
671
+ }, {
672
+ type: string;
673
+ default: string | null;
674
+ name: string;
675
+ nullable: boolean;
676
+ isGenerated: boolean;
677
+ generationExpression: string | null;
678
+ ordinalPosition: number;
679
+ }>;
680
+ }, "strip", z.ZodTypeAny, {
681
+ from: {
682
+ type: string;
683
+ default: string | null;
684
+ name: string;
685
+ nullable: boolean;
686
+ isGenerated: boolean;
687
+ generationExpression: string | null;
688
+ ordinalPosition: number;
689
+ };
690
+ to: {
691
+ type: string;
692
+ default: string | null;
693
+ name: string;
694
+ nullable: boolean;
695
+ isGenerated: boolean;
696
+ generationExpression: string | null;
697
+ ordinalPosition: number;
698
+ };
699
+ column: string;
700
+ }, {
701
+ from: {
702
+ type: string;
703
+ default: string | null;
704
+ name: string;
705
+ nullable: boolean;
706
+ isGenerated: boolean;
707
+ generationExpression: string | null;
708
+ ordinalPosition: number;
709
+ };
710
+ to: {
711
+ type: string;
712
+ default: string | null;
713
+ name: string;
714
+ nullable: boolean;
715
+ isGenerated: boolean;
716
+ generationExpression: string | null;
717
+ ordinalPosition: number;
718
+ };
719
+ column: string;
720
+ }>, "many">;
721
+ dropColumns: z.ZodArray<z.ZodObject<{
722
+ name: z.ZodString;
723
+ type: z.ZodString;
724
+ nullable: z.ZodBoolean;
725
+ default: z.ZodNullable<z.ZodString>;
726
+ isGenerated: z.ZodBoolean;
727
+ generationExpression: z.ZodNullable<z.ZodString>;
728
+ ordinalPosition: z.ZodNumber;
729
+ }, "strip", z.ZodTypeAny, {
730
+ type: string;
731
+ default: string | null;
732
+ name: string;
733
+ nullable: boolean;
734
+ isGenerated: boolean;
735
+ generationExpression: string | null;
736
+ ordinalPosition: number;
737
+ }, {
738
+ type: string;
739
+ default: string | null;
740
+ name: string;
741
+ nullable: boolean;
742
+ isGenerated: boolean;
743
+ generationExpression: string | null;
744
+ ordinalPosition: number;
745
+ }>, "many">;
746
+ primaryKeyChange: z.ZodNullable<z.ZodObject<{
747
+ from: z.ZodArray<z.ZodString, "many">;
748
+ to: z.ZodArray<z.ZodString, "many">;
749
+ dropConstraintName: z.ZodNullable<z.ZodString>;
750
+ }, "strip", z.ZodTypeAny, {
751
+ from: string[];
752
+ to: string[];
753
+ dropConstraintName: string | null;
754
+ }, {
755
+ from: string[];
756
+ to: string[];
757
+ dropConstraintName: string | null;
758
+ }>>;
759
+ }, "strip", z.ZodTypeAny, {
760
+ schema: string;
761
+ table: string;
762
+ sourceExists: boolean;
763
+ destExists: boolean;
764
+ createTable: {
765
+ primaryKey: string[];
766
+ columns: {
767
+ type: string;
768
+ default: string | null;
769
+ name: string;
770
+ nullable: boolean;
771
+ isGenerated: boolean;
772
+ generationExpression: string | null;
773
+ ordinalPosition: number;
774
+ }[];
775
+ } | null;
776
+ dropTable: boolean;
777
+ addColumns: {
778
+ type: string;
779
+ default: string | null;
780
+ name: string;
781
+ nullable: boolean;
782
+ isGenerated: boolean;
783
+ generationExpression: string | null;
784
+ ordinalPosition: number;
785
+ }[];
786
+ alterColumns: {
787
+ from: {
788
+ type: string;
789
+ default: string | null;
790
+ name: string;
791
+ nullable: boolean;
792
+ isGenerated: boolean;
793
+ generationExpression: string | null;
794
+ ordinalPosition: number;
795
+ };
796
+ to: {
797
+ type: string;
798
+ default: string | null;
799
+ name: string;
800
+ nullable: boolean;
801
+ isGenerated: boolean;
802
+ generationExpression: string | null;
803
+ ordinalPosition: number;
804
+ };
805
+ column: string;
806
+ }[];
807
+ dropColumns: {
808
+ type: string;
809
+ default: string | null;
810
+ name: string;
811
+ nullable: boolean;
812
+ isGenerated: boolean;
813
+ generationExpression: string | null;
814
+ ordinalPosition: number;
815
+ }[];
816
+ primaryKeyChange: {
817
+ from: string[];
818
+ to: string[];
819
+ dropConstraintName: string | null;
820
+ } | null;
821
+ }, {
822
+ schema: string;
823
+ table: string;
824
+ sourceExists: boolean;
825
+ destExists: boolean;
826
+ createTable: {
827
+ primaryKey: string[];
828
+ columns: {
829
+ type: string;
830
+ default: string | null;
831
+ name: string;
832
+ nullable: boolean;
833
+ isGenerated: boolean;
834
+ generationExpression: string | null;
835
+ ordinalPosition: number;
836
+ }[];
837
+ } | null;
838
+ dropTable: boolean;
839
+ addColumns: {
840
+ type: string;
841
+ default: string | null;
842
+ name: string;
843
+ nullable: boolean;
844
+ isGenerated: boolean;
845
+ generationExpression: string | null;
846
+ ordinalPosition: number;
847
+ }[];
848
+ alterColumns: {
849
+ from: {
850
+ type: string;
851
+ default: string | null;
852
+ name: string;
853
+ nullable: boolean;
854
+ isGenerated: boolean;
855
+ generationExpression: string | null;
856
+ ordinalPosition: number;
857
+ };
858
+ to: {
859
+ type: string;
860
+ default: string | null;
861
+ name: string;
862
+ nullable: boolean;
863
+ isGenerated: boolean;
864
+ generationExpression: string | null;
865
+ ordinalPosition: number;
866
+ };
867
+ column: string;
868
+ }[];
869
+ dropColumns: {
870
+ type: string;
871
+ default: string | null;
872
+ name: string;
873
+ nullable: boolean;
874
+ isGenerated: boolean;
875
+ generationExpression: string | null;
876
+ ordinalPosition: number;
877
+ }[];
878
+ primaryKeyChange: {
879
+ from: string[];
880
+ to: string[];
881
+ dropConstraintName: string | null;
882
+ } | null;
883
+ }>, "many">;
884
+ summary: z.ZodObject<{
885
+ tablesCompared: z.ZodNumber;
886
+ tablesToCreate: z.ZodNumber;
887
+ tablesToDrop: z.ZodNumber;
888
+ columnsToAdd: z.ZodNumber;
889
+ columnsToAlter: z.ZodNumber;
890
+ columnsToDrop: z.ZodNumber;
891
+ primaryKeysToChange: z.ZodNumber;
892
+ }, "strip", z.ZodTypeAny, {
893
+ tablesCompared: number;
894
+ tablesToCreate: number;
895
+ tablesToDrop: number;
896
+ columnsToAdd: number;
897
+ columnsToAlter: number;
898
+ columnsToDrop: number;
899
+ primaryKeysToChange: number;
900
+ }, {
901
+ tablesCompared: number;
902
+ tablesToCreate: number;
903
+ tablesToDrop: number;
904
+ columnsToAdd: number;
905
+ columnsToAlter: number;
906
+ columnsToDrop: number;
907
+ primaryKeysToChange: number;
908
+ }>;
909
+ }, "strip", z.ZodTypeAny, {
910
+ options: {
911
+ tables: string[];
912
+ excludedTables: string[];
913
+ };
914
+ format: "postgres-schema-diff-json/v1";
915
+ generatedAt: string;
916
+ source: {
917
+ schema: string;
918
+ };
919
+ dest: {
920
+ schema: string;
921
+ };
922
+ tables: {
923
+ schema: string;
924
+ table: string;
925
+ sourceExists: boolean;
926
+ destExists: boolean;
927
+ createTable: {
928
+ primaryKey: string[];
929
+ columns: {
930
+ type: string;
931
+ default: string | null;
932
+ name: string;
933
+ nullable: boolean;
934
+ isGenerated: boolean;
935
+ generationExpression: string | null;
936
+ ordinalPosition: number;
937
+ }[];
938
+ } | null;
939
+ dropTable: boolean;
940
+ addColumns: {
941
+ type: string;
942
+ default: string | null;
943
+ name: string;
944
+ nullable: boolean;
945
+ isGenerated: boolean;
946
+ generationExpression: string | null;
947
+ ordinalPosition: number;
948
+ }[];
949
+ alterColumns: {
950
+ from: {
951
+ type: string;
952
+ default: string | null;
953
+ name: string;
954
+ nullable: boolean;
955
+ isGenerated: boolean;
956
+ generationExpression: string | null;
957
+ ordinalPosition: number;
958
+ };
959
+ to: {
960
+ type: string;
961
+ default: string | null;
962
+ name: string;
963
+ nullable: boolean;
964
+ isGenerated: boolean;
965
+ generationExpression: string | null;
966
+ ordinalPosition: number;
967
+ };
968
+ column: string;
969
+ }[];
970
+ dropColumns: {
971
+ type: string;
972
+ default: string | null;
973
+ name: string;
974
+ nullable: boolean;
975
+ isGenerated: boolean;
976
+ generationExpression: string | null;
977
+ ordinalPosition: number;
978
+ }[];
979
+ primaryKeyChange: {
980
+ from: string[];
981
+ to: string[];
982
+ dropConstraintName: string | null;
983
+ } | null;
984
+ }[];
985
+ summary: {
986
+ tablesCompared: number;
987
+ tablesToCreate: number;
988
+ tablesToDrop: number;
989
+ columnsToAdd: number;
990
+ columnsToAlter: number;
991
+ columnsToDrop: number;
992
+ primaryKeysToChange: number;
993
+ };
994
+ }, {
995
+ options: {
996
+ tables: string[];
997
+ excludedTables: string[];
998
+ };
999
+ format: "postgres-schema-diff-json/v1";
1000
+ generatedAt: string;
1001
+ source: {
1002
+ schema: string;
1003
+ };
1004
+ dest: {
1005
+ schema: string;
1006
+ };
1007
+ tables: {
1008
+ schema: string;
1009
+ table: string;
1010
+ sourceExists: boolean;
1011
+ destExists: boolean;
1012
+ createTable: {
1013
+ primaryKey: string[];
1014
+ columns: {
1015
+ type: string;
1016
+ default: string | null;
1017
+ name: string;
1018
+ nullable: boolean;
1019
+ isGenerated: boolean;
1020
+ generationExpression: string | null;
1021
+ ordinalPosition: number;
1022
+ }[];
1023
+ } | null;
1024
+ dropTable: boolean;
1025
+ addColumns: {
1026
+ type: string;
1027
+ default: string | null;
1028
+ name: string;
1029
+ nullable: boolean;
1030
+ isGenerated: boolean;
1031
+ generationExpression: string | null;
1032
+ ordinalPosition: number;
1033
+ }[];
1034
+ alterColumns: {
1035
+ from: {
1036
+ type: string;
1037
+ default: string | null;
1038
+ name: string;
1039
+ nullable: boolean;
1040
+ isGenerated: boolean;
1041
+ generationExpression: string | null;
1042
+ ordinalPosition: number;
1043
+ };
1044
+ to: {
1045
+ type: string;
1046
+ default: string | null;
1047
+ name: string;
1048
+ nullable: boolean;
1049
+ isGenerated: boolean;
1050
+ generationExpression: string | null;
1051
+ ordinalPosition: number;
1052
+ };
1053
+ column: string;
1054
+ }[];
1055
+ dropColumns: {
1056
+ type: string;
1057
+ default: string | null;
1058
+ name: string;
1059
+ nullable: boolean;
1060
+ isGenerated: boolean;
1061
+ generationExpression: string | null;
1062
+ ordinalPosition: number;
1063
+ }[];
1064
+ primaryKeyChange: {
1065
+ from: string[];
1066
+ to: string[];
1067
+ dropConstraintName: string | null;
1068
+ } | null;
1069
+ }[];
1070
+ summary: {
1071
+ tablesCompared: number;
1072
+ tablesToCreate: number;
1073
+ tablesToDrop: number;
1074
+ columnsToAdd: number;
1075
+ columnsToAlter: number;
1076
+ columnsToDrop: number;
1077
+ primaryKeysToChange: number;
1078
+ };
1079
+ }>;
1080
+ export type SchemaColumnDefinition = z.infer<typeof schemaColumnDefinitionSchema>;
1081
+ export type SchemaColumnChange = z.infer<typeof schemaColumnChangeSchema>;
1082
+ export type SchemaCreateTable = z.infer<typeof schemaCreateTableSchema>;
1083
+ export type SchemaPrimaryKeyChange = z.infer<typeof schemaPrimaryKeyChangeSchema>;
1084
+ export type SchemaTableDiff = z.infer<typeof schemaTableDiffSchema>;
1085
+ export type SchemaDiffJson = z.infer<typeof schemaDiffJsonSchema>;
1086
+ export declare function validateSchemaDiffJson(data: unknown): SchemaDiffJson;
1087
+ export {};
1088
+ //# sourceMappingURL=schema-diff-schema.d.ts.map