@reifydb/core 0.1.7 → 0.3.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.
- package/dist/index.d.ts +20 -262
- package/dist/index.js +133 -196
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* MIT License
|
|
3
|
-
* Copyright (c) 2025 ReifyDB
|
|
4
|
-
* See license.md file for full license text
|
|
5
|
-
*/
|
|
6
|
-
declare const UNDEFINED_VALUE = "\u27EAundefined\u27EB";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* MIT License
|
|
10
|
-
* Copyright (c) 2025 ReifyDB
|
|
11
|
-
* See license.md file for full license text
|
|
12
|
-
*/
|
|
1
|
+
declare const NONE_VALUE = "\u27EAnone\u27EB";
|
|
13
2
|
|
|
14
3
|
/**
|
|
15
4
|
* A binary large object (BLOB) value that can hold arbitrary byte data.
|
|
@@ -90,12 +79,6 @@ declare class BlobValue implements Value {
|
|
|
90
79
|
encode(): TypeValuePair;
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
/**
|
|
94
|
-
* MIT License
|
|
95
|
-
* Copyright (c) 2025 ReifyDB
|
|
96
|
-
* See license.md file for full license text
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
82
|
declare class BooleanValue implements Value {
|
|
100
83
|
readonly type: Type;
|
|
101
84
|
readonly value?: boolean;
|
|
@@ -110,12 +93,6 @@ declare class BooleanValue implements Value {
|
|
|
110
93
|
encode(): TypeValuePair;
|
|
111
94
|
}
|
|
112
95
|
|
|
113
|
-
/**
|
|
114
|
-
* MIT License
|
|
115
|
-
* Copyright (c) 2025 ReifyDB
|
|
116
|
-
* See license.md file for full license text
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
96
|
/**
|
|
120
97
|
* A date value representing a calendar date (year, month, day) without time information.
|
|
121
98
|
* Always interpreted in UTC.
|
|
@@ -185,12 +162,6 @@ declare class DateValue implements Value {
|
|
|
185
162
|
encode(): TypeValuePair;
|
|
186
163
|
}
|
|
187
164
|
|
|
188
|
-
/**
|
|
189
|
-
* MIT License
|
|
190
|
-
* Copyright (c) 2025 ReifyDB
|
|
191
|
-
* See license.md file for full license text
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
165
|
/**
|
|
195
166
|
* A time value representing time of day (hour, minute, second, nanosecond) without date information.
|
|
196
167
|
* Internally stored as nanoseconds since midnight.
|
|
@@ -263,12 +234,6 @@ declare class TimeValue implements Value {
|
|
|
263
234
|
encode(): TypeValuePair;
|
|
264
235
|
}
|
|
265
236
|
|
|
266
|
-
/**
|
|
267
|
-
* MIT License
|
|
268
|
-
* Copyright (c) 2025 ReifyDB
|
|
269
|
-
* See license.md file for full license text
|
|
270
|
-
*/
|
|
271
|
-
|
|
272
237
|
/**
|
|
273
238
|
* A date and time value with nanosecond precision.
|
|
274
239
|
* Always in UTC timezone.
|
|
@@ -364,12 +329,6 @@ declare class DateTimeValue implements Value {
|
|
|
364
329
|
encode(): TypeValuePair;
|
|
365
330
|
}
|
|
366
331
|
|
|
367
|
-
/**
|
|
368
|
-
* MIT License
|
|
369
|
-
* Copyright (c) 2025 ReifyDB
|
|
370
|
-
* See license.md file for full license text
|
|
371
|
-
*/
|
|
372
|
-
|
|
373
332
|
declare class DecimalValue implements Value {
|
|
374
333
|
readonly type: Type;
|
|
375
334
|
readonly value?: string;
|
|
@@ -381,12 +340,6 @@ declare class DecimalValue implements Value {
|
|
|
381
340
|
encode(): TypeValuePair;
|
|
382
341
|
}
|
|
383
342
|
|
|
384
|
-
/**
|
|
385
|
-
* MIT License
|
|
386
|
-
* Copyright (c) 2025 ReifyDB
|
|
387
|
-
* See license.md file for full license text
|
|
388
|
-
*/
|
|
389
|
-
|
|
390
343
|
declare class Float4Value implements Value {
|
|
391
344
|
private static readonly MAX_VALUE;
|
|
392
345
|
private static readonly MIN_VALUE;
|
|
@@ -404,12 +357,6 @@ declare class Float4Value implements Value {
|
|
|
404
357
|
encode(): TypeValuePair;
|
|
405
358
|
}
|
|
406
359
|
|
|
407
|
-
/**
|
|
408
|
-
* MIT License
|
|
409
|
-
* Copyright (c) 2025 ReifyDB
|
|
410
|
-
* See license.md file for full license text
|
|
411
|
-
*/
|
|
412
|
-
|
|
413
360
|
declare class Float8Value implements Value {
|
|
414
361
|
readonly type: Type;
|
|
415
362
|
readonly value?: number;
|
|
@@ -424,12 +371,6 @@ declare class Float8Value implements Value {
|
|
|
424
371
|
encode(): TypeValuePair;
|
|
425
372
|
}
|
|
426
373
|
|
|
427
|
-
/**
|
|
428
|
-
* MIT License
|
|
429
|
-
* Copyright (c) 2025 ReifyDB
|
|
430
|
-
* See license.md file for full license text
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
374
|
declare class Int1Value implements Value {
|
|
434
375
|
readonly type: Type;
|
|
435
376
|
readonly value?: number;
|
|
@@ -446,12 +387,6 @@ declare class Int1Value implements Value {
|
|
|
446
387
|
encode(): TypeValuePair;
|
|
447
388
|
}
|
|
448
389
|
|
|
449
|
-
/**
|
|
450
|
-
* MIT License
|
|
451
|
-
* Copyright (c) 2025 ReifyDB
|
|
452
|
-
* See license.md file for full license text
|
|
453
|
-
*/
|
|
454
|
-
|
|
455
390
|
declare class Int2Value implements Value {
|
|
456
391
|
readonly type: Type;
|
|
457
392
|
readonly value?: number;
|
|
@@ -468,12 +403,6 @@ declare class Int2Value implements Value {
|
|
|
468
403
|
encode(): TypeValuePair;
|
|
469
404
|
}
|
|
470
405
|
|
|
471
|
-
/**
|
|
472
|
-
* MIT License
|
|
473
|
-
* Copyright (c) 2025 ReifyDB
|
|
474
|
-
* See license.md file for full license text
|
|
475
|
-
*/
|
|
476
|
-
|
|
477
406
|
declare class Int4Value implements Value {
|
|
478
407
|
readonly type: Type;
|
|
479
408
|
readonly value?: number;
|
|
@@ -490,12 +419,6 @@ declare class Int4Value implements Value {
|
|
|
490
419
|
encode(): TypeValuePair;
|
|
491
420
|
}
|
|
492
421
|
|
|
493
|
-
/**
|
|
494
|
-
* MIT License
|
|
495
|
-
* Copyright (c) 2025 ReifyDB
|
|
496
|
-
* See license.md file for full license text
|
|
497
|
-
*/
|
|
498
|
-
|
|
499
422
|
declare class Int8Value implements Value {
|
|
500
423
|
readonly type: Type;
|
|
501
424
|
readonly value?: bigint;
|
|
@@ -512,12 +435,6 @@ declare class Int8Value implements Value {
|
|
|
512
435
|
encode(): TypeValuePair;
|
|
513
436
|
}
|
|
514
437
|
|
|
515
|
-
/**
|
|
516
|
-
* MIT License
|
|
517
|
-
* Copyright (c) 2025 ReifyDB
|
|
518
|
-
* See license.md file for full license text
|
|
519
|
-
*/
|
|
520
|
-
|
|
521
438
|
declare class Int16Value implements Value {
|
|
522
439
|
readonly type: Type;
|
|
523
440
|
readonly value?: bigint;
|
|
@@ -534,12 +451,6 @@ declare class Int16Value implements Value {
|
|
|
534
451
|
encode(): TypeValuePair;
|
|
535
452
|
}
|
|
536
453
|
|
|
537
|
-
/**
|
|
538
|
-
* MIT License
|
|
539
|
-
* Copyright (c) 2025 ReifyDB
|
|
540
|
-
* See license.md file for full license text
|
|
541
|
-
*/
|
|
542
|
-
|
|
543
454
|
/**
|
|
544
455
|
* A duration value representing a time span or elapsed time.
|
|
545
456
|
* Internally stored as months, days, and nanoseconds.
|
|
@@ -688,12 +599,6 @@ declare class DurationValue implements Value {
|
|
|
688
599
|
encode(): TypeValuePair;
|
|
689
600
|
}
|
|
690
601
|
|
|
691
|
-
/**
|
|
692
|
-
* MIT License
|
|
693
|
-
* Copyright (c) 2025 ReifyDB
|
|
694
|
-
* See license.md file for full license text
|
|
695
|
-
*/
|
|
696
|
-
|
|
697
602
|
declare class Uint1Value implements Value {
|
|
698
603
|
readonly type: Type;
|
|
699
604
|
readonly value?: number;
|
|
@@ -710,12 +615,6 @@ declare class Uint1Value implements Value {
|
|
|
710
615
|
encode(): TypeValuePair;
|
|
711
616
|
}
|
|
712
617
|
|
|
713
|
-
/**
|
|
714
|
-
* MIT License
|
|
715
|
-
* Copyright (c) 2025 ReifyDB
|
|
716
|
-
* See license.md file for full license text
|
|
717
|
-
*/
|
|
718
|
-
|
|
719
618
|
declare class Uint2Value implements Value {
|
|
720
619
|
readonly type: Type;
|
|
721
620
|
readonly value?: number;
|
|
@@ -732,12 +631,6 @@ declare class Uint2Value implements Value {
|
|
|
732
631
|
encode(): TypeValuePair;
|
|
733
632
|
}
|
|
734
633
|
|
|
735
|
-
/**
|
|
736
|
-
* MIT License
|
|
737
|
-
* Copyright (c) 2025 ReifyDB
|
|
738
|
-
* See license.md file for full license text
|
|
739
|
-
*/
|
|
740
|
-
|
|
741
634
|
declare class Uint4Value implements Value {
|
|
742
635
|
readonly type: Type;
|
|
743
636
|
readonly value?: number;
|
|
@@ -754,12 +647,6 @@ declare class Uint4Value implements Value {
|
|
|
754
647
|
encode(): TypeValuePair;
|
|
755
648
|
}
|
|
756
649
|
|
|
757
|
-
/**
|
|
758
|
-
* MIT License
|
|
759
|
-
* Copyright (c) 2025 ReifyDB
|
|
760
|
-
* See license.md file for full license text
|
|
761
|
-
*/
|
|
762
|
-
|
|
763
650
|
declare class Uint8Value implements Value {
|
|
764
651
|
readonly type: Type;
|
|
765
652
|
readonly value?: bigint;
|
|
@@ -777,12 +664,6 @@ declare class Uint8Value implements Value {
|
|
|
777
664
|
encode(): TypeValuePair;
|
|
778
665
|
}
|
|
779
666
|
|
|
780
|
-
/**
|
|
781
|
-
* MIT License
|
|
782
|
-
* Copyright (c) 2025 ReifyDB
|
|
783
|
-
* See license.md file for full license text
|
|
784
|
-
*/
|
|
785
|
-
|
|
786
667
|
declare class Uint16Value implements Value {
|
|
787
668
|
readonly type: Type;
|
|
788
669
|
readonly value?: bigint;
|
|
@@ -799,82 +680,20 @@ declare class Uint16Value implements Value {
|
|
|
799
680
|
encode(): TypeValuePair;
|
|
800
681
|
}
|
|
801
682
|
|
|
802
|
-
|
|
803
|
-
* MIT License
|
|
804
|
-
* Copyright (c) 2025 ReifyDB
|
|
805
|
-
* See license.md file for full license text
|
|
806
|
-
*/
|
|
807
|
-
|
|
808
|
-
declare class RowNumberValue implements Value {
|
|
809
|
-
private static readonly MIN_VALUE;
|
|
810
|
-
private static readonly MAX_VALUE;
|
|
683
|
+
declare class NoneValue implements Value {
|
|
811
684
|
readonly type: Type;
|
|
812
|
-
readonly
|
|
813
|
-
constructor(
|
|
814
|
-
static parse(str: string):
|
|
815
|
-
|
|
816
|
-
toString(): string;
|
|
817
|
-
/**
|
|
818
|
-
* Compare two RowNumber values for equality
|
|
819
|
-
*/
|
|
820
|
-
equals(other: Value): boolean;
|
|
821
|
-
encode(): TypeValuePair;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* MIT License
|
|
826
|
-
* Copyright (c) 2025 ReifyDB
|
|
827
|
-
* See license.md file for full license text
|
|
828
|
-
*/
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* An undefined value wrapper type
|
|
832
|
-
*/
|
|
833
|
-
declare class UndefinedValue implements Value {
|
|
834
|
-
readonly type: Type;
|
|
835
|
-
constructor();
|
|
836
|
-
/**
|
|
837
|
-
* Create a new UndefinedValue
|
|
838
|
-
*/
|
|
839
|
-
static new(): UndefinedValue;
|
|
840
|
-
/**
|
|
841
|
-
* Get default UndefinedValue
|
|
842
|
-
*/
|
|
843
|
-
static default(): UndefinedValue;
|
|
844
|
-
/**
|
|
845
|
-
* Parse a string as undefined
|
|
846
|
-
*/
|
|
847
|
-
static parse(str: string): UndefinedValue;
|
|
848
|
-
/**
|
|
849
|
-
* Check if this value is undefined (always true)
|
|
850
|
-
*/
|
|
851
|
-
isUndefined(): boolean;
|
|
852
|
-
/**
|
|
853
|
-
* Format as string
|
|
854
|
-
*/
|
|
685
|
+
readonly innerType: BaseType;
|
|
686
|
+
constructor(innerType?: BaseType);
|
|
687
|
+
static parse(str: string, innerType?: BaseType): NoneValue;
|
|
688
|
+
isNone(): boolean;
|
|
855
689
|
toString(): string;
|
|
856
690
|
valueOf(): undefined;
|
|
857
|
-
/**
|
|
858
|
-
* Get the internal representation (always undefined)
|
|
859
|
-
*/
|
|
860
691
|
get value(): undefined;
|
|
861
|
-
/**
|
|
862
|
-
* Compare two undefined values (always equal)
|
|
863
|
-
*/
|
|
864
692
|
equals(other: Value): boolean;
|
|
865
|
-
|
|
866
|
-
* Compare two undefined values for ordering (always equal)
|
|
867
|
-
*/
|
|
868
|
-
compare(other: UndefinedValue): number;
|
|
693
|
+
compare(other: NoneValue): number;
|
|
869
694
|
encode(): TypeValuePair;
|
|
870
695
|
}
|
|
871
696
|
|
|
872
|
-
/**
|
|
873
|
-
* MIT License
|
|
874
|
-
* Copyright (c) 2025 ReifyDB
|
|
875
|
-
* See license.md file for full license text
|
|
876
|
-
*/
|
|
877
|
-
|
|
878
697
|
declare class Utf8Value implements Value {
|
|
879
698
|
readonly type: Type;
|
|
880
699
|
readonly value?: string;
|
|
@@ -889,12 +708,6 @@ declare class Utf8Value implements Value {
|
|
|
889
708
|
encode(): TypeValuePair;
|
|
890
709
|
}
|
|
891
710
|
|
|
892
|
-
/**
|
|
893
|
-
* MIT License
|
|
894
|
-
* Copyright (c) 2025 ReifyDB
|
|
895
|
-
* See license.md file for full license text
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
711
|
/**
|
|
899
712
|
* A UUID version 4 (random) value type
|
|
900
713
|
*/
|
|
@@ -958,12 +771,6 @@ declare class Uuid4Value implements Value {
|
|
|
958
771
|
encode(): TypeValuePair;
|
|
959
772
|
}
|
|
960
773
|
|
|
961
|
-
/**
|
|
962
|
-
* MIT License
|
|
963
|
-
* Copyright (c) 2025 ReifyDB
|
|
964
|
-
* See license.md file for full license text
|
|
965
|
-
*/
|
|
966
|
-
|
|
967
774
|
/**
|
|
968
775
|
* A UUID version 7 (timestamp-based) value type
|
|
969
776
|
*/
|
|
@@ -1032,12 +839,6 @@ declare class Uuid7Value implements Value {
|
|
|
1032
839
|
encode(): TypeValuePair;
|
|
1033
840
|
}
|
|
1034
841
|
|
|
1035
|
-
/**
|
|
1036
|
-
* MIT License
|
|
1037
|
-
* Copyright (c) 2025 ReifyDB
|
|
1038
|
-
* See license.md file for full license text
|
|
1039
|
-
*/
|
|
1040
|
-
|
|
1041
842
|
/**
|
|
1042
843
|
* An IdentityId value type that wraps a UUID v7
|
|
1043
844
|
*/
|
|
@@ -1080,13 +881,13 @@ declare class IdentityIdValue implements Value {
|
|
|
1080
881
|
encode(): TypeValuePair;
|
|
1081
882
|
}
|
|
1082
883
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
884
|
+
type BaseType = "Blob" | "Boolean" | "Decimal" | "Float4" | "Float8" | "Int1" | "Int2" | "Int4" | "Int8" | "Int16" | "Uint1" | "Uint2" | "Uint4" | "Uint8" | "Uint16" | "Utf8" | "Date" | "DateTime" | "Time" | "Duration" | "Uuid4" | "Uuid7" | "IdentityId" | "None";
|
|
885
|
+
interface OptionType {
|
|
886
|
+
Option: Type;
|
|
887
|
+
}
|
|
888
|
+
type Type = BaseType | OptionType;
|
|
889
|
+
declare function isOptionType(t: Type): t is OptionType;
|
|
890
|
+
declare function unwrapOptionType(t: Type): BaseType;
|
|
1090
891
|
interface TypeValuePair {
|
|
1091
892
|
type: Type;
|
|
1092
893
|
value: string;
|
|
@@ -1097,35 +898,17 @@ declare abstract class Value {
|
|
|
1097
898
|
abstract equals(other: Value): boolean;
|
|
1098
899
|
}
|
|
1099
900
|
|
|
1100
|
-
/**
|
|
1101
|
-
* MIT License
|
|
1102
|
-
* Copyright (c) 2025 ReifyDB
|
|
1103
|
-
* See license.md file for full license text
|
|
1104
|
-
*/
|
|
1105
|
-
|
|
1106
901
|
declare function decode(pair: TypeValuePair): Value;
|
|
1107
902
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
* See license.md file for full license text
|
|
1112
|
-
*/
|
|
1113
|
-
|
|
1114
|
-
type PrimitiveToTS<T extends Type> = T extends 'Blob' ? Uint8Array : T extends 'Boolean' ? boolean : T extends 'Decimal' ? string : T extends 'Float4' ? number : T extends 'Float8' ? number : T extends 'Int1' ? number : T extends 'Int2' ? number : T extends 'Int4' ? number : T extends 'Int8' ? bigint : T extends 'Int16' ? bigint : T extends 'Uint1' ? number : T extends 'Uint2' ? number : T extends 'Uint4' ? number : T extends 'Uint8' ? bigint : T extends 'Uint16' ? bigint : T extends 'Utf8' ? string : T extends 'Date' ? Date : T extends 'DateTime' ? Date : T extends 'Time' ? string : T extends 'Duration' ? string : T extends 'Uuid4' ? string : T extends 'Uuid7' ? string : T extends 'Undefined' ? undefined : T extends 'RowNumber' ? bigint : T extends 'IdentityId' ? string : never;
|
|
1115
|
-
type PrimitiveToValue<T extends Type> = T extends 'Blob' ? BlobValue : T extends 'Boolean' ? BooleanValue : T extends 'Decimal' ? DecimalValue : T extends 'Float4' ? Float4Value : T extends 'Float8' ? Float8Value : T extends 'Int1' ? Int1Value : T extends 'Int2' ? Int2Value : T extends 'Int4' ? Int4Value : T extends 'Int8' ? Int8Value : T extends 'Int16' ? Int16Value : T extends 'Uint1' ? Uint1Value : T extends 'Uint2' ? Uint2Value : T extends 'Uint4' ? Uint4Value : T extends 'Uint8' ? Uint8Value : T extends 'Uint16' ? Uint16Value : T extends 'Utf8' ? Utf8Value : T extends 'Date' ? DateValue : T extends 'DateTime' ? DateTimeValue : T extends 'Time' ? TimeValue : T extends 'Duration' ? DurationValue : T extends 'Uuid4' ? Uuid4Value : T extends 'Uuid7' ? Uuid7Value : T extends 'Undefined' ? UndefinedValue : T extends 'RowNumber' ? RowNumberValue : T extends 'IdentityId' ? IdentityIdValue : never;
|
|
1116
|
-
type InferSchema<S> = S extends PrimitiveSchemaNode<infer T> ? T extends Type ? PrimitiveToTS<T> : never : S extends ValueSchemaNode<infer T> ? T extends Type ? PrimitiveToValue<T> : never : S extends ObjectSchemaNode<infer P> ? {
|
|
903
|
+
type PrimitiveToTS<T extends BaseType> = T extends 'Blob' ? Uint8Array : T extends 'Boolean' ? boolean : T extends 'Decimal' ? string : T extends 'Float4' ? number : T extends 'Float8' ? number : T extends 'Int1' ? number : T extends 'Int2' ? number : T extends 'Int4' ? number : T extends 'Int8' ? bigint : T extends 'Int16' ? bigint : T extends 'Uint1' ? number : T extends 'Uint2' ? number : T extends 'Uint4' ? number : T extends 'Uint8' ? bigint : T extends 'Uint16' ? bigint : T extends 'Utf8' ? string : T extends 'Date' ? Date : T extends 'DateTime' ? Date : T extends 'Time' ? string : T extends 'Duration' ? string : T extends 'Uuid4' ? string : T extends 'Uuid7' ? string : T extends 'None' ? undefined : T extends 'IdentityId' ? string : never;
|
|
904
|
+
type PrimitiveToValue<T extends BaseType> = T extends 'Blob' ? BlobValue : T extends 'Boolean' ? BooleanValue : T extends 'Decimal' ? DecimalValue : T extends 'Float4' ? Float4Value : T extends 'Float8' ? Float8Value : T extends 'Int1' ? Int1Value : T extends 'Int2' ? Int2Value : T extends 'Int4' ? Int4Value : T extends 'Int8' ? Int8Value : T extends 'Int16' ? Int16Value : T extends 'Uint1' ? Uint1Value : T extends 'Uint2' ? Uint2Value : T extends 'Uint4' ? Uint4Value : T extends 'Uint8' ? Uint8Value : T extends 'Uint16' ? Uint16Value : T extends 'Utf8' ? Utf8Value : T extends 'Date' ? DateValue : T extends 'DateTime' ? DateTimeValue : T extends 'Time' ? TimeValue : T extends 'Duration' ? DurationValue : T extends 'Uuid4' ? Uuid4Value : T extends 'Uuid7' ? Uuid7Value : T extends 'None' ? NoneValue : T extends 'IdentityId' ? IdentityIdValue : never;
|
|
905
|
+
type InferSchema<S> = S extends PrimitiveSchemaNode<infer T> ? T extends BaseType ? PrimitiveToTS<T> : never : S extends ValueSchemaNode<infer T> ? T extends BaseType ? PrimitiveToValue<T> : never : S extends ObjectSchemaNode<infer P> ? {
|
|
1117
906
|
[K in keyof P]: InferSchema<P[K]>;
|
|
1118
907
|
} : S extends ArraySchemaNode<infer T> ? InferSchema<T>[] : S extends OptionalSchemaNode<infer T> ? InferSchema<T> | undefined : never;
|
|
1119
908
|
type InferSchemas<S extends readonly SchemaNode[]> = {
|
|
1120
909
|
[K in keyof S]: InferSchema<S[K]>[];
|
|
1121
910
|
};
|
|
1122
911
|
|
|
1123
|
-
/**
|
|
1124
|
-
* MIT License
|
|
1125
|
-
* Copyright (c) 2025 ReifyDB
|
|
1126
|
-
* See license.md file for full license text
|
|
1127
|
-
*/
|
|
1128
|
-
|
|
1129
912
|
declare class SchemaBuilder {
|
|
1130
913
|
static blob(): PrimitiveSchemaNode<'Blob'>;
|
|
1131
914
|
static bool(): PrimitiveSchemaNode<'Boolean'>;
|
|
@@ -1156,8 +939,7 @@ declare class SchemaBuilder {
|
|
|
1156
939
|
static uuid4(): PrimitiveSchemaNode<'Uuid4'>;
|
|
1157
940
|
static uuid7(): PrimitiveSchemaNode<'Uuid7'>;
|
|
1158
941
|
static uuid(): PrimitiveSchemaNode<'Uuid7'>;
|
|
1159
|
-
static
|
|
1160
|
-
static rownumber(): PrimitiveSchemaNode<'RowNumber'>;
|
|
942
|
+
static none(): PrimitiveSchemaNode<'None'>;
|
|
1161
943
|
static identityid(): PrimitiveSchemaNode<'IdentityId'>;
|
|
1162
944
|
static object<P extends Record<string, SchemaNode>>(properties: P): ObjectSchemaNode<P>;
|
|
1163
945
|
static array<T extends SchemaNode>(items: T): ArraySchemaNode<T>;
|
|
@@ -1184,34 +966,16 @@ declare class SchemaBuilder {
|
|
|
1184
966
|
static durationValue(): ValueSchemaNode<'Duration'>;
|
|
1185
967
|
static uuid4Value(): ValueSchemaNode<'Uuid4'>;
|
|
1186
968
|
static uuid7Value(): ValueSchemaNode<'Uuid7'>;
|
|
1187
|
-
static
|
|
969
|
+
static noneValue(): ValueSchemaNode<'None'>;
|
|
1188
970
|
static blobValue(): ValueSchemaNode<'Blob'>;
|
|
1189
|
-
static rowIdValue(): ValueSchemaNode<'RowNumber'>;
|
|
1190
971
|
static identityIdValue(): ValueSchemaNode<'IdentityId'>;
|
|
1191
972
|
}
|
|
1192
973
|
declare const Schema: typeof SchemaBuilder;
|
|
1193
974
|
|
|
1194
|
-
/**
|
|
1195
|
-
* MIT License
|
|
1196
|
-
* Copyright (c) 2025 ReifyDB
|
|
1197
|
-
* See license.md file for full license text
|
|
1198
|
-
*/
|
|
1199
|
-
|
|
1200
975
|
declare function parseValue(schema: SchemaNode, value: any): any;
|
|
1201
976
|
|
|
1202
|
-
/**
|
|
1203
|
-
* MIT License
|
|
1204
|
-
* Copyright (c) 2025 ReifyDB
|
|
1205
|
-
* See license.md file for full license text
|
|
1206
|
-
*/
|
|
1207
|
-
|
|
1208
977
|
declare function validateSchema(schema: SchemaNode, value: any): boolean;
|
|
1209
978
|
|
|
1210
|
-
/**
|
|
1211
|
-
* MIT License
|
|
1212
|
-
* Copyright (c) 2025 ReifyDB
|
|
1213
|
-
* See license.md file for full license text
|
|
1214
|
-
*/
|
|
1215
979
|
interface PrimitiveSchemaNode<T extends string = string> {
|
|
1216
980
|
kind: 'primitive';
|
|
1217
981
|
type: T;
|
|
@@ -1234,12 +998,6 @@ interface ValueSchemaNode<T extends string = string> {
|
|
|
1234
998
|
}
|
|
1235
999
|
type SchemaNode = PrimitiveSchemaNode | ObjectSchemaNode | ArraySchemaNode | OptionalSchemaNode | ValueSchemaNode;
|
|
1236
1000
|
|
|
1237
|
-
/**
|
|
1238
|
-
* MIT License
|
|
1239
|
-
* Copyright (c) 2025 ReifyDB
|
|
1240
|
-
* See license.md file for full license text
|
|
1241
|
-
*/
|
|
1242
|
-
|
|
1243
1001
|
type Params = (TypeValuePair | null)[] | Record<string, TypeValuePair | null>;
|
|
1244
1002
|
interface Frame {
|
|
1245
1003
|
columns: Column[];
|
|
@@ -1302,4 +1060,4 @@ type SingleFrameResult<S extends SchemaNode> = InferSchema<S>[];
|
|
|
1302
1060
|
*/
|
|
1303
1061
|
declare function asFrameResults<S extends readonly SchemaNode[]>(results: any): FrameResults<S>;
|
|
1304
1062
|
|
|
1305
|
-
export { type ArraySchemaNode, BlobValue, BooleanValue, type Column, DateTimeValue, DateValue, DecimalValue, type Diagnostic, type DiagnosticColumn, DurationValue, type ErrorResponse, Float4Value, Float8Value, type Fragment, type Frame, type FrameResults, IdentityIdValue, type InferSchema, type InferSchemas, Int16Value, Int1Value, Int2Value, Int4Value, Int8Value, type ObjectSchemaNode, type OptionalSchemaNode, type Params, type PrimitiveSchemaNode, type PrimitiveToTS, type PrimitiveToValue, ReifyError,
|
|
1063
|
+
export { type ArraySchemaNode, type BaseType, BlobValue, BooleanValue, type Column, DateTimeValue, DateValue, DecimalValue, type Diagnostic, type DiagnosticColumn, DurationValue, type ErrorResponse, Float4Value, Float8Value, type Fragment, type Frame, type FrameResults, IdentityIdValue, type InferSchema, type InferSchemas, Int16Value, Int1Value, Int2Value, Int4Value, Int8Value, NONE_VALUE, NoneValue, type ObjectSchemaNode, type OptionType, type OptionalSchemaNode, type Params, type PrimitiveSchemaNode, type PrimitiveToTS, type PrimitiveToValue, ReifyError, Schema, SchemaBuilder, type SchemaNode, type SingleFrameResult, TimeValue, type Type, type TypeValuePair, Uint16Value, Uint1Value, Uint2Value, Uint4Value, Uint8Value, Utf8Value, Uuid4Value, Uuid7Value, Value, type ValueSchemaNode, asFrameResults, decode, isOptionType, parseValue, unwrapOptionType, validateSchema };
|