@reifydb/core 0.0.1 → 0.1.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 (141) hide show
  1. package/dist/constant.d.ts +7 -0
  2. package/dist/constant.d.ts.map +1 -0
  3. package/dist/constant.js +7 -0
  4. package/dist/constant.js.map +1 -0
  5. package/dist/decoder.d.ts +8 -0
  6. package/dist/decoder.d.ts.map +1 -0
  7. package/dist/decoder.js +59 -0
  8. package/dist/decoder.js.map +1 -0
  9. package/dist/index.d.ts +81 -56
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +190 -84
  12. package/dist/index.js.map +1 -1
  13. package/dist/schema/builder.d.ts +45 -0
  14. package/dist/schema/builder.d.ts.map +1 -0
  15. package/dist/schema/builder.js +114 -0
  16. package/dist/schema/builder.js.map +1 -0
  17. package/dist/schema/index.d.ts +11 -0
  18. package/dist/schema/index.d.ts.map +1 -0
  19. package/dist/schema/index.js +12 -0
  20. package/dist/schema/index.js.map +1 -0
  21. package/dist/schema/inference.d.ts +16 -0
  22. package/dist/schema/inference.d.ts.map +1 -0
  23. package/dist/schema/inference.js +7 -0
  24. package/dist/schema/inference.js.map +1 -0
  25. package/dist/schema/parser.d.ts +8 -0
  26. package/dist/schema/parser.d.ts.map +1 -0
  27. package/dist/schema/parser.js +96 -0
  28. package/dist/schema/parser.js.map +1 -0
  29. package/dist/schema/simple-test.d.ts +7 -0
  30. package/dist/schema/simple-test.d.ts.map +1 -0
  31. package/dist/schema/simple-test.js +26 -0
  32. package/dist/schema/simple-test.js.map +1 -0
  33. package/dist/schema/test-refactor.d.ts +7 -0
  34. package/dist/schema/test-refactor.d.ts.map +1 -0
  35. package/dist/schema/test-refactor.js +97 -0
  36. package/dist/schema/test-refactor.js.map +1 -0
  37. package/dist/schema/types.d.ts +27 -0
  38. package/dist/schema/types.d.ts.map +1 -0
  39. package/dist/schema/types.js +7 -0
  40. package/dist/schema/types.js.map +1 -0
  41. package/dist/schema/validator.d.ts +8 -0
  42. package/dist/schema/validator.d.ts.map +1 -0
  43. package/dist/schema/validator.js +79 -0
  44. package/dist/schema/validator.js.map +1 -0
  45. package/dist/value/blob.d.ts +85 -0
  46. package/dist/value/blob.d.ts.map +1 -0
  47. package/dist/value/blob.js +255 -0
  48. package/dist/value/blob.js.map +1 -0
  49. package/dist/value/bool.d.ts +16 -0
  50. package/dist/value/bool.d.ts.map +1 -0
  51. package/dist/value/bool.js +46 -0
  52. package/dist/value/bool.js.map +1 -0
  53. package/dist/value/date.d.ts +71 -0
  54. package/dist/value/date.d.ts.map +1 -0
  55. package/dist/value/date.js +261 -0
  56. package/dist/value/date.js.map +1 -0
  57. package/dist/value/datetime.d.ts +99 -0
  58. package/dist/value/datetime.d.ts.map +1 -0
  59. package/dist/value/datetime.js +401 -0
  60. package/dist/value/datetime.js.map +1 -0
  61. package/dist/value/float4.d.ts +19 -0
  62. package/dist/value/float4.d.ts.map +1 -0
  63. package/dist/value/float4.js +68 -0
  64. package/dist/value/float4.js.map +1 -0
  65. package/dist/value/float8.d.ts +16 -0
  66. package/dist/value/float8.d.ts.map +1 -0
  67. package/dist/value/float8.js +44 -0
  68. package/dist/value/float8.js.map +1 -0
  69. package/dist/value/index.d.ts +38 -0
  70. package/dist/value/index.d.ts.map +1 -0
  71. package/dist/value/index.js +31 -0
  72. package/dist/value/index.js.map +1 -0
  73. package/dist/value/int1.d.ts +18 -0
  74. package/dist/value/int1.d.ts.map +1 -0
  75. package/dist/value/int1.js +46 -0
  76. package/dist/value/int1.js.map +1 -0
  77. package/dist/value/int16.d.ts +18 -0
  78. package/dist/value/int16.d.ts.map +1 -0
  79. package/dist/value/int16.js +67 -0
  80. package/dist/value/int16.js.map +1 -0
  81. package/dist/value/int2.d.ts +18 -0
  82. package/dist/value/int2.d.ts.map +1 -0
  83. package/dist/value/int2.js +46 -0
  84. package/dist/value/int2.js.map +1 -0
  85. package/dist/value/int4.d.ts +18 -0
  86. package/dist/value/int4.d.ts.map +1 -0
  87. package/dist/value/int4.js +46 -0
  88. package/dist/value/int4.js.map +1 -0
  89. package/dist/value/int8.d.ts +18 -0
  90. package/dist/value/int8.d.ts.map +1 -0
  91. package/dist/value/int8.js +53 -0
  92. package/dist/value/int8.js.map +1 -0
  93. package/dist/value/interval.d.ts +144 -0
  94. package/dist/value/interval.d.ts.map +1 -0
  95. package/dist/value/interval.js +357 -0
  96. package/dist/value/interval.js.map +1 -0
  97. package/dist/value/rowid.d.ts +18 -0
  98. package/dist/value/rowid.d.ts.map +1 -0
  99. package/dist/value/rowid.js +53 -0
  100. package/dist/value/rowid.js.map +1 -0
  101. package/dist/value/time.d.ts +74 -0
  102. package/dist/value/time.d.ts.map +1 -0
  103. package/dist/value/time.js +214 -0
  104. package/dist/value/time.js.map +1 -0
  105. package/dist/value/uint1.d.ts +18 -0
  106. package/dist/value/uint1.d.ts.map +1 -0
  107. package/dist/value/uint1.js +46 -0
  108. package/dist/value/uint1.js.map +1 -0
  109. package/dist/value/uint16.d.ts +18 -0
  110. package/dist/value/uint16.d.ts.map +1 -0
  111. package/dist/value/uint16.js +67 -0
  112. package/dist/value/uint16.js.map +1 -0
  113. package/dist/value/uint2.d.ts +18 -0
  114. package/dist/value/uint2.d.ts.map +1 -0
  115. package/dist/value/uint2.js +46 -0
  116. package/dist/value/uint2.js.map +1 -0
  117. package/dist/value/uint4.d.ts +18 -0
  118. package/dist/value/uint4.d.ts.map +1 -0
  119. package/dist/value/uint4.js +46 -0
  120. package/dist/value/uint4.js.map +1 -0
  121. package/dist/value/uint8.d.ts +19 -0
  122. package/dist/value/uint8.d.ts.map +1 -0
  123. package/dist/value/uint8.js +58 -0
  124. package/dist/value/uint8.js.map +1 -0
  125. package/dist/value/undefined.d.ts +48 -0
  126. package/dist/value/undefined.d.ts.map +1 -0
  127. package/dist/value/undefined.js +77 -0
  128. package/dist/value/undefined.js.map +1 -0
  129. package/dist/value/utf8.d.ts +16 -0
  130. package/dist/value/utf8.d.ts.map +1 -0
  131. package/dist/value/utf8.js +39 -0
  132. package/dist/value/utf8.js.map +1 -0
  133. package/dist/value/uuid4.d.ts +69 -0
  134. package/dist/value/uuid4.d.ts.map +1 -0
  135. package/dist/value/uuid4.js +162 -0
  136. package/dist/value/uuid4.js.map +1 -0
  137. package/dist/value/uuid7.d.ts +74 -0
  138. package/dist/value/uuid7.d.ts.map +1 -0
  139. package/dist/value/uuid7.js +175 -0
  140. package/dist/value/uuid7.js.map +1 -0
  141. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MIT License
