@reifydb/core 0.0.1-alpha.1 → 0.0.1-alpha.10

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 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,21 +639,21 @@ 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
  */
@@ -659,7 +676,7 @@ declare class IntervalValue implements Value {
659
676
  */
660
677
  private static parseDuration;
661
678
  /**
662
- * Compare two intervals for equality
679
+ * Compare two durations for equality
663
680
  */
664
681
  equals(other: Value): boolean;
665
682
  encode(): TypeValuePair;
@@ -1063,7 +1080,7 @@ declare class IdentityIdValue implements Value {
1063
1080
  * See license.md file for full license text
1064
1081
  */
1065
1082
 
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";
1083
+ 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
1084
  interface TypeValuePair {
1068
1085
  type: Type;
1069
1086
  value: string;
@@ -1088,8 +1105,8 @@ declare function decode(pair: TypeValuePair): Value;
1088
1105
  * See license.md file for full license text
1089
1106
  */
1090
1107
 
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;
1108
+ 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;
1109
+ 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
1110
  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
1111
  [K in keyof P]: InferSchema<P[K]>;
1095
1112
  } : S extends ArraySchemaNode<infer T> ? InferSchema<T>[] : S extends OptionalSchemaNode<infer T> ? InferSchema<T> | undefined : never;
@@ -1105,8 +1122,9 @@ type InferSchemas<S extends readonly SchemaNode[]> = {
1105
1122
 
1106
1123
  declare class SchemaBuilder {
1107
1124
  static blob(): PrimitiveSchemaNode<'Blob'>;
1108
- static bool(): PrimitiveSchemaNode<'Bool'>;
1109
- static boolean(): PrimitiveSchemaNode<'Bool'>;
1125
+ static bool(): PrimitiveSchemaNode<'Boolean'>;
1126
+ static boolean(): PrimitiveSchemaNode<'Boolean'>;
1127
+ static decimal(): PrimitiveSchemaNode<'Decimal'>;
1110
1128
  static float4(): PrimitiveSchemaNode<'Float4'>;
1111
1129
  static float8(): PrimitiveSchemaNode<'Float8'>;
1112
1130
  static float(): PrimitiveSchemaNode<'Float8'>;
@@ -1128,7 +1146,7 @@ declare class SchemaBuilder {
1128
1146
  static date(): PrimitiveSchemaNode<'Date'>;
1129
1147
  static datetime(): PrimitiveSchemaNode<'DateTime'>;
1130
1148
  static time(): PrimitiveSchemaNode<'Time'>;
1131
- static interval(): PrimitiveSchemaNode<'Interval'>;
1149
+ static duration(): PrimitiveSchemaNode<'Duration'>;
1132
1150
  static uuid4(): PrimitiveSchemaNode<'Uuid4'>;
1133
1151
  static uuid7(): PrimitiveSchemaNode<'Uuid7'>;
1134
1152
  static uuid(): PrimitiveSchemaNode<'Uuid7'>;
@@ -1139,7 +1157,8 @@ declare class SchemaBuilder {
1139
1157
  static array<T extends SchemaNode>(items: T): ArraySchemaNode<T>;
1140
1158
  static optional<T extends SchemaNode>(schema: T): OptionalSchemaNode<T>;
1141
1159
  static number(): PrimitiveSchemaNode<'Float8'>;
1142
- static boolValue(): ValueSchemaNode<'Bool'>;
1160
+ static booleanValue(): ValueSchemaNode<'Boolean'>;
1161
+ static decimalValue(): ValueSchemaNode<'Decimal'>;
1143
1162
  static int1Value(): ValueSchemaNode<'Int1'>;
1144
1163
  static int2Value(): ValueSchemaNode<'Int2'>;
1145
1164
  static int4Value(): ValueSchemaNode<'Int4'>;
@@ -1156,7 +1175,7 @@ declare class SchemaBuilder {
1156
1175
  static dateValue(): ValueSchemaNode<'Date'>;
1157
1176
  static dateTimeValue(): ValueSchemaNode<'DateTime'>;
1158
1177
  static timeValue(): ValueSchemaNode<'Time'>;
1159
- static intervalValue(): ValueSchemaNode<'Interval'>;
1178
+ static durationValue(): ValueSchemaNode<'Duration'>;
1160
1179
  static uuid4Value(): ValueSchemaNode<'Uuid4'>;
1161
1180
  static uuid7Value(): ValueSchemaNode<'Uuid7'>;
1162
1181
  static undefinedValue(): ValueSchemaNode<'Undefined'>;
@@ -1221,19 +1240,19 @@ interface Frame {
1221
1240
  }
1222
1241
  interface DiagnosticColumn {
1223
1242
  name: string;
1224
- ty: Type;
1243
+ type: Type;
1225
1244
  }
1226
- interface Span {
1227
- offset: number;
1228
- line: number;
1229
- fragment: string;
1245
+ interface Fragment {
1246
+ text: string;
1247
+ line?: number;
1248
+ column?: number;
1230
1249
  }
1231
1250
  interface Diagnostic {
1232
1251
  code: string;
1233
1252
  statement?: string;
1234
1253
  message: string;
1235
1254
  column?: DiagnosticColumn;
1236
- span?: Span;
1255
+ fragment?: Fragment;
1237
1256
  label?: string;
1238
1257
  help?: string;
1239
1258
  notes: Array<string>;
@@ -1241,7 +1260,7 @@ interface Diagnostic {
1241
1260
  }
1242
1261
  interface Column {
1243
1262
  name: string;
1244
- ty: Type;
1263
+ type: Type;
1245
1264
  data: string[];
1246
1265
  }
1247
1266
  interface ErrorResponse {
@@ -1255,7 +1274,7 @@ declare class ReifyError extends Error {
1255
1274
  readonly code: string;
1256
1275
  readonly statement?: string;
1257
1276
  readonly column?: DiagnosticColumn;
1258
- readonly span?: Span;
1277
+ readonly fragment?: Fragment;
1259
1278
  readonly label?: string;
1260
1279
  readonly help?: string;
1261
1280
  readonly notes: string[];
@@ -1277,4 +1296,4 @@ type SingleFrameResult<S extends SchemaNode> = InferSchema<S>[];
1277
1296
  */
1278
1297
  declare function asFrameResults<S extends readonly SchemaNode[]>(results: any): FrameResults<S>;
1279
1298
 
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 };
1299
+ 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 };