@quereus/quereus 4.8.0 → 4.10.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/src/core/database.d.ts +6 -0
- package/dist/src/core/database.d.ts.map +1 -1
- package/dist/src/core/database.js +45 -5
- package/dist/src/core/database.js.map +1 -1
- package/dist/src/core/statement.d.ts.map +1 -1
- package/dist/src/core/statement.js +74 -15
- package/dist/src/core/statement.js.map +1 -1
- package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
- package/dist/src/func/builtins/aggregate.js +88 -35
- package/dist/src/func/builtins/aggregate.js.map +1 -1
- package/dist/src/func/builtins/conversion.d.ts +5 -0
- package/dist/src/func/builtins/conversion.d.ts.map +1 -1
- package/dist/src/func/builtins/conversion.js +16 -2
- package/dist/src/func/builtins/conversion.js.map +1 -1
- package/dist/src/func/builtins/explain.d.ts.map +1 -1
- package/dist/src/func/builtins/explain.js +9 -2
- package/dist/src/func/builtins/explain.js.map +1 -1
- package/dist/src/func/builtins/index.d.ts.map +1 -1
- package/dist/src/func/builtins/index.js +5 -2
- package/dist/src/func/builtins/index.js.map +1 -1
- package/dist/src/func/builtins/scalar.d.ts.map +1 -1
- package/dist/src/func/builtins/scalar.js +4 -2
- package/dist/src/func/builtins/scalar.js.map +1 -1
- package/dist/src/func/builtins/string.d.ts +2 -0
- package/dist/src/func/builtins/string.d.ts.map +1 -1
- package/dist/src/func/builtins/string.js +60 -4
- package/dist/src/func/builtins/string.js.map +1 -1
- package/dist/src/func/registration.d.ts +6 -0
- package/dist/src/func/registration.d.ts.map +1 -1
- package/dist/src/func/registration.js +1 -0
- package/dist/src/func/registration.js.map +1 -1
- package/dist/src/index.d.ts +7 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +21 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/planner/building/constraint-builder.js +1 -1
- package/dist/src/planner/building/constraint-builder.js.map +1 -1
- package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
- package/dist/src/planner/nodes/scalar.js +13 -1
- package/dist/src/planner/nodes/scalar.js.map +1 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.d.ts.map +1 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +121 -51
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
- package/dist/src/planner/rules/shared/index-style-context.d.ts +14 -4
- package/dist/src/planner/rules/shared/index-style-context.d.ts.map +1 -1
- package/dist/src/planner/rules/shared/index-style-context.js +14 -4
- package/dist/src/planner/rules/shared/index-style-context.js.map +1 -1
- package/dist/src/runtime/emission-context.d.ts +14 -1
- package/dist/src/runtime/emission-context.d.ts.map +1 -1
- package/dist/src/runtime/emission-context.js +17 -5
- package/dist/src/runtime/emission-context.js.map +1 -1
- package/dist/src/runtime/emit/aggregate-setup.d.ts +44 -8
- package/dist/src/runtime/emit/aggregate-setup.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate-setup.js +79 -15
- package/dist/src/runtime/emit/aggregate-setup.js.map +1 -1
- package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate.js +21 -106
- package/dist/src/runtime/emit/aggregate.js.map +1 -1
- package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-table.js +212 -155
- package/dist/src/runtime/emit/alter-table.js.map +1 -1
- package/dist/src/runtime/emit/asof-scan.js +1 -1
- package/dist/src/runtime/emit/asof-scan.js.map +1 -1
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts +26 -12
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -1
- package/dist/src/runtime/emit/assertion-drop-guard.js +45 -26
- package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +6 -6
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.js +18 -20
- package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
- package/dist/src/runtime/emit/between.d.ts +2 -0
- package/dist/src/runtime/emit/between.d.ts.map +1 -1
- package/dist/src/runtime/emit/between.js +7 -8
- package/dist/src/runtime/emit/between.js.map +1 -1
- package/dist/src/runtime/emit/binary.d.ts +27 -5
- package/dist/src/runtime/emit/binary.d.ts.map +1 -1
- package/dist/src/runtime/emit/binary.js +278 -187
- package/dist/src/runtime/emit/binary.js.map +1 -1
- package/dist/src/runtime/emit/case.d.ts +34 -0
- package/dist/src/runtime/emit/case.d.ts.map +1 -1
- package/dist/src/runtime/emit/case.js +18 -11
- package/dist/src/runtime/emit/case.js.map +1 -1
- package/dist/src/runtime/emit/cast.d.ts +2 -0
- package/dist/src/runtime/emit/cast.d.ts.map +1 -1
- package/dist/src/runtime/emit/cast.js +7 -5
- package/dist/src/runtime/emit/cast.js.map +1 -1
- package/dist/src/runtime/emit/column-reference.d.ts +3 -1
- package/dist/src/runtime/emit/column-reference.d.ts.map +1 -1
- package/dist/src/runtime/emit/column-reference.js +6 -2
- package/dist/src/runtime/emit/column-reference.js.map +1 -1
- package/dist/src/runtime/emit/column-rename-cascade.d.ts +84 -0
- package/dist/src/runtime/emit/column-rename-cascade.d.ts.map +1 -0
- package/dist/src/runtime/emit/column-rename-cascade.js +134 -0
- package/dist/src/runtime/emit/column-rename-cascade.js.map +1 -0
- package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
- package/dist/src/runtime/emit/dml-executor.js +21 -0
- package/dist/src/runtime/emit/dml-executor.js.map +1 -1
- package/dist/src/runtime/emit/drop-column-guards.d.ts +82 -53
- package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-column-guards.js +155 -90
- package/dist/src/runtime/emit/drop-column-guards.js.map +1 -1
- package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-table.js +5 -0
- package/dist/src/runtime/emit/drop-table.js.map +1 -1
- package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-view.js +5 -0
- package/dist/src/runtime/emit/drop-view.js.map +1 -1
- package/dist/src/runtime/emit/expression-drop-guard.d.ts +57 -0
- package/dist/src/runtime/emit/expression-drop-guard.d.ts.map +1 -0
- package/dist/src/runtime/emit/expression-drop-guard.js +82 -0
- package/dist/src/runtime/emit/expression-drop-guard.js.map +1 -0
- package/dist/src/runtime/emit/filter.d.ts +1 -1
- package/dist/src/runtime/emit/filter.js +1 -1
- package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.js +18 -88
- package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
- package/dist/src/runtime/emit/literal.d.ts +14 -1
- package/dist/src/runtime/emit/literal.d.ts.map +1 -1
- package/dist/src/runtime/emit/literal.js +33 -7
- package/dist/src/runtime/emit/literal.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts +33 -10
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.js +158 -49
- package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view.js +3 -0
- package/dist/src/runtime/emit/materialized-view.js.map +1 -1
- package/dist/src/runtime/emit/parameter.d.ts +3 -1
- package/dist/src/runtime/emit/parameter.d.ts.map +1 -1
- package/dist/src/runtime/emit/parameter.js +7 -2
- package/dist/src/runtime/emit/parameter.js.map +1 -1
- package/dist/src/runtime/emit/scalar-function.d.ts +29 -1
- package/dist/src/runtime/emit/scalar-function.d.ts.map +1 -1
- package/dist/src/runtime/emit/scalar-function.js +66 -16
- package/dist/src/runtime/emit/scalar-function.js.map +1 -1
- package/dist/src/runtime/emit/scalar-op.d.ts +63 -0
- package/dist/src/runtime/emit/scalar-op.d.ts.map +1 -0
- package/dist/src/runtime/emit/scalar-op.js +37 -0
- package/dist/src/runtime/emit/scalar-op.js.map +1 -0
- package/dist/src/runtime/emit/scan.d.ts.map +1 -1
- package/dist/src/runtime/emit/scan.js +19 -1
- package/dist/src/runtime/emit/scan.js.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts +18 -8
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.js +29 -311
- package/dist/src/runtime/emit/temporal-arithmetic.js.map +1 -1
- package/dist/src/runtime/emit/unary.d.ts +2 -0
- package/dist/src/runtime/emit/unary.d.ts.map +1 -1
- package/dist/src/runtime/emit/unary.js +125 -53
- package/dist/src/runtime/emit/unary.js.map +1 -1
- package/dist/src/runtime/emitters.d.ts +22 -0
- package/dist/src/runtime/emitters.d.ts.map +1 -1
- package/dist/src/runtime/emitters.js +29 -0
- package/dist/src/runtime/emitters.js.map +1 -1
- package/dist/src/runtime/scalar-fusion.d.ts +47 -0
- package/dist/src/runtime/scalar-fusion.d.ts.map +1 -0
- package/dist/src/runtime/scalar-fusion.js +275 -0
- package/dist/src/runtime/scalar-fusion.js.map +1 -0
- package/dist/src/runtime/strict-flags.d.ts +9 -0
- package/dist/src/runtime/strict-flags.d.ts.map +1 -1
- package/dist/src/runtime/strict-flags.js +9 -0
- package/dist/src/runtime/strict-flags.js.map +1 -1
- package/dist/src/runtime/strict-fork.js +2 -2
- package/dist/src/runtime/strict-fork.js.map +1 -1
- package/dist/src/runtime/strict-representation.d.ts +78 -0
- package/dist/src/runtime/strict-representation.d.ts.map +1 -0
- package/dist/src/runtime/strict-representation.js +159 -0
- package/dist/src/runtime/strict-representation.js.map +1 -0
- package/dist/src/schema/assertion.d.ts +58 -0
- package/dist/src/schema/assertion.d.ts.map +1 -1
- package/dist/src/schema/assertion.js +78 -0
- package/dist/src/schema/assertion.js.map +1 -1
- package/dist/src/schema/catalog-persistability.d.ts +11 -3
- package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
- package/dist/src/schema/catalog-persistability.js +48 -29
- package/dist/src/schema/catalog-persistability.js.map +1 -1
- package/dist/src/schema/catalog.d.ts +22 -0
- package/dist/src/schema/catalog.d.ts.map +1 -1
- package/dist/src/schema/catalog.js +4 -1
- package/dist/src/schema/catalog.js.map +1 -1
- package/dist/src/schema/column-republication.d.ts +126 -0
- package/dist/src/schema/column-republication.d.ts.map +1 -0
- package/dist/src/schema/column-republication.js +121 -0
- package/dist/src/schema/column-republication.js.map +1 -0
- package/dist/src/schema/column-source-resolver.d.ts +29 -6
- package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
- package/dist/src/schema/column-source-resolver.js +78 -9
- package/dist/src/schema/column-source-resolver.js.map +1 -1
- package/dist/src/schema/expression-dependents.d.ts +160 -0
- package/dist/src/schema/expression-dependents.d.ts.map +1 -0
- package/dist/src/schema/expression-dependents.js +228 -0
- package/dist/src/schema/expression-dependents.js.map +1 -0
- package/dist/src/schema/function.d.ts +15 -0
- package/dist/src/schema/function.d.ts.map +1 -1
- package/dist/src/schema/function.js.map +1 -1
- package/dist/src/schema/object-dependency-closure.d.ts +127 -0
- package/dist/src/schema/object-dependency-closure.d.ts.map +1 -0
- package/dist/src/schema/object-dependency-closure.js +117 -0
- package/dist/src/schema/object-dependency-closure.js.map +1 -0
- package/dist/src/schema/object-ref-resolver.d.ts +83 -0
- package/dist/src/schema/object-ref-resolver.d.ts.map +1 -0
- package/dist/src/schema/object-ref-resolver.js +135 -0
- package/dist/src/schema/object-ref-resolver.js.map +1 -0
- package/dist/src/schema/rename/column-rename.d.ts +228 -0
- package/dist/src/schema/rename/column-rename.d.ts.map +1 -0
- package/dist/src/schema/rename/column-rename.js +1225 -0
- package/dist/src/schema/rename/column-rename.js.map +1 -0
- package/dist/src/schema/rename/self-qualifier-strip.d.ts +29 -0
- package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -0
- package/dist/src/schema/rename/self-qualifier-strip.js +267 -0
- package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -0
- package/dist/src/schema/rename/shared.d.ts +108 -0
- package/dist/src/schema/rename/shared.d.ts.map +1 -0
- package/dist/src/schema/rename/shared.js +49 -0
- package/dist/src/schema/rename/shared.js.map +1 -0
- package/dist/src/schema/rename/table-rename.d.ts +263 -0
- package/dist/src/schema/rename/table-rename.d.ts.map +1 -0
- package/dist/src/schema/rename/table-rename.js +860 -0
- package/dist/src/schema/rename/table-rename.js.map +1 -0
- package/dist/src/schema/rename-rewriter.d.ts +18 -278
- package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
- package/dist/src/schema/rename-rewriter.js +17 -1506
- package/dist/src/schema/rename-rewriter.js.map +1 -1
- package/dist/src/schema/schema-differ.d.ts.map +1 -1
- package/dist/src/schema/schema-differ.js +228 -21
- package/dist/src/schema/schema-differ.js.map +1 -1
- package/dist/src/types/builtin-types.d.ts.map +1 -1
- package/dist/src/types/builtin-types.js +29 -36
- package/dist/src/types/builtin-types.js.map +1 -1
- package/dist/src/types/cast-semantics.d.ts +7 -5
- package/dist/src/types/cast-semantics.d.ts.map +1 -1
- package/dist/src/types/cast-semantics.js +20 -9
- package/dist/src/types/cast-semantics.js.map +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/registry.d.ts.map +1 -1
- package/dist/src/types/registry.js +2 -1
- package/dist/src/types/registry.js.map +1 -1
- package/dist/src/types/temporal-ops.d.ts +119 -0
- package/dist/src/types/temporal-ops.d.ts.map +1 -0
- package/dist/src/types/temporal-ops.js +348 -0
- package/dist/src/types/temporal-ops.js.map +1 -0
- package/dist/src/types/temporal-types.d.ts +11 -0
- package/dist/src/types/temporal-types.d.ts.map +1 -1
- package/dist/src/types/temporal-types.js +87 -0
- package/dist/src/types/temporal-types.js.map +1 -1
- package/dist/src/util/affinity.d.ts +2 -1
- package/dist/src/util/affinity.d.ts.map +1 -1
- package/dist/src/util/affinity.js +16 -5
- package/dist/src/util/affinity.js.map +1 -1
- package/dist/src/util/ast-spine-clone.d.ts +2 -2
- package/dist/src/util/ast-spine-clone.js +2 -2
- package/dist/src/util/coercion.d.ts +22 -7
- package/dist/src/util/coercion.d.ts.map +1 -1
- package/dist/src/util/coercion.js +28 -15
- package/dist/src/util/coercion.js.map +1 -1
- package/dist/src/util/comparison.d.ts +25 -0
- package/dist/src/util/comparison.d.ts.map +1 -1
- package/dist/src/util/comparison.js +25 -0
- package/dist/src/util/comparison.js.map +1 -1
- package/dist/src/util/key-tuple-codec.d.ts +12 -3
- package/dist/src/util/key-tuple-codec.d.ts.map +1 -1
- package/dist/src/util/key-tuple-codec.js.map +1 -1
- package/dist/src/util/numeric-canonical.d.ts +26 -0
- package/dist/src/util/numeric-canonical.d.ts.map +1 -0
- package/dist/src/util/numeric-canonical.js +66 -0
- package/dist/src/util/numeric-canonical.js.map +1 -0
- package/dist/src/util/value-text.d.ts +48 -0
- package/dist/src/util/value-text.d.ts.map +1 -0
- package/dist/src/util/value-text.js +35 -0
- package/dist/src/util/value-text.js.map +1 -0
- package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.js +14 -5
- package/dist/src/vtab/memory/layer/manager.js.map +1 -1
- package/dist/src/vtab/module.d.ts +25 -0
- package/dist/src/vtab/module.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGpH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGhL,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGpH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGhL,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzG,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGjG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/src/types/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { PhysicalType, getPhysicalType, physicalTypeName, compareNulls } from '.
|
|
|
3
3
|
// Built-in types
|
|
4
4
|
export { NULL_TYPE, INTEGER_TYPE, REAL_TYPE, TEXT_TYPE, BLOB_TYPE, BOOLEAN_TYPE, NUMERIC_TYPE, ANY_TYPE, isNumericOrUnknownType, sharesSeekKeySpace } from './builtin-types.js';
|
|
5
5
|
// Temporal types
|
|
6
|
-
export { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
6
|
+
export { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESTAMP_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
7
7
|
// JSON type
|
|
8
8
|
export { JSON_TYPE } from './json-type.js';
|
|
9
9
|
// Type registry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,YAAY,EAAoB,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpH,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEhL,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,YAAY,EAAoB,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpH,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEhL,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzG,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEjG,uBAAuB;AACvB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/types/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmBrD;;GAEG;AACH,cAAM,YAAY;IACjB,OAAO,CAAC,KAAK,CAAkC;;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/types/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmBrD;;GAEG;AACH,cAAM,YAAY;IACjB,OAAO,CAAC,KAAK,CAAkC;;IA8C/C;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IASrC;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI9C;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW;IAKvD;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;;OAGG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW;CAsCpD;AAGD,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAEnE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NULL_TYPE, INTEGER_TYPE, REAL_TYPE, TEXT_TYPE, BLOB_TYPE, BOOLEAN_TYPE, NUMERIC_TYPE, ANY_TYPE, } from './builtin-types.js';
|
|
2
|
-
import { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
2
|
+
import { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESTAMP_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
3
3
|
import { JSON_TYPE } from './json-type.js';
|
|
4
4
|
import { createLogger } from '../common/logger.js';
|
|
5
5
|
const log = createLogger('types:registry');
|
|
@@ -23,6 +23,7 @@ class TypeRegistry {
|
|
|
23
23
|
this.registerType(DATE_TYPE);
|
|
24
24
|
this.registerType(TIME_TYPE);
|
|
25
25
|
this.registerType(DATETIME_TYPE);
|
|
26
|
+
this.registerType(TIMESTAMP_TYPE);
|
|
26
27
|
this.registerType(TIMESPAN_TYPE);
|
|
27
28
|
this.registerType(JSON_TYPE);
|
|
28
29
|
// Register common aliases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/types/registry.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","source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AAO,SAAS,CAAC;IAClB,CAAC;CACD;AAED,4BAA4B;AAC5B,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC7C,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IACnC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAwB;IACxD,OAAO,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,QAA4B;IACrD,OAAO,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Temporal } from 'temporal-polyfill';
|
|
2
|
+
import type { SqlValue } from '../common/types.js';
|
|
3
|
+
import type { LogicalType } from './logical-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* The single table of supported temporal arithmetic operations, keyed by
|
|
6
|
+
* `(operator, left operand kind, right operand kind)`.
|
|
7
|
+
*
|
|
8
|
+
* Two ways in, and they must agree:
|
|
9
|
+
* - from *declared* logical types, via {@link temporalOpCaseForTypes} — the planner
|
|
10
|
+
* (`BinaryOpNode.generateType`) announces the case's `resultType` and the emitter
|
|
11
|
+
* (`buildNumericOpSpec`) bakes the same case's `apply` into the per-row body. One
|
|
12
|
+
* function for both, so the announced type and the executed case cannot diverge;
|
|
13
|
+
* - from the *values*, via `tryTemporalArithmetic` — the per-row path taken only when a
|
|
14
|
+
* declared type settles nothing (TEXT / ANY / NULL / TIMESTAMP / a plugin type).
|
|
15
|
+
*
|
|
16
|
+
* Before this table existed, the set of supported combinations lived only as control
|
|
17
|
+
* flow inside `tryTemporalArithmetic`, so the planner could not consult it and
|
|
18
|
+
* announced the left operand's type for every temporal pair — DATE for
|
|
19
|
+
* `date - date`, INTEGER for `2 * timespan`. Callers of the declared type
|
|
20
|
+
* (the numeric-fast arithmetic path, `create table … as select`, view column types,
|
|
21
|
+
* `Statement.getColumnType`) were reading a type that did not predict the value.
|
|
22
|
+
*
|
|
23
|
+
* Lives in `types/` rather than `runtime/emit/` precisely because both sides import
|
|
24
|
+
* it; `types/` already depends on temporal-polyfill, so nothing new is pulled in.
|
|
25
|
+
*/
|
|
26
|
+
/** The coarse operand shape temporal arithmetic dispatches on. */
|
|
27
|
+
export type TemporalOperandKind = 'date' | 'time' | 'datetime' | 'timespan' | 'number';
|
|
28
|
+
/** True for the four kinds that make an operation *temporal*; `'number'` alone does not. */
|
|
29
|
+
export declare function isTemporalKind(kind: TemporalOperandKind | undefined): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Plan-time operand kind from a declared logical type.
|
|
32
|
+
*
|
|
33
|
+
* Identity against the registered singletons (the precedent set by
|
|
34
|
+
* `runtime/emit/unary.ts`'s TIMESPAN negation arm): a plugin-registered type that
|
|
35
|
+
* shadows a built-in name is a different object, so it fails identity and the caller
|
|
36
|
+
* falls back to runtime sniffing rather than mis-specializing.
|
|
37
|
+
*
|
|
38
|
+
* Returns undefined for TEXT / ANY / BLOB / NULL and for TIMESTAMP. TIMESTAMP is
|
|
39
|
+
* deliberately excluded: it is `isTemporal` but not `isNumeric`, it is an integer
|
|
40
|
+
* instant rather than a string temporal, and it appears in no case below — so
|
|
41
|
+
* `ts_col + 1` keeps taking the runtime-sniffed path and today's announced type.
|
|
42
|
+
*/
|
|
43
|
+
export declare function temporalKindOfType(logical: LogicalType): TemporalOperandKind | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Runtime operand kind from an actual value — the shape probes that used to sit at the
|
|
46
|
+
* top of `tryTemporalArithmetic`, with unchanged semantics.
|
|
47
|
+
*
|
|
48
|
+
* The four string shapes are mutually exclusive on canonical values, so probe order is
|
|
49
|
+
* not observable.
|
|
50
|
+
*
|
|
51
|
+
* `bigint` deliberately yields undefined rather than `'number'` — see the NOTE on the
|
|
52
|
+
* `*` / `/` number cases below.
|
|
53
|
+
*/
|
|
54
|
+
export declare function temporalKindOfValue(v: SqlValue): TemporalOperandKind | undefined;
|
|
55
|
+
/** The one home for the "no such combination" error, so both callers spell it alike. */
|
|
56
|
+
export declare function unsupportedTemporalOp(): never;
|
|
57
|
+
export interface TemporalOpCase {
|
|
58
|
+
/** Logical type of the result — what `BinaryOpNode.generateType` announces. */
|
|
59
|
+
readonly resultType: LogicalType;
|
|
60
|
+
/** Perform the operation on two non-null values. May throw; callers wrap. */
|
|
61
|
+
readonly apply: (v1: SqlValue, v2: SqlValue) => SqlValue;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a Temporal.Duration contains calendar units (years, months, weeks)
|
|
65
|
+
* that cannot be converted to a single time unit without a relativeTo reference.
|
|
66
|
+
*/
|
|
67
|
+
export declare function hasCalendarUnits(d: Temporal.Duration): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Scale each field of a duration by a factor.
|
|
70
|
+
* Works for both calendar and non-calendar durations.
|
|
71
|
+
*/
|
|
72
|
+
export declare function scaleDuration(d: Temporal.Duration, factor: number): Temporal.Duration;
|
|
73
|
+
/**
|
|
74
|
+
* Divide a duration's fields by a divisor, cascading remainders to smaller units.
|
|
75
|
+
* Cascade chain: years→months(×12), weeks→days(×7), days→hours(×24),
|
|
76
|
+
* hours→minutes(×60), minutes→seconds(×60), seconds→ms(×1000),
|
|
77
|
+
* ms→μs(×1000), μs→ns(×1000).
|
|
78
|
+
* Note: months cannot cascade to days (variable month length).
|
|
79
|
+
*/
|
|
80
|
+
export declare function divideDuration(d: Temporal.Duration, divisor: number): Temporal.Duration;
|
|
81
|
+
/**
|
|
82
|
+
* Look up the case for one `(operator, left kind, right kind)` triple.
|
|
83
|
+
* `undefined` means the combination is not supported.
|
|
84
|
+
*/
|
|
85
|
+
export declare function temporalOpCase(operator: string, left: TemporalOperandKind, right: TemporalOperandKind): TemporalOpCase | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* What a pair of DECLARED logical types settles about the operation, resolved once at
|
|
88
|
+
* plan/emit time.
|
|
89
|
+
*
|
|
90
|
+
* `kinds` absent means at least one declared type settles nothing (TEXT / ANY / NULL /
|
|
91
|
+
* TIMESTAMP / a plugin-registered type), so the caller must derive the kinds from the
|
|
92
|
+
* runtime values instead. `kinds` present with `entry` absent means both kinds are known
|
|
93
|
+
* and the table has no case for them — statically unsupported, whatever the values are.
|
|
94
|
+
*/
|
|
95
|
+
export interface TemporalTypeLookup {
|
|
96
|
+
readonly kinds?: readonly [TemporalOperandKind, TemporalOperandKind];
|
|
97
|
+
readonly entry?: TemporalOpCase;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The one route from two declared logical types to a case.
|
|
101
|
+
*
|
|
102
|
+
* Two callers must reach the same answer or the announced result type stops predicting
|
|
103
|
+
* the value: `BinaryOpNode.generateType` announces `entry.resultType`, and
|
|
104
|
+
* `buildNumericOpSpec`'s temporal branch emits a body that runs `entry.apply`. Neither
|
|
105
|
+
* re-spells the kind derivation, so the two cannot come to select different entries.
|
|
106
|
+
*/
|
|
107
|
+
export declare function temporalOpCaseForTypes(operator: string, left: LogicalType, right: LogicalType): TemporalTypeLookup;
|
|
108
|
+
/** Test-only view of the table's keys, so a spec can assert its shape without re-listing it. */
|
|
109
|
+
export declare function temporalOpCaseKeys(): readonly string[];
|
|
110
|
+
/**
|
|
111
|
+
* Run one case with the exact envelope `tryTemporalArithmetic` has always had:
|
|
112
|
+
* null propagation, then `apply`, with a malformed value degrading to null while an
|
|
113
|
+
* `UNSUPPORTED` error propagates.
|
|
114
|
+
*
|
|
115
|
+
* Both the runtime-sniffed path and the emit-time specialized path call this, so the
|
|
116
|
+
* two cannot diverge on null handling or on what a bad value does.
|
|
117
|
+
*/
|
|
118
|
+
export declare function runTemporalCase(entry: TemporalOpCase, v1: SqlValue, v2: SqlValue): SqlValue;
|
|
119
|
+
//# sourceMappingURL=temporal-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal-ops.d.ts","sourceRoot":"","sources":["../../../src/types/temporal-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,kEAAkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEvF,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,mBAAmB,GAAG,SAAS,CAWxF;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAchF;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,IAAI,KAAK,CAK7C;AAED,MAAM,WAAW,cAAc;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,KAAK,QAAQ,CAAC;CACzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAE9D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAarF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAmDvF;AAgKD;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,mBAAmB,GACxB,cAAc,GAAG,SAAS,CAE5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,GAChB,kBAAkB,CAKpB;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEtD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAU3F"}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { Temporal } from 'temporal-polyfill';
|
|
2
|
+
import { StatusCode } from '../common/types.js';
|
|
3
|
+
import { QuereusError } from '../common/errors.js';
|
|
4
|
+
import { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
5
|
+
import { REAL_TYPE } from './builtin-types.js';
|
|
6
|
+
/** True for the four kinds that make an operation *temporal*; `'number'` alone does not. */
|
|
7
|
+
export function isTemporalKind(kind) {
|
|
8
|
+
return kind !== undefined && kind !== 'number';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Plan-time operand kind from a declared logical type.
|
|
12
|
+
*
|
|
13
|
+
* Identity against the registered singletons (the precedent set by
|
|
14
|
+
* `runtime/emit/unary.ts`'s TIMESPAN negation arm): a plugin-registered type that
|
|
15
|
+
* shadows a built-in name is a different object, so it fails identity and the caller
|
|
16
|
+
* falls back to runtime sniffing rather than mis-specializing.
|
|
17
|
+
*
|
|
18
|
+
* Returns undefined for TEXT / ANY / BLOB / NULL and for TIMESTAMP. TIMESTAMP is
|
|
19
|
+
* deliberately excluded: it is `isTemporal` but not `isNumeric`, it is an integer
|
|
20
|
+
* instant rather than a string temporal, and it appears in no case below — so
|
|
21
|
+
* `ts_col + 1` keeps taking the runtime-sniffed path and today's announced type.
|
|
22
|
+
*/
|
|
23
|
+
export function temporalKindOfType(logical) {
|
|
24
|
+
if (logical === DATE_TYPE)
|
|
25
|
+
return 'date';
|
|
26
|
+
if (logical === TIME_TYPE)
|
|
27
|
+
return 'time';
|
|
28
|
+
if (logical === DATETIME_TYPE)
|
|
29
|
+
return 'datetime';
|
|
30
|
+
if (logical === TIMESPAN_TYPE)
|
|
31
|
+
return 'timespan';
|
|
32
|
+
// NULL_TYPE is not `isNumeric`, so a NULL-typed operand lands here as undefined
|
|
33
|
+
// and no case is selected. Either way the answer is NULL — both
|
|
34
|
+
// `tryTemporalArithmetic` and `runTemporalCase` short-circuit on a null value
|
|
35
|
+
// before any kind is consulted.
|
|
36
|
+
if (logical.isNumeric && !logical.isTemporal)
|
|
37
|
+
return 'number';
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Runtime operand kind from an actual value — the shape probes that used to sit at the
|
|
42
|
+
* top of `tryTemporalArithmetic`, with unchanged semantics.
|
|
43
|
+
*
|
|
44
|
+
* The four string shapes are mutually exclusive on canonical values, so probe order is
|
|
45
|
+
* not observable.
|
|
46
|
+
*
|
|
47
|
+
* `bigint` deliberately yields undefined rather than `'number'` — see the NOTE on the
|
|
48
|
+
* `*` / `/` number cases below.
|
|
49
|
+
*/
|
|
50
|
+
export function temporalKindOfValue(v) {
|
|
51
|
+
if (typeof v === 'string') {
|
|
52
|
+
// ISO 8601 date (YYYY-MM-DD)
|
|
53
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(v))
|
|
54
|
+
return 'date';
|
|
55
|
+
// ISO 8601 datetime (with T separator)
|
|
56
|
+
if (v.includes('T') && /^\d{4}-\d{2}-\d{2}T/.test(v))
|
|
57
|
+
return 'datetime';
|
|
58
|
+
// ISO 8601 time (HH:MM:SS)
|
|
59
|
+
if (/^\d{2}:\d{2}:\d{2}/.test(v))
|
|
60
|
+
return 'time';
|
|
61
|
+
// ISO 8601 duration (starts with P, or -P when negative)
|
|
62
|
+
if (v.startsWith('P') || v.startsWith('-P'))
|
|
63
|
+
return 'timespan';
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
if (typeof v === 'number')
|
|
67
|
+
return 'number';
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
/** The one home for the "no such combination" error, so both callers spell it alike. */
|
|
71
|
+
export function unsupportedTemporalOp() {
|
|
72
|
+
throw new QuereusError(`Unsupported temporal operation`, StatusCode.UNSUPPORTED);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if a Temporal.Duration contains calendar units (years, months, weeks)
|
|
76
|
+
* that cannot be converted to a single time unit without a relativeTo reference.
|
|
77
|
+
*/
|
|
78
|
+
export function hasCalendarUnits(d) {
|
|
79
|
+
return d.years !== 0 || d.months !== 0 || d.weeks !== 0;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Scale each field of a duration by a factor.
|
|
83
|
+
* Works for both calendar and non-calendar durations.
|
|
84
|
+
*/
|
|
85
|
+
export function scaleDuration(d, factor) {
|
|
86
|
+
return Temporal.Duration.from({
|
|
87
|
+
years: d.years * factor,
|
|
88
|
+
months: d.months * factor,
|
|
89
|
+
weeks: d.weeks * factor,
|
|
90
|
+
days: d.days * factor,
|
|
91
|
+
hours: d.hours * factor,
|
|
92
|
+
minutes: d.minutes * factor,
|
|
93
|
+
seconds: d.seconds * factor,
|
|
94
|
+
milliseconds: d.milliseconds * factor,
|
|
95
|
+
microseconds: d.microseconds * factor,
|
|
96
|
+
nanoseconds: d.nanoseconds * factor,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Divide a duration's fields by a divisor, cascading remainders to smaller units.
|
|
101
|
+
* Cascade chain: years→months(×12), weeks→days(×7), days→hours(×24),
|
|
102
|
+
* hours→minutes(×60), minutes→seconds(×60), seconds→ms(×1000),
|
|
103
|
+
* ms→μs(×1000), μs→ns(×1000).
|
|
104
|
+
* Note: months cannot cascade to days (variable month length).
|
|
105
|
+
*/
|
|
106
|
+
export function divideDuration(d, divisor) {
|
|
107
|
+
// Cascade pairs: [field, next-field, conversion-factor]
|
|
108
|
+
const cascade = [
|
|
109
|
+
['years', 'months', 12],
|
|
110
|
+
// months→days gap: no fixed conversion
|
|
111
|
+
['weeks', 'days', 7],
|
|
112
|
+
['days', 'hours', 24],
|
|
113
|
+
['hours', 'minutes', 60],
|
|
114
|
+
['minutes', 'seconds', 60],
|
|
115
|
+
['seconds', 'milliseconds', 1000],
|
|
116
|
+
['milliseconds', 'microseconds', 1000],
|
|
117
|
+
['microseconds', 'nanoseconds', 1000],
|
|
118
|
+
];
|
|
119
|
+
// Build a mutable map of field values
|
|
120
|
+
const fields = {
|
|
121
|
+
years: d.years, months: d.months, weeks: d.weeks,
|
|
122
|
+
days: d.days, hours: d.hours, minutes: d.minutes,
|
|
123
|
+
seconds: d.seconds, milliseconds: d.milliseconds,
|
|
124
|
+
microseconds: d.microseconds, nanoseconds: d.nanoseconds,
|
|
125
|
+
};
|
|
126
|
+
for (const [field, nextField, factor] of cascade) {
|
|
127
|
+
const value = fields[field];
|
|
128
|
+
const quotient = Math.trunc(value / divisor);
|
|
129
|
+
const remainder = value - quotient * divisor;
|
|
130
|
+
fields[field] = quotient;
|
|
131
|
+
fields[nextField] += remainder * factor;
|
|
132
|
+
}
|
|
133
|
+
// Final field (nanoseconds) — just divide, truncate to integer
|
|
134
|
+
fields['nanoseconds'] = Math.trunc(fields['nanoseconds'] / divisor);
|
|
135
|
+
// Months divide independently: the cascade above already folded years into them, but
|
|
136
|
+
// a month has no fixed day count, so the sub-month remainder cannot cascade onward.
|
|
137
|
+
// NOTE: that remainder is truncated away — `timespan('P1M') / 2` is `PT0S`, not `P15D`.
|
|
138
|
+
// Preserved as found; revisit if a caller needs a reference-date-relative division.
|
|
139
|
+
fields['months'] = Math.trunc(fields['months'] / divisor);
|
|
140
|
+
return Temporal.Duration.from({
|
|
141
|
+
years: fields['years'],
|
|
142
|
+
months: fields['months'],
|
|
143
|
+
weeks: fields['weeks'],
|
|
144
|
+
days: fields['days'],
|
|
145
|
+
hours: fields['hours'],
|
|
146
|
+
minutes: fields['minutes'],
|
|
147
|
+
seconds: fields['seconds'],
|
|
148
|
+
milliseconds: fields['milliseconds'],
|
|
149
|
+
microseconds: fields['microseconds'],
|
|
150
|
+
nanoseconds: fields['nanoseconds'],
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** A DATE or DATETIME operand as a PlainDate. */
|
|
154
|
+
function asPlainDate(v, kind) {
|
|
155
|
+
return kind === 'datetime'
|
|
156
|
+
? Temporal.PlainDateTime.from(v).toPlainDate()
|
|
157
|
+
: Temporal.PlainDate.from(v);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* DATE/DATETIME − DATE/DATETIME → TIMESPAN.
|
|
161
|
+
*
|
|
162
|
+
* NOTE: both sides collapse to a PlainDate first, so the time of day is dropped —
|
|
163
|
+
* `datetime('2024-01-20T10:00:00') - datetime('2024-01-15T08:00:00')` is `'P5D'`, not
|
|
164
|
+
* `'P5DT2H'`. Preserved verbatim from the cascade this table replaces; the fix is
|
|
165
|
+
* tracked separately as `bug-datetime-difference-drops-time-of-day`.
|
|
166
|
+
*/
|
|
167
|
+
function dateDifference(lk, rk) {
|
|
168
|
+
return {
|
|
169
|
+
resultType: TIMESPAN_TYPE,
|
|
170
|
+
apply: (v1, v2) => asPlainDate(v1, lk).since(asPlainDate(v2, rk)).toString(),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/** DATE ± TIMESPAN → DATE. */
|
|
174
|
+
function dateShift(sign) {
|
|
175
|
+
return {
|
|
176
|
+
resultType: DATE_TYPE,
|
|
177
|
+
apply: (date, ts) => Temporal.PlainDate.from(date)[sign](Temporal.Duration.from(ts)).toString(),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** DATETIME ± TIMESPAN → DATETIME. */
|
|
181
|
+
function dateTimeShift(sign) {
|
|
182
|
+
return {
|
|
183
|
+
resultType: DATETIME_TYPE,
|
|
184
|
+
apply: (dt, ts) => Temporal.PlainDateTime.from(dt)[sign](Temporal.Duration.from(ts)).toString(),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** TIME ± TIMESPAN → TIME. */
|
|
188
|
+
function timeShift(sign) {
|
|
189
|
+
return {
|
|
190
|
+
resultType: TIME_TYPE,
|
|
191
|
+
apply: (t, ts) => Temporal.PlainTime.from(t)[sign](Temporal.Duration.from(ts)).toString(),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** The commuted form of a shift case: `TIMESPAN + DATE` reads the same as `DATE + TIMESPAN`. */
|
|
195
|
+
function commuted(entry) {
|
|
196
|
+
return { resultType: entry.resultType, apply: (v1, v2) => entry.apply(v2, v1) };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* TIMESPAN * NUMBER → TIMESPAN.
|
|
200
|
+
*
|
|
201
|
+
* NOTE: the `typeof n === 'number'` guard rejects `bigint`, so
|
|
202
|
+
* `timespan('PT1H') * 9007199254740993` raises `Unsupported temporal operation`.
|
|
203
|
+
* That is preserved-as-found (the old cascade's match condition was literally
|
|
204
|
+
* `typeof v2 === 'number'`), not designed — widening it to accept bigint is a
|
|
205
|
+
* separate call. The guard is unreachable on the runtime-sniffed path, where the
|
|
206
|
+
* kind was derived from `typeof`; it is load-bearing on the emit-time path, where a
|
|
207
|
+
* declared INTEGER operand can hold a bigint.
|
|
208
|
+
*/
|
|
209
|
+
function scaleTimespan(ts, n) {
|
|
210
|
+
if (typeof n !== 'number')
|
|
211
|
+
unsupportedTemporalOp();
|
|
212
|
+
const duration = Temporal.Duration.from(ts);
|
|
213
|
+
if (hasCalendarUnits(duration)) {
|
|
214
|
+
return scaleDuration(duration, n).toString();
|
|
215
|
+
}
|
|
216
|
+
const totalSeconds = duration.total({ unit: 'seconds' });
|
|
217
|
+
return Temporal.Duration.from({ seconds: totalSeconds * n }).toString();
|
|
218
|
+
}
|
|
219
|
+
/** TIMESPAN / NUMBER → TIMESPAN. Divisor `0` → null. Same bigint NOTE as {@link scaleTimespan}. */
|
|
220
|
+
function divideTimespanByNumber(ts, n) {
|
|
221
|
+
if (typeof n !== 'number')
|
|
222
|
+
unsupportedTemporalOp();
|
|
223
|
+
if (n === 0)
|
|
224
|
+
return null;
|
|
225
|
+
const duration = Temporal.Duration.from(ts);
|
|
226
|
+
if (hasCalendarUnits(duration)) {
|
|
227
|
+
return divideDuration(duration, n).toString();
|
|
228
|
+
}
|
|
229
|
+
const totalSeconds = duration.total({ unit: 'seconds' });
|
|
230
|
+
return Temporal.Duration.from({ seconds: totalSeconds / n }).toString();
|
|
231
|
+
}
|
|
232
|
+
/** TIMESPAN / TIMESPAN → REAL (ratio of elapsed seconds). */
|
|
233
|
+
function timespanRatio(v1, v2) {
|
|
234
|
+
const d1 = Temporal.Duration.from(v1);
|
|
235
|
+
const d2 = Temporal.Duration.from(v2);
|
|
236
|
+
if (hasCalendarUnits(d1) || hasCalendarUnits(d2)) {
|
|
237
|
+
// Cannot compute a numeric ratio when calendar units are involved
|
|
238
|
+
// (months/years have variable lengths without a reference date)
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
const total1 = d1.total({ unit: 'seconds' });
|
|
242
|
+
const total2 = d2.total({ unit: 'seconds' });
|
|
243
|
+
if (total2 === 0)
|
|
244
|
+
return null;
|
|
245
|
+
return total1 / total2;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* NOTE: the value-sniffed path builds one of these strings per row, where the old cascade
|
|
249
|
+
* allocated nothing. Immaterial next to the `Temporal.Duration.from` parse that follows it
|
|
250
|
+
* on the same row, and the emit-time specialization hoists the lookup out of the row loop
|
|
251
|
+
* entirely; if temporal arithmetic ever shows up in a profile without that hoist, nest the
|
|
252
|
+
* table two levels deep instead of keying on a concatenation.
|
|
253
|
+
*/
|
|
254
|
+
function key(operator, left, right) {
|
|
255
|
+
return `${operator}|${left}|${right}`;
|
|
256
|
+
}
|
|
257
|
+
const DATE_PLUS_TIMESPAN = dateShift('add');
|
|
258
|
+
const DATETIME_PLUS_TIMESPAN = dateTimeShift('add');
|
|
259
|
+
const TIME_PLUS_TIMESPAN = timeShift('add');
|
|
260
|
+
/**
|
|
261
|
+
* Every supported `(operator, left kind, right kind)` combination. Anything absent —
|
|
262
|
+
* `%` on any pair, DATE + DATE, DATE * NUMBER, TIME − DATE, DATE − NUMBER — is
|
|
263
|
+
* unsupported and raises {@link unsupportedTemporalOp} at runtime.
|
|
264
|
+
*/
|
|
265
|
+
const TEMPORAL_OP_CASES = new Map([
|
|
266
|
+
// difference of two instants → elapsed time
|
|
267
|
+
[key('-', 'date', 'date'), dateDifference('date', 'date')],
|
|
268
|
+
[key('-', 'date', 'datetime'), dateDifference('date', 'datetime')],
|
|
269
|
+
[key('-', 'datetime', 'date'), dateDifference('datetime', 'date')],
|
|
270
|
+
[key('-', 'datetime', 'datetime'), dateDifference('datetime', 'datetime')],
|
|
271
|
+
[key('-', 'time', 'time'), {
|
|
272
|
+
resultType: TIMESPAN_TYPE,
|
|
273
|
+
apply: (v1, v2) => Temporal.PlainTime.from(v1).since(Temporal.PlainTime.from(v2)).toString(),
|
|
274
|
+
}],
|
|
275
|
+
// instant shifted by an elapsed time → same kind of instant
|
|
276
|
+
[key('+', 'date', 'timespan'), DATE_PLUS_TIMESPAN],
|
|
277
|
+
[key('+', 'timespan', 'date'), commuted(DATE_PLUS_TIMESPAN)],
|
|
278
|
+
[key('-', 'date', 'timespan'), dateShift('subtract')],
|
|
279
|
+
[key('+', 'datetime', 'timespan'), DATETIME_PLUS_TIMESPAN],
|
|
280
|
+
[key('+', 'timespan', 'datetime'), commuted(DATETIME_PLUS_TIMESPAN)],
|
|
281
|
+
[key('-', 'datetime', 'timespan'), dateTimeShift('subtract')],
|
|
282
|
+
[key('+', 'time', 'timespan'), TIME_PLUS_TIMESPAN],
|
|
283
|
+
[key('+', 'timespan', 'time'), commuted(TIME_PLUS_TIMESPAN)],
|
|
284
|
+
[key('-', 'time', 'timespan'), timeShift('subtract')],
|
|
285
|
+
// elapsed time combined with elapsed time
|
|
286
|
+
[key('+', 'timespan', 'timespan'), {
|
|
287
|
+
resultType: TIMESPAN_TYPE,
|
|
288
|
+
apply: (v1, v2) => Temporal.Duration.from(v1).add(Temporal.Duration.from(v2)).toString(),
|
|
289
|
+
}],
|
|
290
|
+
[key('-', 'timespan', 'timespan'), {
|
|
291
|
+
resultType: TIMESPAN_TYPE,
|
|
292
|
+
apply: (v1, v2) => Temporal.Duration.from(v1).subtract(Temporal.Duration.from(v2)).toString(),
|
|
293
|
+
}],
|
|
294
|
+
[key('/', 'timespan', 'timespan'), { resultType: REAL_TYPE, apply: timespanRatio }],
|
|
295
|
+
// elapsed time scaled by a plain number
|
|
296
|
+
[key('*', 'timespan', 'number'), { resultType: TIMESPAN_TYPE, apply: scaleTimespan }],
|
|
297
|
+
[key('*', 'number', 'timespan'), { resultType: TIMESPAN_TYPE, apply: (v1, v2) => scaleTimespan(v2, v1) }],
|
|
298
|
+
[key('/', 'timespan', 'number'), { resultType: TIMESPAN_TYPE, apply: divideTimespanByNumber }],
|
|
299
|
+
]);
|
|
300
|
+
/**
|
|
301
|
+
* Look up the case for one `(operator, left kind, right kind)` triple.
|
|
302
|
+
* `undefined` means the combination is not supported.
|
|
303
|
+
*/
|
|
304
|
+
export function temporalOpCase(operator, left, right) {
|
|
305
|
+
return TEMPORAL_OP_CASES.get(key(operator, left, right));
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The one route from two declared logical types to a case.
|
|
309
|
+
*
|
|
310
|
+
* Two callers must reach the same answer or the announced result type stops predicting
|
|
311
|
+
* the value: `BinaryOpNode.generateType` announces `entry.resultType`, and
|
|
312
|
+
* `buildNumericOpSpec`'s temporal branch emits a body that runs `entry.apply`. Neither
|
|
313
|
+
* re-spells the kind derivation, so the two cannot come to select different entries.
|
|
314
|
+
*/
|
|
315
|
+
export function temporalOpCaseForTypes(operator, left, right) {
|
|
316
|
+
const lk = temporalKindOfType(left);
|
|
317
|
+
const rk = temporalKindOfType(right);
|
|
318
|
+
if (!lk || !rk)
|
|
319
|
+
return {};
|
|
320
|
+
return { kinds: [lk, rk], entry: temporalOpCase(operator, lk, rk) };
|
|
321
|
+
}
|
|
322
|
+
/** Test-only view of the table's keys, so a spec can assert its shape without re-listing it. */
|
|
323
|
+
export function temporalOpCaseKeys() {
|
|
324
|
+
return [...TEMPORAL_OP_CASES.keys()];
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Run one case with the exact envelope `tryTemporalArithmetic` has always had:
|
|
328
|
+
* null propagation, then `apply`, with a malformed value degrading to null while an
|
|
329
|
+
* `UNSUPPORTED` error propagates.
|
|
330
|
+
*
|
|
331
|
+
* Both the runtime-sniffed path and the emit-time specialized path call this, so the
|
|
332
|
+
* two cannot diverge on null handling or on what a bad value does.
|
|
333
|
+
*/
|
|
334
|
+
export function runTemporalCase(entry, v1, v2) {
|
|
335
|
+
if (v1 === null || v2 === null)
|
|
336
|
+
return null;
|
|
337
|
+
try {
|
|
338
|
+
return entry.apply(v1, v2);
|
|
339
|
+
}
|
|
340
|
+
catch (e) {
|
|
341
|
+
// UNSUPPORTED propagates; anything else means the value did not parse as the
|
|
342
|
+
// shape its kind promised, which is a null result rather than an error.
|
|
343
|
+
if (e instanceof QuereusError)
|
|
344
|
+
throw e;
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=temporal-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal-ops.js","sourceRoot":"","sources":["../../../src/types/temporal-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA4B/C,4FAA4F;AAC5F,MAAM,UAAU,cAAc,CAAC,IAAqC;IACnE,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoB;IACtD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,OAAO,KAAK,aAAa;QAAE,OAAO,UAAU,CAAC;IACjD,IAAI,OAAO,KAAK,aAAa;QAAE,OAAO,UAAU,CAAC;IACjD,gFAAgF;IAChF,gEAAgE;IAChE,8EAA8E;IAC9E,gCAAgC;IAChC,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAC;IAC9D,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;GASG;AACH,MA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AAQ,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,kBAAkB;IACjC,OAAO,CAAC,GAAG,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,EAAY,EAAE,EAAY;IAChF,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,CAAC;QACJ,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,6EAA6E;QAC7E,wEAAwE;QACxE,IAAI,CAAC,YAAY,YAAY;YAAE,MAAM,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC"}
|
|
@@ -14,6 +14,17 @@ export declare const TIME_TYPE: LogicalType;
|
|
|
14
14
|
* Uses Temporal.PlainDateTime for validation and parsing
|
|
15
15
|
*/
|
|
16
16
|
export declare const DATETIME_TYPE: LogicalType;
|
|
17
|
+
/**
|
|
18
|
+
* TIMESTAMP type - an integer instant (signed 64-bit epoch value).
|
|
19
|
+
*
|
|
20
|
+
* The stored value is an integer whose unit the engine does not reinterpret:
|
|
21
|
+
* an integer written to a TIMESTAMP column reads back exactly as written. Only
|
|
22
|
+
* the string→integer direction pins a unit — an ISO 8601 datetime string
|
|
23
|
+
* parses to epoch MILLISECONDS, matching the epoch-ms convention DATE and
|
|
24
|
+
* DATETIME already use for their numeric inputs
|
|
25
|
+
* (`Temporal.Instant.fromEpochMilliseconds`).
|
|
26
|
+
*/
|
|
27
|
+
export declare const TIMESTAMP_TYPE: LogicalType;
|
|
17
28
|
/**
|
|
18
29
|
* TIMESPAN type - stores ISO 8601 duration strings
|
|
19
30
|
* Uses Temporal.Duration for validation and parsing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal-types.d.ts","sourceRoot":"","sources":["../../../src/types/temporal-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,WAAW,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"temporal-types.d.ts","sourceRoot":"","sources":["../../../src/types/temporal-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAoBjF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,WA+DvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,WA2DvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WAoD3B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,WAsE5B,CAAC;AAwEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WAmE3B,CAAC"}
|