@mrnafisia/type-query 1.0.29 → 1.0.30

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