@quereus/quereus 4.5.0 → 4.7.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/README.md +5 -4
- package/dist/src/common/errors.d.ts +17 -0
- package/dist/src/common/errors.d.ts.map +1 -1
- package/dist/src/common/errors.js +21 -0
- package/dist/src/common/errors.js.map +1 -1
- package/dist/src/core/database-assertions.d.ts +4 -3
- package/dist/src/core/database-assertions.d.ts.map +1 -1
- package/dist/src/core/database-assertions.js +44 -14
- package/dist/src/core/database-assertions.js.map +1 -1
- package/dist/src/core/database-events.d.ts +161 -1
- package/dist/src/core/database-events.d.ts.map +1 -1
- package/dist/src/core/database-events.js +307 -5
- package/dist/src/core/database-events.js.map +1 -1
- package/dist/src/core/database-internal.d.ts +5 -2
- package/dist/src/core/database-internal.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views-plan-builders.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views-plan-builders.js +33 -4
- package/dist/src/core/database-materialized-views-plan-builders.js.map +1 -1
- package/dist/src/core/database-materialized-views-plans.d.ts +12 -2
- package/dist/src/core/database-materialized-views-plans.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views.d.ts +46 -0
- package/dist/src/core/database-materialized-views.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views.js +75 -4
- package/dist/src/core/database-materialized-views.js.map +1 -1
- package/dist/src/core/database-transaction.d.ts +9 -0
- package/dist/src/core/database-transaction.d.ts.map +1 -1
- package/dist/src/core/database-transaction.js +9 -0
- package/dist/src/core/database-transaction.js.map +1 -1
- package/dist/src/core/database.d.ts +16 -2
- package/dist/src/core/database.d.ts.map +1 -1
- package/dist/src/core/database.js +56 -15
- package/dist/src/core/database.js.map +1 -1
- package/dist/src/core/derived-row-validator.d.ts.map +1 -1
- package/dist/src/core/derived-row-validator.js +7 -1
- package/dist/src/core/derived-row-validator.js.map +1 -1
- package/dist/src/core/statement.d.ts.map +1 -1
- package/dist/src/core/statement.js +15 -5
- package/dist/src/core/statement.js.map +1 -1
- package/dist/src/emit/ast-stringify.d.ts +18 -2
- package/dist/src/emit/ast-stringify.d.ts.map +1 -1
- package/dist/src/emit/ast-stringify.js +22 -4
- package/dist/src/emit/ast-stringify.js.map +1 -1
- package/dist/src/func/builtins/aggregate.js +11 -11
- package/dist/src/func/builtins/aggregate.js.map +1 -1
- package/dist/src/func/builtins/builtin-window-functions.d.ts.map +1 -1
- package/dist/src/func/builtins/builtin-window-functions.js +15 -85
- package/dist/src/func/builtins/builtin-window-functions.js.map +1 -1
- package/dist/src/func/builtins/conversion.d.ts.map +1 -1
- package/dist/src/func/builtins/conversion.js +10 -9
- package/dist/src/func/builtins/conversion.js.map +1 -1
- package/dist/src/func/builtins/datetime.d.ts.map +1 -1
- package/dist/src/func/builtins/datetime.js +28 -10
- package/dist/src/func/builtins/datetime.js.map +1 -1
- package/dist/src/func/builtins/explain.d.ts.map +1 -1
- package/dist/src/func/builtins/explain.js +19 -5
- package/dist/src/func/builtins/explain.js.map +1 -1
- package/dist/src/func/builtins/json.d.ts.map +1 -1
- package/dist/src/func/builtins/json.js +23 -17
- package/dist/src/func/builtins/json.js.map +1 -1
- package/dist/src/func/builtins/mutation.js +2 -2
- package/dist/src/func/builtins/mutation.js.map +1 -1
- package/dist/src/func/builtins/return-types.d.ts +327 -0
- package/dist/src/func/builtins/return-types.d.ts.map +1 -0
- package/dist/src/func/builtins/return-types.js +43 -0
- package/dist/src/func/builtins/return-types.js.map +1 -0
- package/dist/src/func/builtins/scalar.d.ts.map +1 -1
- package/dist/src/func/builtins/scalar.js +150 -79
- package/dist/src/func/builtins/scalar.js.map +1 -1
- package/dist/src/func/builtins/schema.d.ts.map +1 -1
- package/dist/src/func/builtins/schema.js +43 -8
- package/dist/src/func/builtins/schema.js.map +1 -1
- package/dist/src/func/builtins/string.d.ts.map +1 -1
- package/dist/src/func/builtins/string.js +4 -2
- package/dist/src/func/builtins/string.js.map +1 -1
- package/dist/src/func/builtins/timespan.d.ts +3 -0
- package/dist/src/func/builtins/timespan.d.ts.map +1 -1
- package/dist/src/func/builtins/timespan.js +15 -11
- package/dist/src/func/builtins/timespan.js.map +1 -1
- package/dist/src/func/registration.d.ts +35 -1
- package/dist/src/func/registration.d.ts.map +1 -1
- package/dist/src/func/registration.js +235 -41
- package/dist/src/func/registration.js.map +1 -1
- package/dist/src/index.d.ts +14 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +15 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/parser/ast.d.ts +58 -1
- package/dist/src/parser/ast.d.ts.map +1 -1
- package/dist/src/parser/parser.d.ts +46 -0
- package/dist/src/parser/parser.d.ts.map +1 -1
- package/dist/src/parser/parser.js +161 -45
- package/dist/src/parser/parser.js.map +1 -1
- package/dist/src/parser/utils.d.ts +13 -1
- package/dist/src/parser/utils.d.ts.map +1 -1
- package/dist/src/parser/utils.js +14 -0
- package/dist/src/parser/utils.js.map +1 -1
- package/dist/src/planner/analysis/assertion-classifier.d.ts.map +1 -1
- package/dist/src/planner/analysis/assertion-classifier.js +7 -2
- package/dist/src/planner/analysis/assertion-classifier.js.map +1 -1
- package/dist/src/planner/analysis/assertion-hoist-cache.d.ts.map +1 -1
- package/dist/src/planner/analysis/assertion-hoist-cache.js +5 -0
- package/dist/src/planner/analysis/assertion-hoist-cache.js.map +1 -1
- package/dist/src/planner/analysis/change-scope.d.ts +11 -3
- package/dist/src/planner/analysis/change-scope.d.ts.map +1 -1
- package/dist/src/planner/analysis/change-scope.js +5 -4
- package/dist/src/planner/analysis/change-scope.js.map +1 -1
- package/dist/src/planner/analysis/check-extraction.d.ts.map +1 -1
- package/dist/src/planner/analysis/check-extraction.js +37 -4
- package/dist/src/planner/analysis/check-extraction.js.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.d.ts +20 -22
- package/dist/src/planner/analysis/comparison-collation.d.ts.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.js +29 -26
- package/dist/src/planner/analysis/comparison-collation.js.map +1 -1
- package/dist/src/planner/analysis/constraint-extractor.d.ts +0 -7
- package/dist/src/planner/analysis/constraint-extractor.d.ts.map +1 -1
- package/dist/src/planner/analysis/constraint-extractor.js +59 -59
- package/dist/src/planner/analysis/constraint-extractor.js.map +1 -1
- package/dist/src/planner/analysis/coverage-prover.d.ts.map +1 -1
- package/dist/src/planner/analysis/coverage-prover.js +13 -5
- package/dist/src/planner/analysis/coverage-prover.js.map +1 -1
- package/dist/src/planner/analysis/equi-correlation.d.ts +6 -1
- package/dist/src/planner/analysis/equi-correlation.d.ts.map +1 -1
- package/dist/src/planner/analysis/equi-correlation.js +8 -1
- package/dist/src/planner/analysis/equi-correlation.js.map +1 -1
- package/dist/src/planner/analysis/predicate-dependencies.d.ts +34 -0
- package/dist/src/planner/analysis/predicate-dependencies.d.ts.map +1 -0
- package/dist/src/planner/analysis/predicate-dependencies.js +60 -0
- package/dist/src/planner/analysis/predicate-dependencies.js.map +1 -0
- package/dist/src/planner/analysis/query-rewrite-matcher.d.ts +1 -1
- package/dist/src/planner/analysis/query-rewrite-matcher.d.ts.map +1 -1
- package/dist/src/planner/analysis/query-rewrite-matcher.js +0 -26
- package/dist/src/planner/analysis/query-rewrite-matcher.js.map +1 -1
- package/dist/src/planner/building/alter-table.d.ts.map +1 -1
- package/dist/src/planner/building/alter-table.js +117 -43
- package/dist/src/planner/building/alter-table.js.map +1 -1
- package/dist/src/planner/building/coercion.d.ts +21 -45
- package/dist/src/planner/building/coercion.d.ts.map +1 -1
- package/dist/src/planner/building/coercion.js +42 -91
- package/dist/src/planner/building/coercion.js.map +1 -1
- package/dist/src/planner/building/constraint-builder.d.ts.map +1 -1
- package/dist/src/planner/building/constraint-builder.js +9 -5
- package/dist/src/planner/building/constraint-builder.js.map +1 -1
- package/dist/src/planner/building/create-assertion.d.ts.map +1 -1
- package/dist/src/planner/building/create-assertion.js +72 -1
- package/dist/src/planner/building/create-assertion.js.map +1 -1
- package/dist/src/planner/building/create-view.d.ts +6 -1
- package/dist/src/planner/building/create-view.d.ts.map +1 -1
- package/dist/src/planner/building/create-view.js +12 -3
- package/dist/src/planner/building/create-view.js.map +1 -1
- package/dist/src/planner/building/ddl.d.ts.map +1 -1
- package/dist/src/planner/building/ddl.js +6 -2
- package/dist/src/planner/building/ddl.js.map +1 -1
- package/dist/src/planner/building/delete.d.ts.map +1 -1
- package/dist/src/planner/building/delete.js +23 -10
- package/dist/src/planner/building/delete.js.map +1 -1
- package/dist/src/planner/building/dml-target.d.ts.map +1 -1
- package/dist/src/planner/building/dml-target.js +4 -0
- package/dist/src/planner/building/dml-target.js.map +1 -1
- package/dist/src/planner/building/drop-assertion.d.ts.map +1 -1
- package/dist/src/planner/building/drop-assertion.js +3 -1
- package/dist/src/planner/building/drop-assertion.js.map +1 -1
- package/dist/src/planner/building/expression.d.ts +17 -0
- package/dist/src/planner/building/expression.d.ts.map +1 -1
- package/dist/src/planner/building/expression.js +28 -17
- package/dist/src/planner/building/expression.js.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.js +7 -5
- package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
- package/dist/src/planner/building/function-call.d.ts +35 -0
- package/dist/src/planner/building/function-call.d.ts.map +1 -1
- package/dist/src/planner/building/function-call.js +60 -42
- package/dist/src/planner/building/function-call.js.map +1 -1
- package/dist/src/planner/building/insert.d.ts.map +1 -1
- package/dist/src/planner/building/insert.js +185 -48
- package/dist/src/planner/building/insert.js.map +1 -1
- package/dist/src/planner/building/materialized-view.d.ts.map +1 -1
- package/dist/src/planner/building/materialized-view.js +3 -1
- package/dist/src/planner/building/materialized-view.js.map +1 -1
- package/dist/src/planner/building/schema-authored-context.d.ts +69 -0
- package/dist/src/planner/building/schema-authored-context.d.ts.map +1 -0
- package/dist/src/planner/building/schema-authored-context.js +75 -0
- package/dist/src/planner/building/schema-authored-context.js.map +1 -0
- package/dist/src/planner/building/schema-resolution.d.ts.map +1 -1
- package/dist/src/planner/building/schema-resolution.js +7 -4
- package/dist/src/planner/building/schema-resolution.js.map +1 -1
- package/dist/src/planner/building/select-aggregates.d.ts +188 -3
- package/dist/src/planner/building/select-aggregates.d.ts.map +1 -1
- package/dist/src/planner/building/select-aggregates.js +449 -65
- package/dist/src/planner/building/select-aggregates.js.map +1 -1
- package/dist/src/planner/building/select-compound.js +2 -2
- package/dist/src/planner/building/select-compound.js.map +1 -1
- package/dist/src/planner/building/select-context.d.ts +98 -0
- package/dist/src/planner/building/select-context.d.ts.map +1 -1
- package/dist/src/planner/building/select-context.js +120 -37
- package/dist/src/planner/building/select-context.js.map +1 -1
- package/dist/src/planner/building/select-modifiers.d.ts +10 -3
- package/dist/src/planner/building/select-modifiers.d.ts.map +1 -1
- package/dist/src/planner/building/select-modifiers.js +29 -8
- package/dist/src/planner/building/select-modifiers.js.map +1 -1
- package/dist/src/planner/building/select-ordinal.d.ts +64 -19
- package/dist/src/planner/building/select-ordinal.d.ts.map +1 -1
- package/dist/src/planner/building/select-ordinal.js +79 -30
- package/dist/src/planner/building/select-ordinal.js.map +1 -1
- package/dist/src/planner/building/select-projections.d.ts +1 -1
- package/dist/src/planner/building/select-projections.d.ts.map +1 -1
- package/dist/src/planner/building/select-projections.js +18 -11
- package/dist/src/planner/building/select-projections.js.map +1 -1
- package/dist/src/planner/building/select-window.d.ts +13 -3
- package/dist/src/planner/building/select-window.d.ts.map +1 -1
- package/dist/src/planner/building/select-window.js +142 -37
- package/dist/src/planner/building/select-window.js.map +1 -1
- package/dist/src/planner/building/select.d.ts +37 -1
- package/dist/src/planner/building/select.d.ts.map +1 -1
- package/dist/src/planner/building/select.js +240 -109
- package/dist/src/planner/building/select.js.map +1 -1
- package/dist/src/planner/building/update.d.ts.map +1 -1
- package/dist/src/planner/building/update.js +27 -13
- package/dist/src/planner/building/update.js.map +1 -1
- package/dist/src/planner/building/view-mutation-builder.d.ts +1 -1
- package/dist/src/planner/building/view-mutation-builder.d.ts.map +1 -1
- package/dist/src/planner/building/view-mutation-builder.js +102 -8
- package/dist/src/planner/building/view-mutation-builder.js.map +1 -1
- package/dist/src/planner/building/with.d.ts.map +1 -1
- package/dist/src/planner/building/with.js +34 -4
- package/dist/src/planner/building/with.js.map +1 -1
- package/dist/src/planner/cache/correlation-detector.d.ts +15 -0
- package/dist/src/planner/cache/correlation-detector.d.ts.map +1 -1
- package/dist/src/planner/cache/correlation-detector.js +26 -0
- package/dist/src/planner/cache/correlation-detector.js.map +1 -1
- package/dist/src/planner/cache/materialization-advisory.d.ts +7 -0
- package/dist/src/planner/cache/materialization-advisory.d.ts.map +1 -1
- package/dist/src/planner/cache/materialization-advisory.js +12 -3
- package/dist/src/planner/cache/materialization-advisory.js.map +1 -1
- package/dist/src/planner/cost/conjunct-cost.d.ts +40 -0
- package/dist/src/planner/cost/conjunct-cost.d.ts.map +1 -1
- package/dist/src/planner/cost/conjunct-cost.js +45 -0
- package/dist/src/planner/cost/conjunct-cost.js.map +1 -1
- package/dist/src/planner/cost/index.d.ts +10 -0
- package/dist/src/planner/cost/index.d.ts.map +1 -1
- package/dist/src/planner/cost/index.js +15 -0
- package/dist/src/planner/cost/index.js.map +1 -1
- package/dist/src/planner/framework/characteristics.d.ts +9 -0
- package/dist/src/planner/framework/characteristics.d.ts.map +1 -1
- package/dist/src/planner/framework/characteristics.js.map +1 -1
- package/dist/src/planner/framework/pass.d.ts +2 -0
- package/dist/src/planner/framework/pass.d.ts.map +1 -1
- package/dist/src/planner/framework/pass.js +15 -0
- package/dist/src/planner/framework/pass.js.map +1 -1
- package/dist/src/planner/mutation/backward-body.d.ts.map +1 -1
- package/dist/src/planner/mutation/backward-body.js +4 -1
- package/dist/src/planner/mutation/backward-body.js.map +1 -1
- package/dist/src/planner/mutation/body-context.d.ts +23 -0
- package/dist/src/planner/mutation/body-context.d.ts.map +1 -0
- package/dist/src/planner/mutation/body-context.js +26 -0
- package/dist/src/planner/mutation/body-context.js.map +1 -0
- package/dist/src/planner/mutation/cte-flatten.js +15 -2
- package/dist/src/planner/mutation/cte-flatten.js.map +1 -1
- package/dist/src/planner/mutation/decomposition.d.ts +8 -0
- package/dist/src/planner/mutation/decomposition.d.ts.map +1 -1
- package/dist/src/planner/mutation/decomposition.js +8 -3
- package/dist/src/planner/mutation/decomposition.js.map +1 -1
- package/dist/src/planner/mutation/lens-enforcement.js +1 -1
- package/dist/src/planner/mutation/multi-source.d.ts +7 -0
- package/dist/src/planner/mutation/multi-source.d.ts.map +1 -1
- package/dist/src/planner/mutation/multi-source.js +5 -0
- package/dist/src/planner/mutation/multi-source.js.map +1 -1
- package/dist/src/planner/mutation/mutation-diagnostic.d.ts +1 -1
- package/dist/src/planner/mutation/mutation-diagnostic.d.ts.map +1 -1
- package/dist/src/planner/mutation/mutation-diagnostic.js.map +1 -1
- package/dist/src/planner/mutation/scope-transform.d.ts +32 -0
- package/dist/src/planner/mutation/scope-transform.d.ts.map +1 -1
- package/dist/src/planner/mutation/scope-transform.js +181 -33
- package/dist/src/planner/mutation/scope-transform.js.map +1 -1
- package/dist/src/planner/mutation/set-op.d.ts.map +1 -1
- package/dist/src/planner/mutation/set-op.js +66 -16
- package/dist/src/planner/mutation/set-op.js.map +1 -1
- package/dist/src/planner/mutation/single-source.d.ts.map +1 -1
- package/dist/src/planner/mutation/single-source.js +100 -24
- package/dist/src/planner/mutation/single-source.js.map +1 -1
- package/dist/src/planner/nodes/add-constraint-node.d.ts +15 -1
- package/dist/src/planner/nodes/add-constraint-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/add-constraint-node.js +10 -1
- package/dist/src/planner/nodes/add-constraint-node.js.map +1 -1
- package/dist/src/planner/nodes/aggregate-node.d.ts +15 -0
- package/dist/src/planner/nodes/aggregate-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/aggregate-node.js +32 -17
- package/dist/src/planner/nodes/aggregate-node.js.map +1 -1
- package/dist/src/planner/nodes/alias-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/alias-node.js +2 -1
- package/dist/src/planner/nodes/alias-node.js.map +1 -1
- package/dist/src/planner/nodes/alter-table-node.d.ts +51 -10
- package/dist/src/planner/nodes/alter-table-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/alter-table-node.js +49 -2
- package/dist/src/planner/nodes/alter-table-node.js.map +1 -1
- package/dist/src/planner/nodes/asof-scan-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/asof-scan-node.js +4 -1
- package/dist/src/planner/nodes/asof-scan-node.js.map +1 -1
- package/dist/src/planner/nodes/asserted-keys-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/asserted-keys-node.js +2 -1
- package/dist/src/planner/nodes/asserted-keys-node.js.map +1 -1
- package/dist/src/planner/nodes/bloom-join-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/bloom-join-node.js +8 -3
- package/dist/src/planner/nodes/bloom-join-node.js.map +1 -1
- package/dist/src/planner/nodes/cache-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/cache-node.js +2 -1
- package/dist/src/planner/nodes/cache-node.js.map +1 -1
- package/dist/src/planner/nodes/constraint-check-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/constraint-check-node.js +17 -19
- package/dist/src/planner/nodes/constraint-check-node.js.map +1 -1
- package/dist/src/planner/nodes/create-assertion-node.d.ts +2 -1
- package/dist/src/planner/nodes/create-assertion-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/create-assertion-node.js +5 -2
- package/dist/src/planner/nodes/create-assertion-node.js.map +1 -1
- package/dist/src/planner/nodes/cte-node.d.ts +19 -9
- package/dist/src/planner/nodes/cte-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/cte-node.js +25 -9
- package/dist/src/planner/nodes/cte-node.js.map +1 -1
- package/dist/src/planner/nodes/delete-node.d.ts +20 -2
- package/dist/src/planner/nodes/delete-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/delete-node.js +11 -2
- package/dist/src/planner/nodes/delete-node.js.map +1 -1
- package/dist/src/planner/nodes/distinct-node.d.ts +6 -0
- package/dist/src/planner/nodes/distinct-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/distinct-node.js +10 -2
- package/dist/src/planner/nodes/distinct-node.js.map +1 -1
- package/dist/src/planner/nodes/dml-executor-node.d.ts +58 -1
- package/dist/src/planner/nodes/dml-executor-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/dml-executor-node.js +107 -15
- package/dist/src/planner/nodes/dml-executor-node.js.map +1 -1
- package/dist/src/planner/nodes/drop-assertion-node.d.ts +2 -1
- package/dist/src/planner/nodes/drop-assertion-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/drop-assertion-node.js +5 -2
- package/dist/src/planner/nodes/drop-assertion-node.js.map +1 -1
- package/dist/src/planner/nodes/eager-prefetch-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/eager-prefetch-node.js +2 -1
- package/dist/src/planner/nodes/eager-prefetch-node.js.map +1 -1
- package/dist/src/planner/nodes/fanout-lookup-join-node.d.ts +5 -0
- package/dist/src/planner/nodes/fanout-lookup-join-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/fanout-lookup-join-node.js +13 -6
- package/dist/src/planner/nodes/fanout-lookup-join-node.js.map +1 -1
- package/dist/src/planner/nodes/filter.d.ts.map +1 -1
- package/dist/src/planner/nodes/filter.js +18 -5
- package/dist/src/planner/nodes/filter.js.map +1 -1
- package/dist/src/planner/nodes/hash-aggregate.d.ts +1 -0
- package/dist/src/planner/nodes/hash-aggregate.d.ts.map +1 -1
- package/dist/src/planner/nodes/hash-aggregate.js +21 -16
- package/dist/src/planner/nodes/hash-aggregate.js.map +1 -1
- package/dist/src/planner/nodes/insert-node.d.ts +19 -2
- package/dist/src/planner/nodes/insert-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/insert-node.js +10 -2
- package/dist/src/planner/nodes/insert-node.js.map +1 -1
- package/dist/src/planner/nodes/join-node.d.ts +20 -1
- package/dist/src/planner/nodes/join-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/join-node.js +30 -9
- package/dist/src/planner/nodes/join-node.js.map +1 -1
- package/dist/src/planner/nodes/join-utils.d.ts +21 -0
- package/dist/src/planner/nodes/join-utils.d.ts.map +1 -1
- package/dist/src/planner/nodes/join-utils.js +26 -0
- package/dist/src/planner/nodes/join-utils.js.map +1 -1
- package/dist/src/planner/nodes/key-set-semi-join-node.d.ts +42 -10
- package/dist/src/planner/nodes/key-set-semi-join-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/key-set-semi-join-node.js +90 -17
- package/dist/src/planner/nodes/key-set-semi-join-node.js.map +1 -1
- package/dist/src/planner/nodes/lens-auxiliary-access-node.d.ts +5 -0
- package/dist/src/planner/nodes/lens-auxiliary-access-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/lens-auxiliary-access-node.js +2 -1
- package/dist/src/planner/nodes/lens-auxiliary-access-node.js.map +1 -1
- package/dist/src/planner/nodes/limit-offset.d.ts +6 -0
- package/dist/src/planner/nodes/limit-offset.d.ts.map +1 -1
- package/dist/src/planner/nodes/limit-offset.js +10 -2
- package/dist/src/planner/nodes/limit-offset.js.map +1 -1
- package/dist/src/planner/nodes/merge-join-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/merge-join-node.js +8 -3
- package/dist/src/planner/nodes/merge-join-node.js.map +1 -1
- package/dist/src/planner/nodes/ordinal-slice-node.d.ts +5 -0
- package/dist/src/planner/nodes/ordinal-slice-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/ordinal-slice-node.js +9 -2
- package/dist/src/planner/nodes/ordinal-slice-node.js.map +1 -1
- package/dist/src/planner/nodes/plan-node.d.ts +29 -0
- package/dist/src/planner/nodes/plan-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/plan-node.js +12 -0
- package/dist/src/planner/nodes/plan-node.js.map +1 -1
- package/dist/src/planner/nodes/project-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/project-node.js +18 -36
- package/dist/src/planner/nodes/project-node.js.map +1 -1
- package/dist/src/planner/nodes/reference.d.ts.map +1 -1
- package/dist/src/planner/nodes/reference.js +3 -2
- package/dist/src/planner/nodes/reference.js.map +1 -1
- package/dist/src/planner/nodes/retrieve-node.d.ts +16 -2
- package/dist/src/planner/nodes/retrieve-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/retrieve-node.js +10 -2
- package/dist/src/planner/nodes/retrieve-node.js.map +1 -1
- package/dist/src/planner/nodes/returning-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/returning-node.js +13 -32
- package/dist/src/planner/nodes/returning-node.js.map +1 -1
- package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
- package/dist/src/planner/nodes/scalar.js +5 -18
- package/dist/src/planner/nodes/scalar.js.map +1 -1
- package/dist/src/planner/nodes/sort.d.ts.map +1 -1
- package/dist/src/planner/nodes/sort.js +3 -1
- package/dist/src/planner/nodes/sort.js.map +1 -1
- package/dist/src/planner/nodes/stream-aggregate.d.ts +1 -0
- package/dist/src/planner/nodes/stream-aggregate.d.ts.map +1 -1
- package/dist/src/planner/nodes/stream-aggregate.js +22 -20
- package/dist/src/planner/nodes/stream-aggregate.js.map +1 -1
- package/dist/src/planner/nodes/table-access-nodes.d.ts +89 -1
- package/dist/src/planner/nodes/table-access-nodes.d.ts.map +1 -1
- package/dist/src/planner/nodes/table-access-nodes.js +69 -2
- package/dist/src/planner/nodes/table-access-nodes.js.map +1 -1
- package/dist/src/planner/nodes/update-node.d.ts +19 -2
- package/dist/src/planner/nodes/update-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/update-node.js +10 -2
- package/dist/src/planner/nodes/update-node.js.map +1 -1
- package/dist/src/planner/nodes/window-function.d.ts.map +1 -1
- package/dist/src/planner/nodes/window-function.js +8 -0
- package/dist/src/planner/nodes/window-function.js.map +1 -1
- package/dist/src/planner/nodes/window-node.d.ts +1 -1
- package/dist/src/planner/nodes/window-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/window-node.js +3 -1
- package/dist/src/planner/nodes/window-node.js.map +1 -1
- package/dist/src/planner/optimizer.d.ts +27 -1
- package/dist/src/planner/optimizer.d.ts.map +1 -1
- package/dist/src/planner/optimizer.js +130 -10
- package/dist/src/planner/optimizer.js.map +1 -1
- package/dist/src/planner/planning-context.d.ts +24 -0
- package/dist/src/planner/planning-context.d.ts.map +1 -1
- package/dist/src/planner/planning-context.js.map +1 -1
- package/dist/src/planner/rules/access/rule-key-set-seek.d.ts +78 -20
- package/dist/src/planner/rules/access/rule-key-set-seek.d.ts.map +1 -1
- package/dist/src/planner/rules/access/rule-key-set-seek.js +296 -135
- package/dist/src/planner/rules/access/rule-key-set-seek.js.map +1 -1
- package/dist/src/planner/rules/access/rule-monotonic-range-access.d.ts.map +1 -1
- package/dist/src/planner/rules/access/rule-monotonic-range-access.js +2 -2
- package/dist/src/planner/rules/access/rule-monotonic-range-access.js.map +1 -1
- package/dist/src/planner/rules/access/rule-select-access-path.d.ts +30 -1
- package/dist/src/planner/rules/access/rule-select-access-path.d.ts.map +1 -1
- package/dist/src/planner/rules/access/rule-select-access-path.js +70 -5
- package/dist/src/planner/rules/access/rule-select-access-path.js.map +1 -1
- package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts +7 -4
- package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.d.ts.map +1 -1
- package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js +39 -5
- package/dist/src/planner/rules/aggregate/rule-groupby-fd-simplification.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.d.ts.map +1 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.js +15 -2
- package/dist/src/planner/rules/cache/rule-cte-optimization.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js +10 -3
- package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.d.ts.map +1 -1
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js +6 -4
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js.map +1 -1
- package/dist/src/planner/rules/join/equi-pair-extractor.d.ts +5 -31
- package/dist/src/planner/rules/join/equi-pair-extractor.d.ts.map +1 -1
- package/dist/src/planner/rules/join/equi-pair-extractor.js +4 -44
- package/dist/src/planner/rules/join/equi-pair-extractor.js.map +1 -1
- package/dist/src/planner/rules/join/index-nested-loop.d.ts +49 -0
- package/dist/src/planner/rules/join/index-nested-loop.d.ts.map +1 -0
- package/dist/src/planner/rules/join/index-nested-loop.js +291 -0
- package/dist/src/planner/rules/join/index-nested-loop.js.map +1 -0
- package/dist/src/planner/rules/join/rule-fanout-batched-outer.js +8 -8
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.d.ts +4 -0
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js +50 -15
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js.map +1 -1
- package/dist/src/planner/rules/join/rule-join-elimination.d.ts +6 -0
- package/dist/src/planner/rules/join/rule-join-elimination.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-join-elimination.js +25 -9
- package/dist/src/planner/rules/join/rule-join-elimination.js.map +1 -1
- package/dist/src/planner/rules/join/rule-join-key-inference.d.ts +7 -0
- package/dist/src/planner/rules/join/rule-join-key-inference.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-join-key-inference.js +23 -11
- package/dist/src/planner/rules/join/rule-join-key-inference.js.map +1 -1
- package/dist/src/planner/rules/join/rule-join-physical-selection.d.ts +10 -4
- package/dist/src/planner/rules/join/rule-join-physical-selection.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-join-physical-selection.js +115 -29
- package/dist/src/planner/rules/join/rule-join-physical-selection.js.map +1 -1
- package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts +2 -0
- package/dist/src/planner/rules/join/rule-monotonic-merge-join.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-monotonic-merge-join.js +18 -4
- package/dist/src/planner/rules/join/rule-monotonic-merge-join.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts +2 -2
- package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.d.ts.map +1 -1
- package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js +19 -22
- package/dist/src/planner/rules/predicate/rule-aggregate-predicate-pushdown.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.d.ts +21 -8
- package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.d.ts.map +1 -1
- package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.js +70 -14
- package/dist/src/planner/rules/predicate/rule-filter-conjunct-ordering.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-filter-selectivity.d.ts +56 -17
- package/dist/src/planner/rules/predicate/rule-filter-selectivity.d.ts.map +1 -1
- package/dist/src/planner/rules/predicate/rule-filter-selectivity.js +103 -154
- package/dist/src/planner/rules/predicate/rule-filter-selectivity.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.d.ts +76 -0
- package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.d.ts.map +1 -0
- package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.js +208 -0
- package/dist/src/planner/rules/predicate/rule-join-predicate-pushdown.js.map +1 -0
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts +14 -11
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.d.ts.map +1 -1
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js +21 -85
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-predicate-pushdown.d.ts +7 -1
- package/dist/src/planner/rules/predicate/rule-predicate-pushdown.d.ts.map +1 -1
- package/dist/src/planner/rules/predicate/rule-predicate-pushdown.js +18 -22
- package/dist/src/planner/rules/predicate/rule-predicate-pushdown.js.map +1 -1
- package/dist/src/planner/rules/shared/access-leaf.d.ts +52 -0
- package/dist/src/planner/rules/shared/access-leaf.d.ts.map +1 -0
- package/dist/src/planner/rules/shared/access-leaf.js +95 -0
- package/dist/src/planner/rules/shared/access-leaf.js.map +1 -0
- package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.d.ts.map +1 -1
- package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js +17 -7
- package/dist/src/planner/rules/subquery/rule-anti-join-fk-empty.js.map +1 -1
- package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts +3 -1
- package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.d.ts.map +1 -1
- package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js +26 -9
- package/dist/src/planner/rules/subquery/rule-semi-join-fk-trivial.js.map +1 -1
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.d.ts.map +1 -1
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js +69 -11
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js.map +1 -1
- package/dist/src/planner/rules/window/rule-monotonic-window.d.ts +17 -7
- package/dist/src/planner/rules/window/rule-monotonic-window.d.ts.map +1 -1
- package/dist/src/planner/rules/window/rule-monotonic-window.js +124 -87
- package/dist/src/planner/rules/window/rule-monotonic-window.js.map +1 -1
- package/dist/src/planner/scopes/aliased.d.ts.map +1 -1
- package/dist/src/planner/scopes/aliased.js +6 -0
- package/dist/src/planner/scopes/aliased.js.map +1 -1
- package/dist/src/planner/stats/catalog-stats.d.ts +44 -13
- package/dist/src/planner/stats/catalog-stats.d.ts.map +1 -1
- package/dist/src/planner/stats/catalog-stats.js +137 -61
- package/dist/src/planner/stats/catalog-stats.js.map +1 -1
- package/dist/src/planner/stats/conjunct-selectivity.d.ts +48 -0
- package/dist/src/planner/stats/conjunct-selectivity.d.ts.map +1 -0
- package/dist/src/planner/stats/conjunct-selectivity.js +168 -0
- package/dist/src/planner/stats/conjunct-selectivity.js.map +1 -0
- package/dist/src/planner/stats/index.d.ts +22 -3
- package/dist/src/planner/stats/index.d.ts.map +1 -1
- package/dist/src/planner/stats/index.js.map +1 -1
- package/dist/src/planner/stats/table-cardinality.d.ts +28 -0
- package/dist/src/planner/stats/table-cardinality.d.ts.map +1 -0
- package/dist/src/planner/stats/table-cardinality.js +29 -0
- package/dist/src/planner/stats/table-cardinality.js.map +1 -0
- package/dist/src/planner/stored-body-context.d.ts +57 -0
- package/dist/src/planner/stored-body-context.d.ts.map +1 -0
- package/dist/src/planner/stored-body-context.js +64 -0
- package/dist/src/planner/stored-body-context.js.map +1 -0
- package/dist/src/planner/util/column-origins.d.ts +29 -8
- package/dist/src/planner/util/column-origins.d.ts.map +1 -1
- package/dist/src/planner/util/column-origins.js +74 -14
- package/dist/src/planner/util/column-origins.js.map +1 -1
- package/dist/src/planner/util/fd-utils.d.ts +32 -8
- package/dist/src/planner/util/fd-utils.d.ts.map +1 -1
- package/dist/src/planner/util/fd-utils.js +46 -9
- package/dist/src/planner/util/fd-utils.js.map +1 -1
- package/dist/src/planner/util/ind-utils.d.ts +66 -19
- package/dist/src/planner/util/ind-utils.d.ts.map +1 -1
- package/dist/src/planner/util/ind-utils.js +91 -21
- package/dist/src/planner/util/ind-utils.js.map +1 -1
- package/dist/src/planner/util/key-utils.d.ts +36 -3
- package/dist/src/planner/util/key-utils.d.ts.map +1 -1
- package/dist/src/planner/util/key-utils.js +57 -7
- package/dist/src/planner/util/key-utils.js.map +1 -1
- package/dist/src/planner/util/output-names.d.ts +12 -0
- package/dist/src/planner/util/output-names.d.ts.map +1 -0
- package/dist/src/planner/util/output-names.js +20 -0
- package/dist/src/planner/util/output-names.js.map +1 -0
- package/dist/src/planner/util/row-estimates.d.ts +39 -0
- package/dist/src/planner/util/row-estimates.d.ts.map +1 -0
- package/dist/src/planner/util/row-estimates.js +68 -0
- package/dist/src/planner/util/row-estimates.js.map +1 -0
- package/dist/src/planner/util/row-population.d.ts +42 -0
- package/dist/src/planner/util/row-population.d.ts.map +1 -0
- package/dist/src/planner/util/row-population.js +71 -0
- package/dist/src/planner/util/row-population.js.map +1 -0
- package/dist/src/runtime/deferred-constraint-queue.d.ts.map +1 -1
- package/dist/src/runtime/deferred-constraint-queue.js +3 -2
- package/dist/src/runtime/deferred-constraint-queue.js.map +1 -1
- package/dist/src/runtime/emit/add-constraint.d.ts.map +1 -1
- package/dist/src/runtime/emit/add-constraint.js +60 -6
- package/dist/src/runtime/emit/add-constraint.js.map +1 -1
- package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate.js +4 -4
- package/dist/src/runtime/emit/aggregate.js.map +1 -1
- package/dist/src/runtime/emit/alter-schema-event.d.ts +97 -0
- package/dist/src/runtime/emit/alter-schema-event.d.ts.map +1 -0
- package/dist/src/runtime/emit/alter-schema-event.js +87 -0
- package/dist/src/runtime/emit/alter-schema-event.js.map +1 -0
- package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-table.js +582 -236
- package/dist/src/runtime/emit/alter-table.js.map +1 -1
- package/dist/src/runtime/emit/analyze.d.ts.map +1 -1
- package/dist/src/runtime/emit/analyze.js +50 -7
- package/dist/src/runtime/emit/analyze.js.map +1 -1
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts +37 -0
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -0
- package/dist/src/runtime/emit/assertion-drop-guard.js +59 -0
- package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -0
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +33 -0
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -0
- package/dist/src/runtime/emit/assertion-rename-helpers.js +124 -0
- package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -0
- package/dist/src/runtime/emit/cast.d.ts.map +1 -1
- package/dist/src/runtime/emit/cast.js +4 -19
- package/dist/src/runtime/emit/cast.js.map +1 -1
- package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
- package/dist/src/runtime/emit/constraint-check.js +10 -227
- package/dist/src/runtime/emit/constraint-check.js.map +1 -1
- package/dist/src/runtime/emit/create-assertion.d.ts.map +1 -1
- package/dist/src/runtime/emit/create-assertion.js +31 -14
- package/dist/src/runtime/emit/create-assertion.js.map +1 -1
- package/dist/src/runtime/emit/cte.d.ts.map +1 -1
- package/dist/src/runtime/emit/cte.js +11 -6
- package/dist/src/runtime/emit/cte.js.map +1 -1
- package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
- package/dist/src/runtime/emit/dml-executor.js +233 -28
- package/dist/src/runtime/emit/dml-executor.js.map +1 -1
- package/dist/src/runtime/emit/drop-assertion.js +8 -8
- package/dist/src/runtime/emit/drop-assertion.js.map +1 -1
- package/dist/src/runtime/emit/drop-column-guards.d.ts +151 -0
- package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -0
- package/dist/src/runtime/emit/drop-column-guards.js +230 -0
- package/dist/src/runtime/emit/drop-column-guards.js.map +1 -0
- package/dist/src/runtime/emit/drop-index.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-index.js +4 -3
- package/dist/src/runtime/emit/drop-index.js.map +1 -1
- package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-table.js +6 -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 +4 -0
- package/dist/src/runtime/emit/drop-view.js.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.js +2 -2
- package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
- package/dist/src/runtime/emit/join.d.ts.map +1 -1
- package/dist/src/runtime/emit/join.js +8 -67
- package/dist/src/runtime/emit/join.js.map +1 -1
- package/dist/src/runtime/emit/key-set-semi-join.d.ts.map +1 -1
- package/dist/src/runtime/emit/key-set-semi-join.js +11 -3
- package/dist/src/runtime/emit/key-set-semi-join.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts +4 -4
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.js +34 -22
- 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 +7 -2
- package/dist/src/runtime/emit/materialized-view.js.map +1 -1
- package/dist/src/runtime/emit/operand-comparator.d.ts +30 -0
- package/dist/src/runtime/emit/operand-comparator.d.ts.map +1 -1
- package/dist/src/runtime/emit/operand-comparator.js +34 -0
- package/dist/src/runtime/emit/operand-comparator.js.map +1 -1
- package/dist/src/runtime/emit/recursive-cte.d.ts.map +1 -1
- package/dist/src/runtime/emit/recursive-cte.js +4 -5
- package/dist/src/runtime/emit/recursive-cte.js.map +1 -1
- package/dist/src/runtime/emit/schema-declarative.d.ts.map +1 -1
- package/dist/src/runtime/emit/schema-declarative.js +30 -0
- package/dist/src/runtime/emit/schema-declarative.js.map +1 -1
- package/dist/src/runtime/emit/subquery.d.ts.map +1 -1
- package/dist/src/runtime/emit/subquery.js +153 -52
- package/dist/src/runtime/emit/subquery.js.map +1 -1
- package/dist/src/runtime/emit/update.d.ts.map +1 -1
- package/dist/src/runtime/emit/update.js +18 -6
- package/dist/src/runtime/emit/update.js.map +1 -1
- package/dist/src/runtime/emit/window.js +36 -23
- package/dist/src/runtime/emit/window.js.map +1 -1
- package/dist/src/runtime/row-constraints.d.ts +85 -0
- package/dist/src/runtime/row-constraints.d.ts.map +1 -0
- package/dist/src/runtime/row-constraints.js +239 -0
- package/dist/src/runtime/row-constraints.js.map +1 -0
- package/dist/src/runtime/types.d.ts +8 -11
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/dist/src/runtime/types.js.map +1 -1
- package/dist/src/schema/assertion.d.ts +14 -1
- package/dist/src/schema/assertion.d.ts.map +1 -1
- package/dist/src/schema/assertion.js +14 -1
- package/dist/src/schema/assertion.js.map +1 -1
- package/dist/src/schema/catalog-persistability.d.ts +19 -16
- package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
- package/dist/src/schema/catalog-persistability.js +92 -20
- package/dist/src/schema/catalog-persistability.js.map +1 -1
- package/dist/src/schema/catalog.d.ts +73 -2
- package/dist/src/schema/catalog.d.ts.map +1 -1
- package/dist/src/schema/catalog.js +220 -39
- package/dist/src/schema/catalog.js.map +1 -1
- package/dist/src/schema/column-source-resolver.d.ts +18 -0
- package/dist/src/schema/column-source-resolver.d.ts.map +1 -0
- package/dist/src/schema/column-source-resolver.js +22 -0
- package/dist/src/schema/column-source-resolver.js.map +1 -0
- package/dist/src/schema/column.d.ts +26 -3
- package/dist/src/schema/column.d.ts.map +1 -1
- package/dist/src/schema/column.js.map +1 -1
- package/dist/src/schema/constraint-builder.d.ts.map +1 -1
- package/dist/src/schema/constraint-builder.js +7 -1
- package/dist/src/schema/constraint-builder.js.map +1 -1
- package/dist/src/schema/ddl-generator.d.ts.map +1 -1
- package/dist/src/schema/ddl-generator.js +27 -6
- package/dist/src/schema/ddl-generator.js.map +1 -1
- package/dist/src/schema/function.d.ts +32 -1
- package/dist/src/schema/function.d.ts.map +1 -1
- package/dist/src/schema/function.js +10 -2
- package/dist/src/schema/function.js.map +1 -1
- package/dist/src/schema/lens-compiler.d.ts.map +1 -1
- package/dist/src/schema/lens-compiler.js +203 -51
- package/dist/src/schema/lens-compiler.js.map +1 -1
- package/dist/src/schema/lens-prover.d.ts +2 -3
- package/dist/src/schema/lens-prover.d.ts.map +1 -1
- package/dist/src/schema/lens-prover.js +19 -11
- package/dist/src/schema/lens-prover.js.map +1 -1
- package/dist/src/schema/manager.d.ts +115 -20
- package/dist/src/schema/manager.d.ts.map +1 -1
- package/dist/src/schema/manager.js +202 -70
- package/dist/src/schema/manager.js.map +1 -1
- package/dist/src/schema/rename-rewriter.d.ts +142 -0
- package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
- package/dist/src/schema/rename-rewriter.js +254 -9
- package/dist/src/schema/rename-rewriter.js.map +1 -1
- package/dist/src/schema/reserved-tags.d.ts +1 -1
- package/dist/src/schema/reserved-tags.d.ts.map +1 -1
- package/dist/src/schema/reserved-tags.js +4 -3
- package/dist/src/schema/reserved-tags.js.map +1 -1
- package/dist/src/schema/schema-differ.d.ts +16 -0
- package/dist/src/schema/schema-differ.d.ts.map +1 -1
- package/dist/src/schema/schema-differ.js +225 -38
- package/dist/src/schema/schema-differ.js.map +1 -1
- package/dist/src/schema/table.d.ts +149 -1
- package/dist/src/schema/table.d.ts.map +1 -1
- package/dist/src/schema/table.js +248 -1
- package/dist/src/schema/table.js.map +1 -1
- package/dist/src/schema/unique-enforcement.d.ts +5 -3
- package/dist/src/schema/unique-enforcement.d.ts.map +1 -1
- package/dist/src/schema/unique-enforcement.js +5 -3
- package/dist/src/schema/unique-enforcement.js.map +1 -1
- package/dist/src/schema/view.d.ts +11 -0
- package/dist/src/schema/view.d.ts.map +1 -1
- package/dist/src/schema/view.js +12 -0
- package/dist/src/schema/view.js.map +1 -1
- package/dist/src/types/builtin-types.d.ts +54 -0
- package/dist/src/types/builtin-types.d.ts.map +1 -1
- package/dist/src/types/builtin-types.js +123 -34
- package/dist/src/types/builtin-types.js.map +1 -1
- package/dist/src/types/cast-semantics.d.ts +42 -0
- package/dist/src/types/cast-semantics.d.ts.map +1 -1
- package/dist/src/types/cast-semantics.js +64 -0
- package/dist/src/types/cast-semantics.js.map +1 -1
- package/dist/src/types/comparison-coercion.d.ts +101 -0
- package/dist/src/types/comparison-coercion.d.ts.map +1 -0
- package/dist/src/types/comparison-coercion.js +162 -0
- package/dist/src/types/comparison-coercion.js.map +1 -0
- package/dist/src/types/index.d.ts +2 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +2 -2
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/logical-type.d.ts +7 -0
- package/dist/src/types/logical-type.d.ts.map +1 -1
- package/dist/src/types/logical-type.js.map +1 -1
- package/dist/src/types/validation.d.ts +56 -0
- package/dist/src/types/validation.d.ts.map +1 -1
- package/dist/src/types/validation.js +68 -0
- package/dist/src/types/validation.js.map +1 -1
- package/dist/src/util/{working-table-iterable.d.ts → array-row-iterable.d.ts} +6 -6
- package/dist/src/util/array-row-iterable.d.ts.map +1 -0
- package/dist/src/util/{working-table-iterable.js → array-row-iterable.js} +6 -6
- package/dist/src/util/array-row-iterable.js.map +1 -0
- package/dist/src/util/coercion.d.ts +8 -0
- package/dist/src/util/coercion.d.ts.map +1 -1
- package/dist/src/util/coercion.js +8 -0
- package/dist/src/util/coercion.js.map +1 -1
- package/dist/src/util/comparison.d.ts +16 -3
- package/dist/src/util/comparison.d.ts.map +1 -1
- package/dist/src/util/comparison.js +21 -5
- package/dist/src/util/comparison.js.map +1 -1
- package/dist/src/util/key-serializer.d.ts +46 -0
- package/dist/src/util/key-serializer.d.ts.map +1 -1
- package/dist/src/util/key-serializer.js +47 -0
- package/dist/src/util/key-serializer.js.map +1 -1
- package/dist/src/util/value-set.d.ts +21 -0
- package/dist/src/util/value-set.d.ts.map +1 -0
- package/dist/src/util/value-set.js +22 -0
- package/dist/src/util/value-set.js.map +1 -0
- package/dist/src/vtab/capabilities.d.ts +1 -1
- package/dist/src/vtab/events.d.ts +8 -1
- package/dist/src/vtab/events.d.ts.map +1 -1
- package/dist/src/vtab/events.js.map +1 -1
- package/dist/src/vtab/manifest.d.ts +15 -0
- package/dist/src/vtab/manifest.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/alter-column.d.ts +147 -0
- package/dist/src/vtab/memory/layer/alter-column.d.ts.map +1 -0
- package/dist/src/vtab/memory/layer/alter-column.js +214 -0
- package/dist/src/vtab/memory/layer/alter-column.js.map +1 -0
- package/dist/src/vtab/memory/layer/base.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/base.js +4 -3
- package/dist/src/vtab/memory/layer/base.js.map +1 -1
- package/dist/src/vtab/memory/layer/interface.d.ts +2 -2
- package/dist/src/vtab/memory/layer/interface.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.d.ts +176 -25
- package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.js +569 -558
- package/dist/src/vtab/memory/layer/manager.js.map +1 -1
- package/dist/src/vtab/memory/layer/scan-layer.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/scan-layer.js +32 -5
- package/dist/src/vtab/memory/layer/scan-layer.js.map +1 -1
- package/dist/src/vtab/memory/layer/transaction.d.ts +101 -15
- package/dist/src/vtab/memory/layer/transaction.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/transaction.js +133 -45
- package/dist/src/vtab/memory/layer/transaction.js.map +1 -1
- package/dist/src/vtab/memory/module.d.ts +16 -1
- package/dist/src/vtab/memory/module.d.ts.map +1 -1
- package/dist/src/vtab/memory/module.js +64 -3
- package/dist/src/vtab/memory/module.js.map +1 -1
- package/dist/src/vtab/memory/table.d.ts.map +1 -1
- package/dist/src/vtab/memory/table.js +11 -6
- package/dist/src/vtab/memory/table.js.map +1 -1
- package/dist/src/vtab/module.d.ts +77 -23
- package/dist/src/vtab/module.d.ts.map +1 -1
- package/dist/src/vtab/table.d.ts +9 -2
- package/dist/src/vtab/table.d.ts.map +1 -1
- package/dist/src/vtab/table.js +1 -1
- package/dist/src/vtab/table.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/util/working-table-iterable.d.ts.map +0 -1
- package/dist/src/util/working-table-iterable.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { PhysicalType } from './logical-type.js';
|
|
2
|
+
import { NULL_TYPE, NUMERIC_TYPE } from './builtin-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* THE type-level decision behind every comparison-site coercion: given the
|
|
5
|
+
* declared types of the operands, which of them must be converted, and to what.
|
|
6
|
+
* Purely about `LogicalType` — no plan nodes, no values — so both consumers read
|
|
7
|
+
* the same rule and cannot drift:
|
|
8
|
+
*
|
|
9
|
+
* - **Plan-time** (`planner/building/coercion.ts`) maps the answer onto synthetic
|
|
10
|
+
* `CastNode` wrappers, for `=` and friends, BETWEEN, IN value lists and simple
|
|
11
|
+
* CASE.
|
|
12
|
+
* - **Emit-time** (`runtime/emit/operand-comparator.ts` `makeComparisonGroup`)
|
|
13
|
+
* maps the same answer onto per-row {@link import('./cast-semantics.js').lenientCast}
|
|
14
|
+
* calls, for the comparison builtins that *return* one of their arguments
|
|
15
|
+
* (`nullif`, `greatest`, `least`) and therefore cannot have that argument
|
|
16
|
+
* replaced by its cast.
|
|
17
|
+
*
|
|
18
|
+
* Both paths convert identically: a plan-time `CastNode` runs `lenientCast` per
|
|
19
|
+
* row too (`runtime/emit/cast.ts`), so "compare the converted copy" and "compare
|
|
20
|
+
* the cast operand" are the same comparison.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* The argument positions a function's `comparesArgs` declaration
|
|
24
|
+
* ({@link import('../schema/function.js').BaseFunctionSchema.comparesArgs}) names,
|
|
25
|
+
* clamped to the call's actual arity. Index 0 of the result is the group's probe.
|
|
26
|
+
* Shared by the plan-time rewrite and the emit-time group builder so they cannot
|
|
27
|
+
* disagree about which positions form the group.
|
|
28
|
+
*/
|
|
29
|
+
export function comparisonGroupIndices(comparesArgs, argCount) {
|
|
30
|
+
return comparesArgs === 'all'
|
|
31
|
+
? Array.from({ length: argCount }, (_, i) => i)
|
|
32
|
+
: comparesArgs.filter(i => i >= 0 && i < argCount);
|
|
33
|
+
}
|
|
34
|
+
const isObject = (type) => type.physicalType === PhysicalType.OBJECT;
|
|
35
|
+
/**
|
|
36
|
+
* Reconcile two operand types that cannot be compared meaningfully as-is.
|
|
37
|
+
* Returns `null` when neither side converts.
|
|
38
|
+
*
|
|
39
|
+
* Two pairings are handled, in this order:
|
|
40
|
+
*
|
|
41
|
+
* 1. **Object-physical vs anything else.** JSON is the engine's only logical type
|
|
42
|
+
* whose `physicalType` is `PhysicalType.OBJECT`: its runtime values are native
|
|
43
|
+
* JS objects/arrays, which `compareSqlValuesFast` short-circuits against any
|
|
44
|
+
* other storage class — so `json_col = '{"a":1}'` was unconditionally false,
|
|
45
|
+
* even for byte-identical text. The non-object side converts to the object
|
|
46
|
+
* side's type, never the reverse: converting the JSON side to text would make
|
|
47
|
+
* equality depend on spelling and put `=` out of step with the index, which
|
|
48
|
+
* compares structurally.
|
|
49
|
+
*
|
|
50
|
+
* The gate is deliberately `physicalType === OBJECT`, **not**
|
|
51
|
+
* `semanticOrdering`. DATE/TIME/DATETIME/TIMESPAN also carry semantic ordering
|
|
52
|
+
* but are physically text, and the runtime's `tryTemporalComparison` already
|
|
53
|
+
* reconciles them; routing them through a conversion would change behavior for
|
|
54
|
+
* no gain.
|
|
55
|
+
*
|
|
56
|
+
* A conversion to JSON is lenient (see `types/cast-semantics.ts`): text that
|
|
57
|
+
* does not parse comes back unchanged, so `json_col = 'not json'` is false
|
|
58
|
+
* rather than an error. Note the consequence for JSON *string scalars*, which
|
|
59
|
+
* are stored as plain JS strings: a column holding `"hello"` matches BOTH the
|
|
60
|
+
* SQL literal `'"hello"'` (parses to the JSON string `hello`) and the bare
|
|
61
|
+
* `'hello'` (does not parse, falls back to the raw string `hello`, which
|
|
62
|
+
* `JSON_TYPE.compare` then compares as text). Only the first form generalizes —
|
|
63
|
+
* `'[1,2]'` matches the JSON array while a bare `[1,2]` is not SQL text at all.
|
|
64
|
+
*
|
|
65
|
+
* A NULL-typed operand is left alone: the comparison is UNKNOWN regardless, so
|
|
66
|
+
* the conversion would only add a runtime hop.
|
|
67
|
+
*
|
|
68
|
+
* 2. **Numeric vs textual.** The textual operand converts to the numeric side's
|
|
69
|
+
* type (e.g. INTEGER or REAL) so the runtime can take the fast path.
|
|
70
|
+
*/
|
|
71
|
+
export function crossTypeCoercion(left, right) {
|
|
72
|
+
const leftObject = isObject(left);
|
|
73
|
+
const rightObject = isObject(right);
|
|
74
|
+
// NOTE: two object-physical operands of DIFFERENT logical types fall through both
|
|
75
|
+
// arms onto the generic runtime path. Unreachable while JSON is the only
|
|
76
|
+
// PhysicalType.OBJECT type; adding a second one means deciding which side converts.
|
|
77
|
+
if (leftObject !== rightObject) {
|
|
78
|
+
if (leftObject && right !== NULL_TYPE)
|
|
79
|
+
return { side: 'right', target: left };
|
|
80
|
+
if (rightObject && left !== NULL_TYPE)
|
|
81
|
+
return { side: 'left', target: right };
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
if (left.isNumeric && right.isTextual)
|
|
85
|
+
return { side: 'right', target: left };
|
|
86
|
+
if (right.isNumeric && left.isTextual)
|
|
87
|
+
return { side: 'left', target: right };
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Per-operand conversion target for a "one probe against many values" comparison
|
|
92
|
+
* group — an IN value list, a simple CASE, or a comparison builtin's argument
|
|
93
|
+
* group. Index 0 is the probe, the rest the value list. The result is aligned with
|
|
94
|
+
* the input array; `null` at a position means "leave that operand alone".
|
|
95
|
+
*
|
|
96
|
+
* This is more than a `map` over {@link crossTypeCoercion} because the probe is a
|
|
97
|
+
* SINGLE operand shared by every value, so it can convert at most once:
|
|
98
|
+
*
|
|
99
|
+
* - **A value-side conversion is per value** and never conflicts: an
|
|
100
|
+
* object-physical or numeric probe leaves the probe alone and converts each
|
|
101
|
+
* value independently, so a mixed list (`case i when '1' when 2 …`) gets a
|
|
102
|
+
* per-clause decision for free.
|
|
103
|
+
* - **A probe-side conversion is hoisted** and therefore has to be unambiguous.
|
|
104
|
+
* For the object arm it always is: a conversion to JSON is lenient, so a textual
|
|
105
|
+
* value that is not JSON source survives as itself and still compares as text.
|
|
106
|
+
* For the numeric arm it is NOT — `cast('abc' as real)` is `0`, so hoisting a
|
|
107
|
+
* probe conversion over a MIXED list would make `t in (1, 'abc')` true for the
|
|
108
|
+
* stored text `'0'`, which `t = 1 or t = 'abc'` is not. So the numeric probe
|
|
109
|
+
* conversion applies only when every non-NULL value is numeric.
|
|
110
|
+
*
|
|
111
|
+
* NOTE: the leftover gap is a textual probe against a list mixing numeric and
|
|
112
|
+
* textual values (`text_col in (1, 'abc')`), which stays unconverted and so still
|
|
113
|
+
* disagrees with the `=` disjunction on the numeric member. Closing it needs a
|
|
114
|
+
* per-value probe, which `IN` cannot express — its members live in ONE key space
|
|
115
|
+
* (a BTree keyed under one collation, `runtime/emit/subquery.ts`). If that shape
|
|
116
|
+
* ever matters, desugar a mixed `IN` list into an `OR` of `=` comparisons at build
|
|
117
|
+
* time rather than widening the hoist here.
|
|
118
|
+
*/
|
|
119
|
+
export function comparisonGroupCoercions(logicals) {
|
|
120
|
+
const none = logicals.map(() => null);
|
|
121
|
+
if (logicals.length < 2)
|
|
122
|
+
return none;
|
|
123
|
+
const probe = logicals[0];
|
|
124
|
+
const values = logicals.slice(1);
|
|
125
|
+
/** The value-side half of a pairwise decision against an already-settled probe type. */
|
|
126
|
+
const valueTarget = (probeType, value) => {
|
|
127
|
+
const coercion = crossTypeCoercion(probeType, value);
|
|
128
|
+
return coercion?.side === 'right' ? coercion.target : null;
|
|
129
|
+
};
|
|
130
|
+
// Object arm: the non-object side converts, exactly as the pairwise function decides.
|
|
131
|
+
const objectValue = values.find(isObject);
|
|
132
|
+
if (isObject(probe) || objectValue) {
|
|
133
|
+
const effectiveProbe = isObject(probe) ? probe : objectValue;
|
|
134
|
+
return [
|
|
135
|
+
isObject(probe) ? null : effectiveProbe,
|
|
136
|
+
...values.map(value => valueTarget(effectiveProbe, value)),
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
// Numeric probe: every textual value converts to the probe's numeric type, independently.
|
|
140
|
+
if (probe.isNumeric) {
|
|
141
|
+
return [null, ...values.map(value => valueTarget(probe, value))];
|
|
142
|
+
}
|
|
143
|
+
// Textual probe: one hoisted conversion, but only over an all-numeric value list.
|
|
144
|
+
if (probe.isTextual) {
|
|
145
|
+
const nonNull = values.filter(type => type !== NULL_TYPE);
|
|
146
|
+
if (nonNull.length > 0 && nonNull.every(type => type.isNumeric)) {
|
|
147
|
+
return [commonNumericType(nonNull), ...values.map(() => null)];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return none;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The conversion target for a hoisted probe over an all-numeric value list. One
|
|
154
|
+
* shared type means one key space; NUMERIC is the fallback because its value
|
|
155
|
+
* space (`number | bigint`) covers INTEGER and REAL together, so a list mixing a
|
|
156
|
+
* bigint literal with a real one does not have to pick a lossy winner.
|
|
157
|
+
*/
|
|
158
|
+
function commonNumericType(valueTypes) {
|
|
159
|
+
const first = valueTypes[0];
|
|
160
|
+
return valueTypes.every(type => type === first) ? first : NUMERIC_TYPE;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=comparison-coercion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison-coercion.js","sourceRoot":"","sources":["../../../src/types/comparison-coercion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACrC,YAAuC,EACvC,QAAgB;IAEhB,OAAO,YAAY,KAAK,KAAK;QAC5B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;AACrD,CAAC;AAQD,MAAM,QAAQ,GAAG,CAAC,IAAiB,EAAW,EAAE,CAAC,IAAI,CAAC,YA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I,CAAC,SAAS,CAAC,EAAE,CAAC;YACjE,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,UAAkC;IAC5D,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC;AACxE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PhysicalType, type LogicalType, getPhysicalType, physicalTypeName, compareNulls } from './logical-type.js';
|
|
2
|
-
export { NULL_TYPE, INTEGER_TYPE, REAL_TYPE, TEXT_TYPE, BLOB_TYPE, BOOLEAN_TYPE, NUMERIC_TYPE, ANY_TYPE } from './builtin-types.js';
|
|
2
|
+
export { NULL_TYPE, INTEGER_TYPE, REAL_TYPE, TEXT_TYPE, BLOB_TYPE, BOOLEAN_TYPE, NUMERIC_TYPE, ANY_TYPE, isNumericOrUnknownType, sharesSeekKeySpace } from './builtin-types.js';
|
|
3
3
|
export { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
4
4
|
export { JSON_TYPE } from './json-type.js';
|
|
5
5
|
export { typeRegistry, registerType, getType, getTypeOrDefault, inferType } from './registry.js';
|
|
6
|
-
export { validateValue, parseValue, validateAndParse, coerceRowToSchema, isValidForType, tryParse } from './validation.js';
|
|
6
|
+
export { validateValue, parseValue, validateAndParse, coerceRowToSchema, foldDefaultToType, isValidForType, tryParse } from './validation.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,MAAM,oBAAoB,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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzF,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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Core type system exports
|
|
2
2
|
export { PhysicalType, getPhysicalType, physicalTypeName, compareNulls } from './logical-type.js';
|
|
3
3
|
// Built-in types
|
|
4
|
-
export { NULL_TYPE, INTEGER_TYPE, REAL_TYPE, TEXT_TYPE, BLOB_TYPE, BOOLEAN_TYPE, NUMERIC_TYPE, ANY_TYPE } from './builtin-types.js';
|
|
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
6
|
export { DATE_TYPE, TIME_TYPE, DATETIME_TYPE, TIMESPAN_TYPE } from './temporal-types.js';
|
|
7
7
|
// JSON type
|
|
@@ -9,5 +9,5 @@ export { JSON_TYPE } from './json-type.js';
|
|
|
9
9
|
// Type registry
|
|
10
10
|
export { typeRegistry, registerType, getType, getTypeOrDefault, inferType } from './registry.js';
|
|
11
11
|
// Validation utilities
|
|
12
|
-
export { validateValue, parseValue, validateAndParse, coerceRowToSchema, isValidForType, tryParse } from './validation.js';
|
|
12
|
+
export { validateValue, parseValue, validateAndParse, coerceRowToSchema, foldDefaultToType, isValidForType, tryParse } from './validation.js';
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,MAAM,oBAAoB,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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzF,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"}
|
|
@@ -58,6 +58,13 @@ export interface LogicalType {
|
|
|
58
58
|
parse?(value: SqlValue): SqlValue;
|
|
59
59
|
/** Type-specific comparison function */
|
|
60
60
|
compare?(a: SqlValue, b: SqlValue, collation?: CollationFunction): number;
|
|
61
|
+
/**
|
|
62
|
+
* True when {@link compare} actually applies the collation function it is handed
|
|
63
|
+
* (TEXT, ANY). When unset, the type's compare is collation-blind, so a key
|
|
64
|
+
* structure over such a column must be keyed under BINARY regardless of the
|
|
65
|
+
* column's declared COLLATE — see `pkKeyCollationName`.
|
|
66
|
+
*/
|
|
67
|
+
collationAware?: boolean;
|
|
61
68
|
/**
|
|
62
69
|
* True when {@link compare} defines an order that OBSERVABLY differs from
|
|
63
70
|
* storage-class + collation ordering of the stored representation (e.g. TIMESPAN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logical-type.d.ts","sourceRoot":"","sources":["../../../src/types/logical-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,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IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,YAAY,CAAC,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,GACb;QAAE,cAAc,EAAE,QAAQ,CAAC;QAAC,cAAc,EAAE,QAAQ,CAAA;KAAE,GAAG,SAAS,CAAC;CACtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,YAAY,CAW7D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAWnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logical-type.js","sourceRoot":"","sources":["../../../src/types/logical-type.ts"],"names":[],"mappings":"AAqCA;;;GAGG;AACH,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IACvB,+CAAQ,CAAA;IACR,qDAAW,CAAA;IACX,+CAAQ,CAAA;IACR,+CAAQ,CAAA;IACR,+CAAQ,CAAA;IACR,qDAAW,CAAA;IACX,mDAAU,CAAA;AACX,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB;
|
|
1
|
+
{"version":3,"file":"logical-type.js","sourceRoot":"","sources":["../../../src/types/logical-type.ts"],"names":[],"mappings":"AAqCA;;;GAGG;AACH,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IACvB,+CAAQ,CAAA;IACR,qDAAW,CAAA;IACX,+CAAQ,CAAA;IACR,+CAAQ,CAAA;IACR,+CAAQ,CAAA;IACR,qDAAW,CAAA;IACX,mDAAU,CAAA;AACX,CAAC,EARW,YAAY,K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AS,CAAC;QAC5C,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC;QACtC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC;QACtC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC;QACtC,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;QAC5C,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC;QAC1C,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;IAC3B,CAAC;AACF,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Row, SqlValue } from '../common/types.js';
|
|
2
2
|
import type { LogicalType } from './logical-type.js';
|
|
3
3
|
import type { ColumnSchema } from '../schema/column.js';
|
|
4
|
+
import type { Expression } from '../parser/ast.js';
|
|
4
5
|
/**
|
|
5
6
|
* Validate a value against a logical type.
|
|
6
7
|
* Throws an error if the value is invalid.
|
|
@@ -71,6 +72,61 @@ export declare function coerceRowToSchema(row: Row, columns: readonly ColumnSche
|
|
|
71
72
|
* guard, mirroring {@link coerceRowToSchema}'s map-over-present-cells behavior.
|
|
72
73
|
*/
|
|
73
74
|
export declare function buildRowCoercion(sourceTypes: ReadonlyArray<LogicalType | undefined>, columns: readonly ColumnSchema[]): ((row: Row) => Row) | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Fold a DEFAULT expression to a literal AND convert it to the column's declared
|
|
77
|
+
* logical type — the value a fresh INSERT under the same DEFAULT would store. Every
|
|
78
|
+
* ALTER backfill site (ADD COLUMN literal default, SET NOT NULL backfill, and their
|
|
79
|
+
* event-image remaps, across the memory module, the store module and the isolation
|
|
80
|
+
* overlay) goes through here, so a backfilled cell is indistinguishable from an
|
|
81
|
+
* inserted one and the sites cannot drift apart.
|
|
82
|
+
*
|
|
83
|
+
* Returns `undefined` when the expression does not fold to a literal (the caller's
|
|
84
|
+
* per-row evaluator path owns that case) and `null` when it folds to NULL. An AST
|
|
85
|
+
* literal is always raw source form (a TEXT literal `'"abc"'`, never an already-parsed
|
|
86
|
+
* JSON value), so unlike {@link buildRowCoercion} this needs no identity guard — the
|
|
87
|
+
* conversion is always the first one applied to the value.
|
|
88
|
+
*
|
|
89
|
+
* NOTE: that "raw source form" invariant holds because every DEFAULT expression here comes
|
|
90
|
+
* from the parser (schema round-trips re-stringify and re-parse it). If a path ever
|
|
91
|
+
* synthesizes a DEFAULT AST node from an already-stored value, this becomes a second
|
|
92
|
+
* conversion and needs the same identity guard `buildRowCoercion` carries.
|
|
93
|
+
*
|
|
94
|
+
* @throws QuereusError (MISMATCH) when the literal cannot be converted, carrying the
|
|
95
|
+
* same message text the INSERT path produces.
|
|
96
|
+
*/
|
|
97
|
+
export declare function foldDefaultToType(expr: Expression | null | undefined, logicalType: LogicalType, columnName: string): SqlValue | undefined;
|
|
98
|
+
/** What {@link planRetypeConversion} decided for one `alter column … set data type`. */
|
|
99
|
+
export interface RetypeConversion {
|
|
100
|
+
/** The target's logical type, resolved via {@link inferType}. */
|
|
101
|
+
readonly newLogicalType: LogicalType;
|
|
102
|
+
/**
|
|
103
|
+
* `null` for a metadata-only (alias) retype — nothing to rewrite. Otherwise converts one
|
|
104
|
+
* non-NULL value; callers route NULLs around it themselves (`set data type` leaves them
|
|
105
|
+
* untouched, a NOT NULL backfill maps them to DEFAULT before this ever sees them).
|
|
106
|
+
*/
|
|
107
|
+
readonly convert: ((value: SqlValue) => SqlValue) | null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Decide whether `alter column … set data type` rewrites stored values, and if so, build the
|
|
111
|
+
* per-value converter. Shared by every backend that implements SET DATA TYPE (the memory
|
|
112
|
+
* module, the KV store module, and the isolation overlay's staged-row migration) so the
|
|
113
|
+
* "does this retype touch anything" gate and the conversion failure's message/status code
|
|
114
|
+
* cannot drift between them — the isolation layer keys its own error routing off that status
|
|
115
|
+
* code, deciding whether another connection's staged rows are marked unusable rather than
|
|
116
|
+
* aborting the ALTER outright.
|
|
117
|
+
*
|
|
118
|
+
* Gated on logical-type IDENTITY, not physical storage class: {@link inferType} flattens
|
|
119
|
+
* aliases to the shared type object (`varchar(50)` IS `TEXT_TYPE`), so an alias retype
|
|
120
|
+
* returns a `null` converter. Any other retype — including a same-storage-class move like
|
|
121
|
+
* text → date — returns one that validates AND normalizes to the new type's canonical
|
|
122
|
+
* spelling, rethrowing a parse/validate failure as `QuereusError(MISMATCH)`.
|
|
123
|
+
*
|
|
124
|
+
* @param dataType The target type name as written in the ALTER statement (echoed into the
|
|
125
|
+
* failure message verbatim)
|
|
126
|
+
* @param oldLogicalType The column's CURRENT logical type
|
|
127
|
+
* @param columnName The column name (echoed into the failure message)
|
|
128
|
+
*/
|
|
129
|
+
export declare function planRetypeConversion(dataType: string, oldLogicalType: LogicalType, columnName: string): RetypeConversion;
|
|
74
130
|
/**
|
|
75
131
|
* Check if a value is compatible with a logical type without throwing.
|
|
76
132
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/types/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/types/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD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gB,oBAAoB,CACnC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,WAAW,EAC3B,UAAU,EAAE,MAAM,GAChB,gBAAgB,CAgBlB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAI1E;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAM5E"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { StatusCode } from '../common/types.js';
|
|
2
2
|
import { QuereusError } from '../common/errors.js';
|
|
3
|
+
import { tryFoldLiteral } from '../parser/utils.js';
|
|
4
|
+
import { inferType } from './registry.js';
|
|
3
5
|
/**
|
|
4
6
|
* Validate a value against a logical type.
|
|
5
7
|
* Throws an error if the value is invalid.
|
|
@@ -124,6 +126,72 @@ export function buildRowCoercion(sourceTypes, columns) {
|
|
|
124
126
|
return out;
|
|
125
127
|
};
|
|
126
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Fold a DEFAULT expression to a literal AND convert it to the column's declared
|
|
131
|
+
* logical type — the value a fresh INSERT under the same DEFAULT would store. Every
|
|
132
|
+
* ALTER backfill site (ADD COLUMN literal default, SET NOT NULL backfill, and their
|
|
133
|
+
* event-image remaps, across the memory module, the store module and the isolation
|
|
134
|
+
* overlay) goes through here, so a backfilled cell is indistinguishable from an
|
|
135
|
+
* inserted one and the sites cannot drift apart.
|
|
136
|
+
*
|
|
137
|
+
* Returns `undefined` when the expression does not fold to a literal (the caller's
|
|
138
|
+
* per-row evaluator path owns that case) and `null` when it folds to NULL. An AST
|
|
139
|
+
* literal is always raw source form (a TEXT literal `'"abc"'`, never an already-parsed
|
|
140
|
+
* JSON value), so unlike {@link buildRowCoercion} this needs no identity guard — the
|
|
141
|
+
* conversion is always the first one applied to the value.
|
|
142
|
+
*
|
|
143
|
+
* NOTE: that "raw source form" invariant holds because every DEFAULT expression here comes
|
|
144
|
+
* from the parser (schema round-trips re-stringify and re-parse it). If a path ever
|
|
145
|
+
* synthesizes a DEFAULT AST node from an already-stored value, this becomes a second
|
|
146
|
+
* conversion and needs the same identity guard `buildRowCoercion` carries.
|
|
147
|
+
*
|
|
148
|
+
* @throws QuereusError (MISMATCH) when the literal cannot be converted, carrying the
|
|
149
|
+
* same message text the INSERT path produces.
|
|
150
|
+
*/
|
|
151
|
+
export function foldDefaultToType(expr, logicalType, columnName) {
|
|
152
|
+
if (!expr)
|
|
153
|
+
return undefined;
|
|
154
|
+
const folded = tryFoldLiteral(expr);
|
|
155
|
+
if (folded === undefined)
|
|
156
|
+
return undefined;
|
|
157
|
+
return validateAndParse(folded, logicalType, columnName);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Decide whether `alter column … set data type` rewrites stored values, and if so, build the
|
|
161
|
+
* per-value converter. Shared by every backend that implements SET DATA TYPE (the memory
|
|
162
|
+
* module, the KV store module, and the isolation overlay's staged-row migration) so the
|
|
163
|
+
* "does this retype touch anything" gate and the conversion failure's message/status code
|
|
164
|
+
* cannot drift between them — the isolation layer keys its own error routing off that status
|
|
165
|
+
* code, deciding whether another connection's staged rows are marked unusable rather than
|
|
166
|
+
* aborting the ALTER outright.
|
|
167
|
+
*
|
|
168
|
+
* Gated on logical-type IDENTITY, not physical storage class: {@link inferType} flattens
|
|
169
|
+
* aliases to the shared type object (`varchar(50)` IS `TEXT_TYPE`), so an alias retype
|
|
170
|
+
* returns a `null` converter. Any other retype — including a same-storage-class move like
|
|
171
|
+
* text → date — returns one that validates AND normalizes to the new type's canonical
|
|
172
|
+
* spelling, rethrowing a parse/validate failure as `QuereusError(MISMATCH)`.
|
|
173
|
+
*
|
|
174
|
+
* @param dataType The target type name as written in the ALTER statement (echoed into the
|
|
175
|
+
* failure message verbatim)
|
|
176
|
+
* @param oldLogicalType The column's CURRENT logical type
|
|
177
|
+
* @param columnName The column name (echoed into the failure message)
|
|
178
|
+
*/
|
|
179
|
+
export function planRetypeConversion(dataType, oldLogicalType, columnName) {
|
|
180
|
+
const newLogicalType = inferType(dataType);
|
|
181
|
+
if (newLogicalType === oldLogicalType)
|
|
182
|
+
return { newLogicalType, convert: null };
|
|
183
|
+
return {
|
|
184
|
+
newLogicalType,
|
|
185
|
+
convert: (value) => {
|
|
186
|
+
try {
|
|
187
|
+
return validateAndParse(value, newLogicalType, columnName);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
throw new QuereusError(`Cannot convert value in '${columnName}' to ${dataType}`, StatusCode.MISMATCH);
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
127
195
|
/**
|
|
128
196
|
* Check if a value is compatible with a logical type without throwing.
|
|
129
197
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/types/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC5B,KAAe,EACf,IAAiB,EACjB,UAAmB;IAEnB,uBAAuB;IACvB,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,2BAA2B;IAC3B,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,gBAAgB,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,YAAY,CACrB,gBAAgB,OAAO,cAAc,IAAI,CAAC,IAAI,SAAS,OAAO,KAAK,EAAE,EACrE,UAAU,CAAC,QAAQ,CACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAA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O,IAAI,CAAC;IACb,CAAC;AACF,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { Row } from '../common/types.js';
|
|
2
2
|
/**
|
|
3
|
-
* A reusable async iterable
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* A reusable async iterable over an in-memory array of rows, iterable multiple times.
|
|
4
|
+
* Used for runtime-generated row sets that are already fully materialized — e.g. the
|
|
5
|
+
* working table of a recursive CTE iteration, or a statement's own eagerly-computed
|
|
6
|
+
* report rows (`ANALYZE`).
|
|
7
7
|
*
|
|
8
8
|
* Note: This class intentionally does NOT manage row context. The consumer
|
|
9
9
|
* (e.g. InternalRecursiveCTERef) is responsible for installing the appropriate
|
|
10
10
|
* row context via its own createRowSlot. Doing it here would conflict with the
|
|
11
11
|
* shared rowDescriptor used by the recursive CTE emitter's withRowContext calls.
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class ArrayRowIterable implements AsyncIterable<Row> {
|
|
14
14
|
private rows;
|
|
15
15
|
constructor(rows: Row[]);
|
|
16
16
|
[Symbol.asyncIterator](): AsyncIterator<Row>;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=array-row-iterable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-row-iterable.d.ts","sourceRoot":"","sources":["../../../src/util/array-row-iterable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,qBAAa,gBAAiB,YAAW,aAAa,CAAC,GAAG,CAAC;IAC9C,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,GAAG,EAAE;IAExB,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC;CAKnD"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A reusable async iterable
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* A reusable async iterable over an in-memory array of rows, iterable multiple times.
|
|
3
|
+
* Used for runtime-generated row sets that are already fully materialized — e.g. the
|
|
4
|
+
* working table of a recursive CTE iteration, or a statement's own eagerly-computed
|
|
5
|
+
* report rows (`ANALYZE`).
|
|
6
6
|
*
|
|
7
7
|
* Note: This class intentionally does NOT manage row context. The consumer
|
|
8
8
|
* (e.g. InternalRecursiveCTERef) is responsible for installing the appropriate
|
|
9
9
|
* row context via its own createRowSlot. Doing it here would conflict with the
|
|
10
10
|
* shared rowDescriptor used by the recursive CTE emitter's withRowContext calls.
|
|
11
11
|
*/
|
|
12
|
-
export class
|
|
12
|
+
export class ArrayRowIterable {
|
|
13
13
|
rows;
|
|
14
14
|
constructor(rows) {
|
|
15
15
|
this.rows = rows;
|
|
@@ -20,4 +20,4 @@ export class WorkingTableIterable {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=array-row-iterable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-row-iterable.js","sourceRoot":"","sources":["../../../src/util/array-row-iterable.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAgB;IACR;IAApB,YAAoB,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;IAAG,CAAC;IAEnC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7B,MAAM,GAAG,CAAC;QACX,CAAC;IACF,CAAC;CACD"}
|
|
@@ -13,6 +13,14 @@ export declare function tryCoerceToNumber(value: SqlValue): SqlValue;
|
|
|
13
13
|
* Converts a value to a number for arithmetic contexts.
|
|
14
14
|
* Non-numeric strings become 0 (SQL arithmetic semantics).
|
|
15
15
|
* Used for +, -, *, /, % operations.
|
|
16
|
+
*
|
|
17
|
+
* NOTE: return type is `number`, so a numeric string past
|
|
18
|
+
* Number.MAX_SAFE_INTEGER (e.g. `'9007199254740993' + 0`) rounds here —
|
|
19
|
+
* unlike CAST/comparison, which go through INTEGER_TYPE.parse/NUMERIC_TYPE.parse
|
|
20
|
+
* (types/builtin-types.ts) and preserve exact bigint precision past 2^53. Fixing
|
|
21
|
+
* this means widening this function's return type to `number | bigint` and
|
|
22
|
+
* propagating that into mixedBigIntArithmetic (runtime/emit/binary.ts) — separate
|
|
23
|
+
* blast radius from the CAST/comparison/insert fix this note sits next to.
|
|
16
24
|
*/
|
|
17
25
|
export declare function coerceToNumberForArithmetic(value: SqlValue): number;
|
|
18
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercion.d.ts","sourceRoot":"","sources":["../../../src/util/coercion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAU3D;AAED
|
|
1
|
+
{"version":3,"file":"coercion.d.ts","sourceRoot":"","sources":["../../../src/util/coercion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAU3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAWnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAyBpF;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,CAWlF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CASvD"}
|
|
@@ -22,6 +22,14 @@ export function tryCoerceToNumber(value) {
|
|
|
22
22
|
* Converts a value to a number for arithmetic contexts.
|
|
23
23
|
* Non-numeric strings become 0 (SQL arithmetic semantics).
|
|
24
24
|
* Used for +, -, *, /, % operations.
|
|
25
|
+
*
|
|
26
|
+
* NOTE: return type is `number`, so a numeric string past
|
|
27
|
+
* Number.MAX_SAFE_INTEGER (e.g. `'9007199254740993' + 0`) rounds here —
|
|
28
|
+
* unlike CAST/comparison, which go through INTEGER_TYPE.parse/NUMERIC_TYPE.parse
|
|
29
|
+
* (types/builtin-types.ts) and preserve exact bigint precision past 2^53. Fixing
|
|
30
|
+
* this means widening this function's return type to `number | bigint` and
|
|
31
|
+
* propagating that into mixedBigIntArithmetic (runtime/emit/binary.ts) — separate
|
|
32
|
+
* blast radius from the CAST/comparison/insert fix this note sits next to.
|
|
25
33
|
*/
|
|
26
34
|
export function coerceToNumberForArithmetic(value) {
|
|
27
35
|
if (typeof value === 'number') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercion.js","sourceRoot":"","sources":["../../../src/util/coercion.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAe;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtD,yBAAyB;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ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AAI,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtD,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAe;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1F,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -181,6 +181,15 @@ export declare function createOrderByComparatorFast(direction?: 'asc' | 'desc',
|
|
|
181
181
|
* the type's `compare` exactly when this returns true.
|
|
182
182
|
*/
|
|
183
183
|
export declare function hasSemanticOrdering(type: LogicalType | undefined): type is LogicalType;
|
|
184
|
+
/**
|
|
185
|
+
* True when a logical type's `compare` applies the collation function it is handed
|
|
186
|
+
* (see {@link LogicalType.collationAware} — TEXT and ANY). A declared-key structure
|
|
187
|
+
* (memory PK/index BTree, the store's key encoding, the isolation overlay's shadow
|
|
188
|
+
* keys) over a column of such a type must key under the column's declared collation;
|
|
189
|
+
* over a collation-blind type it must key under BINARY, or the key order/identity
|
|
190
|
+
* diverges from the comparator that actually orders the structure.
|
|
191
|
+
*/
|
|
192
|
+
export declare function isCollationAware(type: LogicalType | undefined): boolean;
|
|
184
193
|
/**
|
|
185
194
|
* True when two logical types order values differently — i.e. the comparators
|
|
186
195
|
* {@link createTypedComparator} builds for them are not interchangeable, so any structure
|
|
@@ -205,7 +214,9 @@ export declare function hasSemanticOrdering(type: LogicalType | undefined): type
|
|
|
205
214
|
* NOTE: deliberately conservative — it answers "may the order move", not "does it". The
|
|
206
215
|
* DATE / TIME / DATETIME family compares exactly as BINARY text does, so under the only
|
|
207
216
|
* collation those types legally accept (BINARY — `supportedCollations: []`) a `text → date`
|
|
208
|
-
* retype re-sorts every structure into the order it was already in.
|
|
217
|
+
* retype re-sorts every structure into the order it was already in. `text ↔ any` is
|
|
218
|
+
* over-reported the same way: both types' `compare` honor the handed collation, so over
|
|
219
|
+
* all-text data a retype between them re-sorts into the same order. Harmless but O(rows);
|
|
209
220
|
* if a retype on a large table ever shows up as slow, narrow the predicate to a probe of the
|
|
210
221
|
* two comparators over a representative value set, or special-case the BINARY-equivalent
|
|
211
222
|
* comparators by identity.
|
|
@@ -281,8 +292,10 @@ export declare function createSemanticValueComparator(type: LogicalType | undefi
|
|
|
281
292
|
* keep the storage-class + collation comparison of
|
|
282
293
|
* {@link createCollationRowComparator}. This makes row identity agree with `=`
|
|
283
294
|
* (e.g. TIMESPAN 'PT1H' ≡ 'PT60M' collapses) without perturbing collation-aware
|
|
284
|
-
* text identity on ANY/TEXT columns
|
|
285
|
-
* collation
|
|
295
|
+
* text identity on ANY/TEXT columns: those types' `compare` now honors the handed
|
|
296
|
+
* collation (see {@link isCollationAware}) and is equivalent to the generic
|
|
297
|
+
* storage-class + collation path, so routing them through the cheaper generic
|
|
298
|
+
* comparator changes nothing.
|
|
286
299
|
*
|
|
287
300
|
* Per-column routing is {@link createSemanticValueComparator}.
|
|
288
301
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/util/comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EA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