3
+ * Copyright (c) 2025 ReifyDB
4
+ * See license.md file for full license text
5
+ */
6
+ export declare const UNDEFINED_VALUE = "\u27EAundefined\u27EB";
7
+ //# sourceMappingURL=constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,eAAe,0BAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MIT License
3
+ * Copyright (c) 2025 ReifyDB
4
+ * See license.md file for full license text
5
+ */
6
+ export const UNDEFINED_VALUE = "⟪undefined⟫";
7
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MIT License
3
+ * Copyright (c) 2025 ReifyDB
4
+ * See license.md file for full license text
5
+ */
6
+ import { Value, TypeValuePair } from './value';
7
+ export declare function decode(pair: TypeValuePair): Value;
8
+ //# sourceMappingURL=decoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../src/decoder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKH,KAAK,EAAE,aAAa,EACvB,MAAM,SAAS,CAAC;AAGjB,wBAAgB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK,CAmDjD"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * MIT License
3
+ * Copyright (c) 2025 ReifyDB
4
+ * See license.md file for full license text
5
+ */
6
+ import { BlobValue, BoolValue, DateValue, DateTimeValue, Float4Value, Float8Value, Int1Value, Int2Value, Int4Value, Int8Value, Int16Value, IntervalValue, RowIdValue, TimeValue, Uint1Value, Uint2Value, Uint4Value, Uint8Value, Uint16Value, UndefinedValue, Utf8Value, Uuid4Value, Uuid7Value } from './value';
7
+ export function decode(pair) {
8
+ switch (pair.type) {
9
+ case "Blob":
10
+ return BlobValue.parse(pair.value);
11
+ case "Bool":
12
+ return BoolValue.parse(pair.value);
13
+ case "Date":
14
+ return DateValue.parse(pair.value);
15
+ case "DateTime":
16
+ return DateTimeValue.parse(pair.value);
17
+ case "Float4":
18
+ return Float4Value.parse(pair.value);
19
+ case "Float8":
20
+ return Float8Value.parse(pair.value);
21
+ case "Int1":
22
+ return Int1Value.parse(pair.value);
23
+ case "Int2":
24
+ return Int2Value.parse(pair.value);
25
+ case "Int4":
26
+ return Int4Value.parse(pair.value);
27
+ case "Int8":
28
+ return Int8Value.parse(pair.value);
29
+ case "Int16":
30
+ return Int16Value.parse(pair.value);
31
+ case "Interval":
32
+ return IntervalValue.parse(pair.value);
33
+ case "RowId":
34
+ return RowIdValue.parse(pair.value);
35
+ case "Time":
36
+ return TimeValue.parse(pair.value);
37
+ case "Uint1":
38
+ return Uint1Value.parse(pair.value);
39
+ case "Uint2":
40
+ return Uint2Value.parse(pair.value);
41
+ case "Uint4":
42
+ return Uint4Value.parse(pair.value);
43
+ case "Uint8":
44
+ return Uint8Value.parse(pair.value);
45
+ case "Uint16":
46
+ return Uint16Value.parse(pair.value);
47
+ case "Undefined":
48
+ return UndefinedValue.parse(pair.value);
49
+ case "Utf8":
50
+ return Utf8Value.parse(pair.value);
51
+ case "Uuid4":
52
+ return Uuid4Value.parse(pair.value);
53
+ case "Uuid7":
54
+ return Uuid7Value.parse(pair.value);
55
+ default:
56
+ throw new Error(`Unsupported type: ${pair.type}`);
57
+ }
58
+ }
59
+ //# sourceMappingURL=decoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoder.js","sourceRoot":"","sources":["../src/decoder.ts"],"names":[],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -96,11 +96,11 @@ declare class BlobValue implements Value {
96
96
  * See license.md file for full license text
97
97
  */
98
98
 
99
- declare class BoolValue implements Value {
99
+ declare class BooleanValue implements Value {
100
100
  readonly type: Type;
101
101
  readonly value?: boolean;
102
102
  constructor(value?: boolean);
103
- static parse(str: string): BoolValue;
103
+ static parse(str: string): BooleanValue;
104
104
  valueOf(): boolean | undefined;
105
105
  toString(): string;
106
106
  /**
@@ -364,6 +364,23 @@ declare class DateTimeValue implements Value {
364
364
  encode(): TypeValuePair;
365
365
  }
366
366
 
367
+ /**
368
+ * MIT License
369
+ * Copyright (c) 2025 ReifyDB
370
+ * See license.md file for full license text
371
+ */
372
+
373
+ declare class DecimalValue implements Value {
374
+ readonly type: Type;
375
+ readonly value?: string;
376
+ constructor(value?: string);
377
+ static parse(str: string): DecimalValue;
378
+ valueOf(): string | undefined;
379
+ toString(): string;
380
+ equals(other: Value): boolean;
381
+ encode(): TypeValuePair;
382
+ }
383
+
367
384
  /**
368
385
  * MIT License
369
386
  * Copyright (c) 2025 ReifyDB
@@ -524,10 +541,10 @@ declare class Int16Value implements Value {
524
541
  */
525
542
 
526
543
  /**
527
- * An interval value representing a duration between two points in time.
544
+ * A duration value representing a time span or elapsed time.
528
545
  * Internally stored as months, days, and nanoseconds.
529
546
  */
530
- declare class IntervalValue implements Value {
547
+ declare class DurationValue implements Value {
531
548
  readonly type: Type;
532
549
  private readonly months?;
533
550
  private readonly days?;
@@ -538,61 +555,61 @@ declare class IntervalValue implements Value {
538
555
  nanos: bigint;
539
556
  } | string);
540
557
  /**
541
- * Create a new interval from months, days, and nanoseconds
558
+ * Create a new duration from months, days, and nanoseconds
542
559
  */
543
- static new(months: number, days: number, nanos: bigint): IntervalValue;
560
+ static new(months: number, days: number, nanos: bigint): DurationValue;
544
561
  /**
545
- * Create an interval from seconds
562
+ * Create a duration from seconds
546
563
  */
547
- static fromSeconds(seconds: number): IntervalValue;
564
+ static fromSeconds(seconds: number): DurationValue;
548
565
  /**
549
- * Create an interval from milliseconds
566
+ * Create a duration from milliseconds
550
567
  */
551
- static fromMilliseconds(milliseconds: number): IntervalValue;
568
+ static fromMilliseconds(milliseconds: number): DurationValue;
552
569
  /**
553
- * Create an interval from microseconds
570
+ * Create a duration from microseconds
554
571
  */
555
- static fromMicroseconds(microseconds: number): IntervalValue;
572
+ static fromMicroseconds(microseconds: number): DurationValue;
556
573
  /**
557
- * Create an interval from nanoseconds
574
+ * Create a duration from nanoseconds
558
575
  */
559
- static fromNanoseconds(nanoseconds: bigint): IntervalValue;
576
+ static fromNanoseconds(nanoseconds: bigint): DurationValue;
560
577
  /**
561
- * Create an interval from minutes
578
+ * Create a duration from minutes
562
579
  */
563
- static fromMinutes(minutes: number): IntervalValue;
580
+ static fromMinutes(minutes: number): DurationValue;
564
581
  /**
565
- * Create an interval from hours
582
+ * Create a duration from hours
566
583
  */
567
- static fromHours(hours: number): IntervalValue;
584
+ static fromHours(hours: number): DurationValue;
568
585
  /**
569
- * Create an interval from days
586
+ * Create a duration from days
570
587
  */
571
- static fromDays(days: number): IntervalValue;
588
+ static fromDays(days: number): DurationValue;
572
589
  /**
573
- * Create an interval from weeks
590
+ * Create a duration from weeks
574
591
  */
575
- static fromWeeks(weeks: number): IntervalValue;
592
+ static fromWeeks(weeks: number): DurationValue;
576
593
  /**
577
- * Create an interval from months
594
+ * Create a duration from months
578
595
  */
579
- static fromMonths(months: number): IntervalValue;
596
+ static fromMonths(months: number): DurationValue;
580
597
  /**
581
- * Create an interval from years
598
+ * Create a duration from years
582
599
  */
583
- static fromYears(years: number): IntervalValue;
600
+ static fromYears(years: number): DurationValue;
584
601
  /**
585
- * Create a zero interval
602
+ * Create a zero duration
586
603
  */
587
- static zero(): IntervalValue;
604
+ static zero(): DurationValue;
588
605
  /**
589
- * Get default interval (zero)
606
+ * Get default duration (zero)
590
607
  */
591
- static default(): IntervalValue;
608
+ static default(): DurationValue;
592
609
  /**
593
- * Parse an interval string in ISO 8601 duration format
610
+ * Parse a duration string in ISO 8601 duration format
594
611
  */
595
- static parse(str: string): IntervalValue;
612
+ static parse(str: string): DurationValue;
596
613
  /**
597
614
  * Get total seconds (truncated)
598
615
  */
@@ -622,24 +639,29 @@ declare class IntervalValue implements Value {
622
639
  */
623
640
  getNanos(): bigint | undefined;
624
641
  /**
625
- * Check if interval is positive (any component > 0)
642
+ * Check if duration is positive (any component > 0)
626
643
  */
627
644
  isPositive(): boolean;
628
645
  /**
629
- * Check if interval is negative (any component < 0)
646
+ * Check if duration is negative (any component < 0)
630
647
  */
631
648
  isNegative(): boolean;
632
649
  /**
633
- * Get absolute value of interval
650
+ * Get absolute value of duration
634
651
  */
635
- abs(): IntervalValue;
652
+ abs(): DurationValue;
636
653
  /**
637
- * Negate the interval
654
+ * Negate the duration
638
655
  */
639
- negate(): IntervalValue;
656
+ negate(): DurationValue;
640
657
  /**
641
658
  * Format as ISO 8601 duration string
642
659
  */
660
+ toIsoString(): string;
661
+ /**
662
+ * Format as human-readable duration string
663
+ * Examples: "1 year 2 mons 3 days 04:05:06.789", "3 days", "00:00:01.5"
664
+ */
643
665
  toString(): string;
644
666
  valueOf(): {
645
667
  months: number;
@@ -659,9 +681,10 @@ declare class IntervalValue implements Value {
659
681
  */
660
682
  private static parseDuration;
661
683
  /**
662
- * Compare two intervals for equality
684
+ * Compare two durations for equality
663
685
  */
664
686
  equals(other: Value): boolean;
687
+ toJSON(): string;
665
688
  encode(): TypeValuePair;
666
689
  }
667
690
 
@@ -1063,7 +1086,7 @@ declare class IdentityIdValue implements Value {
1063
1086
  * See license.md file for full license text
1064
1087
  */
1065
1088
 
1066
- type Type = "Blob" | "Bool" | "Float4" | "Float8" | "Int1" | "Int2" | "Int4" | "Int8" | "Int16" | "Uint1" | "Uint2" | "Uint4" | "Uint8" | "Uint16" | "Utf8" | "Date" | "DateTime" | "Time" | "Interval" | "Uuid4" | "Uuid7" | "Undefined" | "RowNumber" | "IdentityId";
1089
+ type Type = "Blob" | "Boolean" | "Decimal" | "Float4" | "Float8" | "Int1" | "Int2" | "Int4" | "Int8" | "Int16" | "Uint1" | "Uint2" | "Uint4" | "Uint8" | "Uint16" | "Utf8" | "Date" | "DateTime" | "Time" | "Duration" | "Uuid4" | "Uuid7" | "Undefined" | "RowNumber" | "IdentityId";
1067
1090
  interface TypeValuePair {
1068
1091
  type: Type;
1069
1092
  value: string;
@@ -1088,8 +1111,8 @@ declare function decode(pair: TypeValuePair): Value;
1088
1111
  * See license.md file for full license text
1089
1112
  */
1090
1113
 
1091
- type PrimitiveToTS<T extends Type> = T extends 'Blob' ? Uint8Array : T extends 'Bool' ? boolean : 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 'Interval' ? string : T extends 'Uuid4' ? string : T extends 'Uuid7' ? string : T extends 'Undefined' ? undefined : T extends 'RowNumber' ? bigint : T extends 'IdentityId' ? string : never;
1092
- type PrimitiveToValue<T extends Type> = T extends 'Blob' ? BlobValue : T extends 'Bool' ? BoolValue : 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 'Interval' ? IntervalValue : T extends 'Uuid4' ? Uuid4Value : T extends 'Uuid7' ? Uuid7Value : T extends 'Undefined' ? UndefinedValue : T extends 'RowNumber' ? RowNumberValue : T extends 'IdentityId' ? IdentityIdValue : never;
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;
1093
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> ? {
1094
1117
  [K in keyof P]: InferSchema<P[K]>;
1095
1118
  } : S extends ArraySchemaNode<infer T> ? InferSchema<T>[] : S extends OptionalSchemaNode<infer T> ? InferSchema<T> | undefined : never;
@@ -1105,8 +1128,9 @@ type InferSchemas<S extends readonly SchemaNode[]> = {
1105
1128
 
1106
1129
  declare class SchemaBuilder {
1107
1130
  static blob(): PrimitiveSchemaNode<'Blob'>;
1108
- static bool(): PrimitiveSchemaNode<'Bool'>;
1109
- static boolean(): PrimitiveSchemaNode<'Bool'>;
1131
+ static bool(): PrimitiveSchemaNode<'Boolean'>;
1132
+ static boolean(): PrimitiveSchemaNode<'Boolean'>;
1133
+ static decimal(): PrimitiveSchemaNode<'Decimal'>;
1110
1134
  static float4(): PrimitiveSchemaNode<'Float4'>;
1111
1135
  static float8(): PrimitiveSchemaNode<'Float8'>;
1112
1136
  static float(): PrimitiveSchemaNode<'Float8'>;
@@ -1128,7 +1152,7 @@ declare class SchemaBuilder {
1128
1152
  static date(): PrimitiveSchemaNode<'Date'>;
1129
1153
  static datetime(): PrimitiveSchemaNode<'DateTime'>;
1130
1154
  static time(): PrimitiveSchemaNode<'Time'>;
1131
- static interval(): PrimitiveSchemaNode<'Interval'>;
1155
+ static duration(): PrimitiveSchemaNode<'Duration'>;
1132
1156
  static uuid4(): PrimitiveSchemaNode<'Uuid4'>;
1133
1157
  static uuid7(): PrimitiveSchemaNode<'Uuid7'>;
1134
1158
  static uuid(): PrimitiveSchemaNode<'Uuid7'>;
@@ -1139,7 +1163,8 @@ declare class SchemaBuilder {
1139
1163
  static array<T extends SchemaNode>(items: T): ArraySchemaNode<T>;
1140
1164
  static optional<T extends SchemaNode>(schema: T): OptionalSchemaNode<T>;
1141
1165
  static number(): PrimitiveSchemaNode<'Float8'>;
1142
- static boolValue(): ValueSchemaNode<'Bool'>;
1166
+ static booleanValue(): ValueSchemaNode<'Boolean'>;
1167
+ static decimalValue(): ValueSchemaNode<'Decimal'>;
1143
1168
  static int1Value(): ValueSchemaNode<'Int1'>;
1144
1169
  static int2Value(): ValueSchemaNode<'Int2'>;
1145
1170
  static int4Value(): ValueSchemaNode<'Int4'>;
@@ -1156,7 +1181,7 @@ declare class SchemaBuilder {
1156
1181
  static dateValue(): ValueSchemaNode<'Date'>;
1157
1182
  static dateTimeValue(): ValueSchemaNode<'DateTime'>;
1158
1183
  static timeValue(): ValueSchemaNode<'Time'>;
1159
- static intervalValue(): ValueSchemaNode<'Interval'>;
1184
+ static durationValue(): ValueSchemaNode<'Duration'>;
1160
1185
  static uuid4Value(): ValueSchemaNode<'Uuid4'>;
1161
1186
  static uuid7Value(): ValueSchemaNode<'Uuid7'>;
1162
1187
  static undefinedValue(): ValueSchemaNode<'Undefined'>;
@@ -1221,19 +1246,19 @@ interface Frame {
1221
1246
  }
1222
1247
  interface DiagnosticColumn {
1223
1248
  name: string;
1224
- ty: Type;
1249
+ type: Type;
1225
1250
  }
1226
- interface Span {
1227
- offset: number;
1228
- line: number;
1229
- fragment: string;
1251
+ interface Fragment {
1252
+ text: string;
1253
+ line?: number;
1254
+ column?: number;
1230
1255
  }
1231
1256
  interface Diagnostic {
1232
1257
  code: string;
1233
1258
  statement?: string;
1234
1259
  message: string;
1235
1260
  column?: DiagnosticColumn;
1236
- span?: Span;
1261
+ fragment?: Fragment;
1237
1262
  label?: string;
1238
1263
  help?: string;
1239
1264
  notes: Array<string>;
@@ -1241,7 +1266,7 @@ interface Diagnostic {
1241
1266
  }
1242
1267
  interface Column {
1243
1268
  name: string;
1244
- ty: Type;
1269
+ type: Type;
1245
1270
  data: string[];
1246
1271
  }
1247
1272
  interface ErrorResponse {
@@ -1255,7 +1280,7 @@ declare class ReifyError extends Error {
1255
1280
  readonly code: string;
1256
1281
  readonly statement?: string;
1257
1282
  readonly column?: DiagnosticColumn;
1258
- readonly span?: Span;
1283
+ readonly fragment?: Fragment;
1259
1284
  readonly label?: string;
1260
1285
  readonly help?: string;
1261
1286
  readonly notes: string[];
@@ -1277,4 +1302,4 @@ type SingleFrameResult<S extends SchemaNode> = InferSchema<S>[];
1277
1302
  */
1278
1303
  declare function asFrameResults<S extends readonly SchemaNode[]>(results: any): FrameResults<S>;
1279
1304
 
1280
- export { type ArraySchemaNode, BlobValue, BoolValue, type Column, DateTimeValue, DateValue, type Diagnostic, type DiagnosticColumn, type ErrorResponse, Float4Value, Float8Value, type Frame, type FrameResults, IdentityIdValue, type InferSchema, type InferSchemas, Int16Value, Int1Value, Int2Value, Int4Value, Int8Value, IntervalValue, type ObjectSchemaNode, type OptionalSchemaNode, type Params, type PrimitiveSchemaNode, type PrimitiveToTS, type PrimitiveToValue, ReifyError, RowNumberValue, Schema, SchemaBuilder, type SchemaNode, type SingleFrameResult, type Span, TimeValue, type Type, type TypeValuePair, UNDEFINED_VALUE, Uint16Value, Uint1Value, Uint2Value, Uint4Value, Uint8Value, UndefinedValue, Utf8Value, Uuid4Value, Uuid7Value, Value, type ValueSchemaNode, asFrameResults, decode, parseValue, validateSchema };
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, RowNumberValue, Schema, SchemaBuilder, type SchemaNode, type SingleFrameResult, TimeValue, type Type, type TypeValuePair, UNDEFINED_VALUE, Uint16Value, Uint1Value, Uint2Value, Uint4Value, Uint8Value, UndefinedValue, Utf8Value, Uuid4Value, Uuid7Value, Value, type ValueSchemaNode, asFrameResults, decode, parseValue, validateSchema };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAC"}