@quereus/quereus 4.11.0 → 4.12.1
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/common/type-inference.d.ts +12 -6
- package/dist/src/common/type-inference.d.ts.map +1 -1
- package/dist/src/common/type-inference.js +12 -24
- package/dist/src/common/type-inference.js.map +1 -1
- package/dist/src/core/database-assertions.d.ts.map +1 -1
- package/dist/src/core/database-assertions.js +7 -5
- package/dist/src/core/database-assertions.js.map +1 -1
- package/dist/src/core/database-events.d.ts +4 -3
- package/dist/src/core/database-events.d.ts.map +1 -1
- package/dist/src/core/database-events.js +4 -3
- package/dist/src/core/database-events.js.map +1 -1
- package/dist/src/core/database-materialized-views-analysis.d.ts +1 -3
- package/dist/src/core/database-materialized-views-analysis.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views-analysis.js +1 -11
- package/dist/src/core/database-materialized-views-analysis.js.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 +12 -10
- package/dist/src/core/database-materialized-views-plan-builders.js.map +1 -1
- package/dist/src/core/database.d.ts.map +1 -1
- package/dist/src/core/database.js +13 -2
- 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 +14 -2
- package/dist/src/core/derived-row-validator.js.map +1 -1
- package/dist/src/core/param.d.ts +9 -0
- package/dist/src/core/param.d.ts.map +1 -1
- package/dist/src/core/param.js +21 -1
- package/dist/src/core/param.js.map +1 -1
- package/dist/src/core/statement.d.ts.map +1 -1
- package/dist/src/core/statement.js +38 -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 +7 -2
- 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 +27 -11
- package/dist/src/func/builtins/builtin-window-functions.js.map +1 -1
- package/dist/src/func/builtins/datetime.d.ts.map +1 -1
- package/dist/src/func/builtins/datetime.js +8 -3
- 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 +9 -29
- package/dist/src/func/builtins/explain.js.map +1 -1
- package/dist/src/func/builtins/json-tvf.d.ts.map +1 -1
- package/dist/src/func/builtins/json-tvf.js +14 -7
- package/dist/src/func/builtins/json-tvf.js.map +1 -1
- package/dist/src/func/builtins/return-types.d.ts +29 -0
- package/dist/src/func/builtins/return-types.d.ts.map +1 -1
- package/dist/src/func/builtins/return-types.js +4 -1
- package/dist/src/func/builtins/return-types.js.map +1 -1
- package/dist/src/func/builtins/scalar.d.ts.map +1 -1
- package/dist/src/func/builtins/scalar.js +22 -67
- 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 +26 -16
- package/dist/src/func/builtins/schema.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/parser/parser.d.ts.map +1 -1
- package/dist/src/parser/parser.js +8 -5
- package/dist/src/parser/parser.js.map +1 -1
- package/dist/src/parser/visitor.d.ts +16 -0
- package/dist/src/parser/visitor.d.ts.map +1 -1
- package/dist/src/parser/visitor.js +16 -0
- package/dist/src/parser/visitor.js.map +1 -1
- package/dist/src/planner/analysis/assertion-plan.d.ts +33 -0
- package/dist/src/planner/analysis/assertion-plan.d.ts.map +1 -0
- package/dist/src/planner/analysis/assertion-plan.js +39 -0
- package/dist/src/planner/analysis/assertion-plan.js.map +1 -0
- package/dist/src/planner/analysis/binary-operator-class.d.ts +55 -0
- package/dist/src/planner/analysis/binary-operator-class.d.ts.map +1 -0
- package/dist/src/planner/analysis/binary-operator-class.js +57 -0
- package/dist/src/planner/analysis/binary-operator-class.js.map +1 -0
- package/dist/src/planner/analysis/binding-extractor.d.ts +9 -3
- package/dist/src/planner/analysis/binding-extractor.d.ts.map +1 -1
- package/dist/src/planner/analysis/binding-extractor.js +11 -16
- package/dist/src/planner/analysis/binding-extractor.js.map +1 -1
- package/dist/src/planner/analysis/change-scope.d.ts.map +1 -1
- package/dist/src/planner/analysis/change-scope.js +19 -6
- package/dist/src/planner/analysis/change-scope.js.map +1 -1
- package/dist/src/planner/analysis/check-extraction.d.ts +1 -7
- package/dist/src/planner/analysis/check-extraction.d.ts.map +1 -1
- package/dist/src/planner/analysis/check-extraction.js.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.d.ts +17 -0
- package/dist/src/planner/analysis/comparison-collation.d.ts.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.js +17 -5
- package/dist/src/planner/analysis/comparison-collation.js.map +1 -1
- package/dist/src/planner/analysis/constraint-extractor.d.ts.map +1 -1
- package/dist/src/planner/analysis/constraint-extractor.js +18 -18
- package/dist/src/planner/analysis/constraint-extractor.js.map +1 -1
- package/dist/src/planner/analysis/coverage-prover.d.ts +11 -7
- package/dist/src/planner/analysis/coverage-prover.d.ts.map +1 -1
- package/dist/src/planner/analysis/coverage-prover.js +11 -7
- package/dist/src/planner/analysis/coverage-prover.js.map +1 -1
- package/dist/src/planner/analysis/equi-correlation.d.ts +1 -1
- package/dist/src/planner/analysis/equi-correlation.js +1 -1
- package/dist/src/planner/analysis/expression-fingerprint.d.ts.map +1 -1
- package/dist/src/planner/analysis/expression-fingerprint.js +0 -2
- package/dist/src/planner/analysis/expression-fingerprint.js.map +1 -1
- package/dist/src/planner/analysis/key-filter.d.ts.map +1 -1
- package/dist/src/planner/analysis/key-filter.js +2 -3
- package/dist/src/planner/analysis/key-filter.js.map +1 -1
- package/dist/src/planner/analysis/relation-key.d.ts +104 -0
- package/dist/src/planner/analysis/relation-key.d.ts.map +1 -0
- package/dist/src/planner/analysis/relation-key.js +121 -0
- package/dist/src/planner/analysis/relation-key.js.map +1 -0
- package/dist/src/planner/analysis/scalar-param-usage.d.ts.map +1 -1
- package/dist/src/planner/analysis/scalar-param-usage.js +12 -4
- package/dist/src/planner/analysis/scalar-param-usage.js.map +1 -1
- package/dist/src/planner/analysis/set-op-type-merge.d.ts +9 -3
- package/dist/src/planner/analysis/set-op-type-merge.d.ts.map +1 -1
- package/dist/src/planner/analysis/set-op-type-merge.js +22 -8
- package/dist/src/planner/analysis/set-op-type-merge.js.map +1 -1
- package/dist/src/planner/building/alter-table.d.ts.map +1 -1
- package/dist/src/planner/building/alter-table.js +31 -23
- package/dist/src/planner/building/alter-table.js.map +1 -1
- package/dist/src/planner/building/analyze.d.ts.map +1 -1
- package/dist/src/planner/building/analyze.js +21 -0
- package/dist/src/planner/building/analyze.js.map +1 -1
- package/dist/src/planner/building/block.d.ts.map +1 -1
- package/dist/src/planner/building/block.js +222 -82
- package/dist/src/planner/building/block.js.map +1 -1
- package/dist/src/planner/building/constraint-builder.d.ts.map +1 -1
- package/dist/src/planner/building/constraint-builder.js +5 -3
- package/dist/src/planner/building/constraint-builder.js.map +1 -1
- package/dist/src/planner/building/delete.js +1 -1
- package/dist/src/planner/building/delete.js.map +1 -1
- package/dist/src/planner/building/expression.d.ts.map +1 -1
- package/dist/src/planner/building/expression.js +11 -3
- package/dist/src/planner/building/expression.js.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.d.ts +16 -6
- package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.js +43 -20
- package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
- package/dist/src/planner/building/generated-column-scope.d.ts +58 -0
- package/dist/src/planner/building/generated-column-scope.d.ts.map +1 -0
- package/dist/src/planner/building/generated-column-scope.js +117 -0
- package/dist/src/planner/building/generated-column-scope.js.map +1 -0
- package/dist/src/planner/building/insert.d.ts.map +1 -1
- package/dist/src/planner/building/insert.js +20 -28
- package/dist/src/planner/building/insert.js.map +1 -1
- package/dist/src/planner/building/select-aggregates.d.ts +73 -132
- package/dist/src/planner/building/select-aggregates.d.ts.map +1 -1
- package/dist/src/planner/building/select-aggregates.js +405 -81
- package/dist/src/planner/building/select-aggregates.js.map +1 -1
- package/dist/src/planner/building/select-modifiers.d.ts +37 -8
- package/dist/src/planner/building/select-modifiers.d.ts.map +1 -1
- package/dist/src/planner/building/select-modifiers.js +8 -9
- package/dist/src/planner/building/select-modifiers.js.map +1 -1
- package/dist/src/planner/building/select-ordinal.d.ts +6 -0
- package/dist/src/planner/building/select-ordinal.d.ts.map +1 -1
- package/dist/src/planner/building/select-ordinal.js +1 -1
- package/dist/src/planner/building/select-ordinal.js.map +1 -1
- package/dist/src/planner/building/select-window.d.ts +2 -2
- package/dist/src/planner/building/select-window.d.ts.map +1 -1
- package/dist/src/planner/building/select-window.js +82 -101
- package/dist/src/planner/building/select-window.js.map +1 -1
- package/dist/src/planner/building/select.d.ts.map +1 -1
- package/dist/src/planner/building/select.js +78 -33
- 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 +14 -8
- package/dist/src/planner/building/update.js.map +1 -1
- package/dist/src/planner/building/view-mutation-builder.d.ts.map +1 -1
- package/dist/src/planner/building/view-mutation-builder.js +329 -14
- package/dist/src/planner/building/view-mutation-builder.js.map +1 -1
- package/dist/src/planner/building/with.d.ts +6 -0
- package/dist/src/planner/building/with.d.ts.map +1 -1
- package/dist/src/planner/building/with.js +52 -3
- package/dist/src/planner/building/with.js.map +1 -1
- package/dist/src/planner/cache/correlation-detector.d.ts.map +1 -1
- package/dist/src/planner/cache/correlation-detector.js +44 -17
- package/dist/src/planner/cache/correlation-detector.js.map +1 -1
- package/dist/src/planner/framework/physical-utils.d.ts +6 -0
- package/dist/src/planner/framework/physical-utils.d.ts.map +1 -1
- package/dist/src/planner/framework/physical-utils.js +6 -0
- package/dist/src/planner/framework/physical-utils.js.map +1 -1
- package/dist/src/planner/mutation/lens-enforcement.d.ts +123 -0
- package/dist/src/planner/mutation/lens-enforcement.d.ts.map +1 -1
- package/dist/src/planner/mutation/lens-enforcement.js +362 -5
- package/dist/src/planner/mutation/lens-enforcement.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/nodes/alter-table-node.d.ts +15 -11
- package/dist/src/planner/nodes/alter-table-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/alter-table-node.js +5 -0
- package/dist/src/planner/nodes/alter-table-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 +7 -0
- package/dist/src/planner/nodes/bloom-join-node.js.map +1 -1
- package/dist/src/planner/nodes/constraint-check-node.d.ts +16 -0
- package/dist/src/planner/nodes/constraint-check-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/constraint-check-node.js.map +1 -1
- package/dist/src/planner/nodes/plan-node-type.d.ts +1 -1
- package/dist/src/planner/nodes/plan-node-type.d.ts.map +1 -1
- package/dist/src/planner/nodes/plan-node-type.js +1 -1
- package/dist/src/planner/nodes/plan-node-type.js.map +1 -1
- package/dist/src/planner/nodes/pragma.d.ts.map +1 -1
- package/dist/src/planner/nodes/pragma.js +5 -2
- package/dist/src/planner/nodes/pragma.js.map +1 -1
- package/dist/src/planner/nodes/reference.d.ts.map +1 -1
- package/dist/src/planner/nodes/reference.js +9 -1
- package/dist/src/planner/nodes/reference.js.map +1 -1
- package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
- package/dist/src/planner/nodes/scalar.js +117 -91
- package/dist/src/planner/nodes/scalar.js.map +1 -1
- package/dist/src/planner/nodes/sequence-node.d.ts +50 -0
- package/dist/src/planner/nodes/sequence-node.d.ts.map +1 -0
- package/dist/src/planner/nodes/sequence-node.js +96 -0
- package/dist/src/planner/nodes/sequence-node.js.map +1 -0
- package/dist/src/planner/nodes/values-node.d.ts +8 -0
- package/dist/src/planner/nodes/values-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/values-node.js +29 -6
- package/dist/src/planner/nodes/values-node.js.map +1 -1
- package/dist/src/planner/nodes/view-mutation-node.d.ts +43 -1
- package/dist/src/planner/nodes/view-mutation-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/view-mutation-node.js +27 -6
- package/dist/src/planner/nodes/view-mutation-node.js.map +1 -1
- package/dist/src/planner/nodes/window-node.d.ts +33 -4
- package/dist/src/planner/nodes/window-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/window-node.js +80 -36
- package/dist/src/planner/nodes/window-node.js.map +1 -1
- package/dist/src/planner/planning-context.d.ts +38 -1
- package/dist/src/planner/planning-context.d.ts.map +1 -1
- 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 +8 -3
- package/dist/src/planner/rules/access/rule-key-set-seek.js.map +1 -1
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js +18 -12
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js.map +1 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +4 -3
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
- package/dist/src/planner/rules/window/rule-monotonic-window.d.ts.map +1 -1
- package/dist/src/planner/rules/window/rule-monotonic-window.js +6 -0
- package/dist/src/planner/rules/window/rule-monotonic-window.js.map +1 -1
- package/dist/src/planner/scopes/param.d.ts.map +1 -1
- package/dist/src/planner/scopes/param.js +10 -5
- package/dist/src/planner/scopes/param.js.map +1 -1
- package/dist/src/planner/util/ind-utils.d.ts +25 -8
- package/dist/src/planner/util/ind-utils.d.ts.map +1 -1
- package/dist/src/planner/util/ind-utils.js +53 -10
- package/dist/src/planner/util/ind-utils.js.map +1 -1
- package/dist/src/planner/util/key-utils.d.ts +7 -7
- package/dist/src/planner/util/key-utils.js +9 -9
- package/dist/src/planner/util/key-utils.js.map +1 -1
- package/dist/src/runtime/delta-executor.d.ts.map +1 -1
- package/dist/src/runtime/delta-executor.js +7 -2
- package/dist/src/runtime/delta-executor.js.map +1 -1
- package/dist/src/runtime/emit/add-constraint.d.ts.map +1 -1
- package/dist/src/runtime/emit/add-constraint.js +50 -15
- package/dist/src/runtime/emit/add-constraint.js.map +1 -1
- package/dist/src/runtime/emit/alter-schema-event.d.ts +2 -43
- package/dist/src/runtime/emit/alter-schema-event.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-schema-event.js +2 -53
- package/dist/src/runtime/emit/alter-schema-event.js.map +1 -1
- package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-table.js +59 -24
- 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 +7 -0
- package/dist/src/runtime/emit/analyze.js.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.js +2 -3
- package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
- package/dist/src/runtime/emit/binary.d.ts +5 -0
- package/dist/src/runtime/emit/binary.d.ts.map +1 -1
- package/dist/src/runtime/emit/binary.js +22 -22
- package/dist/src/runtime/emit/binary.js.map +1 -1
- package/dist/src/runtime/emit/block.d.ts.map +1 -1
- package/dist/src/runtime/emit/block.js +9 -3
- package/dist/src/runtime/emit/block.js.map +1 -1
- package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
- package/dist/src/runtime/emit/constraint-check.js +5 -6
- 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 +71 -70
- package/dist/src/runtime/emit/create-assertion.js.map +1 -1
- package/dist/src/runtime/emit/create-index.d.ts.map +1 -1
- package/dist/src/runtime/emit/create-index.js +8 -3
- package/dist/src/runtime/emit/create-index.js.map +1 -1
- package/dist/src/runtime/emit/create-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/create-table.js +20 -10
- package/dist/src/runtime/emit/create-table.js.map +1 -1
- package/dist/src/runtime/emit/create-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/create-view.js +51 -44
- package/dist/src/runtime/emit/create-view.js.map +1 -1
- package/dist/src/runtime/emit/ddl-event-scope.d.ts +71 -0
- package/dist/src/runtime/emit/ddl-event-scope.d.ts.map +1 -0
- package/dist/src/runtime/emit/ddl-event-scope.js +80 -0
- package/dist/src/runtime/emit/ddl-event-scope.js.map +1 -0
- package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
- package/dist/src/runtime/emit/dml-executor.js +23 -23
- package/dist/src/runtime/emit/dml-executor.js.map +1 -1
- package/dist/src/runtime/emit/drop-assertion.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-assertion.js +23 -17
- package/dist/src/runtime/emit/drop-assertion.js.map +1 -1
- package/dist/src/runtime/emit/drop-index.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-index.js +7 -2
- 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 +16 -10
- 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 +50 -43
- package/dist/src/runtime/emit/drop-view.js.map +1 -1
- package/dist/src/runtime/emit/insert.d.ts.map +1 -1
- package/dist/src/runtime/emit/insert.js +2 -1
- package/dist/src/runtime/emit/insert.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view.js +87 -67
- package/dist/src/runtime/emit/materialized-view.js.map +1 -1
- package/dist/src/runtime/emit/schema-declarative.d.ts +8 -0
- package/dist/src/runtime/emit/schema-declarative.d.ts.map +1 -1
- package/dist/src/runtime/emit/schema-declarative.js +128 -25
- package/dist/src/runtime/emit/schema-declarative.js.map +1 -1
- package/dist/src/runtime/emit/sequence.d.ts +17 -0
- package/dist/src/runtime/emit/sequence.d.ts.map +1 -0
- package/dist/src/runtime/emit/sequence.js +40 -0
- package/dist/src/runtime/emit/sequence.js.map +1 -0
- package/dist/src/runtime/emit/set-object-tags.d.ts.map +1 -1
- package/dist/src/runtime/emit/set-object-tags.js +40 -32
- package/dist/src/runtime/emit/set-object-tags.js.map +1 -1
- package/dist/src/runtime/emit/table-valued-function.d.ts.map +1 -1
- package/dist/src/runtime/emit/table-valued-function.js +3 -2
- package/dist/src/runtime/emit/table-valued-function.js.map +1 -1
- package/dist/src/runtime/emit/update.js +3 -3
- package/dist/src/runtime/emit/update.js.map +1 -1
- package/dist/src/runtime/emit/view-mutation.d.ts.map +1 -1
- package/dist/src/runtime/emit/view-mutation.js +45 -3
- package/dist/src/runtime/emit/view-mutation.js.map +1 -1
- package/dist/src/runtime/foreign-key-actions.d.ts.map +1 -1
- package/dist/src/runtime/foreign-key-actions.js +9 -10
- package/dist/src/runtime/foreign-key-actions.js.map +1 -1
- package/dist/src/runtime/register.d.ts.map +1 -1
- package/dist/src/runtime/register.js +3 -2
- package/dist/src/runtime/register.js.map +1 -1
- package/dist/src/runtime/row-constraints.d.ts +14 -8
- package/dist/src/runtime/row-constraints.d.ts.map +1 -1
- package/dist/src/runtime/row-constraints.js +41 -15
- package/dist/src/runtime/row-constraints.js.map +1 -1
- package/dist/src/runtime/strict-representation.d.ts +11 -6
- package/dist/src/runtime/strict-representation.d.ts.map +1 -1
- package/dist/src/runtime/strict-representation.js +1 -44
- package/dist/src/runtime/strict-representation.js.map +1 -1
- package/dist/src/schema/assertion.d.ts +25 -2
- package/dist/src/schema/assertion.d.ts.map +1 -1
- package/dist/src/schema/assertion.js.map +1 -1
- package/dist/src/schema/catalog-rendering.d.ts +38 -0
- package/dist/src/schema/catalog-rendering.d.ts.map +1 -0
- package/dist/src/schema/catalog-rendering.js +171 -0
- package/dist/src/schema/catalog-rendering.js.map +1 -0
- package/dist/src/schema/catalog.d.ts +69 -3
- package/dist/src/schema/catalog.d.ts.map +1 -1
- package/dist/src/schema/catalog.js +124 -19
- package/dist/src/schema/catalog.js.map +1 -1
- package/dist/src/schema/column-source-resolver.d.ts +9 -5
- package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
- package/dist/src/schema/column-source-resolver.js +9 -5
- package/dist/src/schema/column-source-resolver.js.map +1 -1
- package/dist/src/schema/constraint-builder.d.ts +13 -10
- package/dist/src/schema/constraint-builder.d.ts.map +1 -1
- package/dist/src/schema/constraint-builder.js +45 -17
- package/dist/src/schema/constraint-builder.js.map +1 -1
- package/dist/src/schema/declared-schema-manager.d.ts +50 -0
- package/dist/src/schema/declared-schema-manager.d.ts.map +1 -1
- package/dist/src/schema/declared-schema-manager.js +52 -0
- package/dist/src/schema/declared-schema-manager.js.map +1 -1
- package/dist/src/schema/expr-scope/frame.d.ts +65 -0
- package/dist/src/schema/expr-scope/frame.d.ts.map +1 -0
- package/dist/src/schema/expr-scope/frame.js +104 -0
- package/dist/src/schema/expr-scope/frame.js.map +1 -0
- package/dist/src/schema/expr-scope/walk.d.ts +40 -0
- package/dist/src/schema/expr-scope/walk.d.ts.map +1 -0
- package/dist/src/schema/expr-scope/walk.js +260 -0
- package/dist/src/schema/expr-scope/walk.js.map +1 -0
- package/dist/src/schema/generated-column-refs.d.ts +41 -0
- package/dist/src/schema/generated-column-refs.d.ts.map +1 -0
- package/dist/src/schema/generated-column-refs.js +124 -0
- package/dist/src/schema/generated-column-refs.js.map +1 -0
- package/dist/src/schema/lens-ack.d.ts.map +1 -1
- package/dist/src/schema/lens-ack.js +5 -2
- package/dist/src/schema/lens-ack.js.map +1 -1
- package/dist/src/schema/lens-compiler.d.ts.map +1 -1
- package/dist/src/schema/lens-compiler.js +9 -1
- package/dist/src/schema/lens-compiler.js.map +1 -1
- package/dist/src/schema/lens-prover.d.ts +7 -2
- package/dist/src/schema/lens-prover.d.ts.map +1 -1
- package/dist/src/schema/lens-prover.js +105 -11
- package/dist/src/schema/lens-prover.js.map +1 -1
- package/dist/src/schema/lens.d.ts +12 -0
- package/dist/src/schema/lens.d.ts.map +1 -1
- package/dist/src/schema/lens.js +10 -0
- package/dist/src/schema/lens.js.map +1 -1
- package/dist/src/schema/manager.d.ts +35 -1
- package/dist/src/schema/manager.d.ts.map +1 -1
- package/dist/src/schema/manager.js +125 -26
- package/dist/src/schema/manager.js.map +1 -1
- package/dist/src/schema/rename/self-qualifier-strip.d.ts +16 -10
- package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -1
- package/dist/src/schema/rename/self-qualifier-strip.js +30 -213
- package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -1
- package/dist/src/schema/rename-rewriter.d.ts +4 -3
- package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
- package/dist/src/schema/rename-rewriter.js +4 -3
- package/dist/src/schema/rename-rewriter.js.map +1 -1
- package/dist/src/schema/schema-differ.d.ts +54 -6
- package/dist/src/schema/schema-differ.d.ts.map +1 -1
- package/dist/src/schema/schema-differ.js +108 -42
- package/dist/src/schema/schema-differ.js.map +1 -1
- package/dist/src/schema/schema-hasher.d.ts +12 -0
- package/dist/src/schema/schema-hasher.d.ts.map +1 -1
- package/dist/src/schema/schema-hasher.js +28 -10
- package/dist/src/schema/schema-hasher.js.map +1 -1
- package/dist/src/schema/table.d.ts +74 -19
- package/dist/src/schema/table.d.ts.map +1 -1
- package/dist/src/schema/table.js +133 -71
- package/dist/src/schema/table.js.map +1 -1
- package/dist/src/types/comparison-coercion.d.ts +5 -1
- package/dist/src/types/comparison-coercion.d.ts.map +1 -1
- package/dist/src/types/comparison-coercion.js +21 -5
- package/dist/src/types/comparison-coercion.js.map +1 -1
- package/dist/src/types/representation.d.ts +65 -0
- package/dist/src/types/representation.d.ts.map +1 -0
- package/dist/src/types/representation.js +63 -0
- package/dist/src/types/representation.js.map +1 -0
- package/dist/src/types/validation.d.ts +76 -22
- package/dist/src/types/validation.d.ts.map +1 -1
- package/dist/src/types/validation.js +110 -31
- package/dist/src/types/validation.js.map +1 -1
- package/dist/src/vtab/best-access-plan.d.ts +10 -0
- package/dist/src/vtab/best-access-plan.d.ts.map +1 -1
- package/dist/src/vtab/best-access-plan.js +16 -0
- package/dist/src/vtab/best-access-plan.js.map +1 -1
- package/dist/src/vtab/capabilities.d.ts +72 -4
- package/dist/src/vtab/capabilities.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.js +17 -13
- package/dist/src/vtab/memory/layer/manager.js.map +1 -1
- package/dist/src/vtab/module.d.ts +13 -7
- package/dist/src/vtab/module.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/src/planner/nodes/array-index-node.d.ts +0 -22
- package/dist/src/planner/nodes/array-index-node.d.ts.map +0 -1
- package/dist/src/planner/nodes/array-index-node.js +0 -41
- package/dist/src/planner/nodes/array-index-node.js.map +0 -1
- package/dist/src/runtime/emit/array-index.d.ts +0 -5
- package/dist/src/runtime/emit/array-index.d.ts.map +0 -1
- package/dist/src/runtime/emit/array-index.js +0 -22
- package/dist/src/runtime/emit/array-index.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeSetOpAdvertisedType } from '../analysis/set-op-type-merge.js';
|
|
1
2
|
import { PlanNode } from './plan-node.js';
|
|
2
3
|
import { PlanNodeType } from './plan-node-type.js';
|
|
3
4
|
import { Cached } from '../../util/cached.js';
|
|
@@ -42,11 +43,9 @@ export class ValuesNode extends PlanNode {
|
|
|
42
43
|
rowConstraints: [],
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
const firstRow = this.rows[0];
|
|
47
|
-
const columns = firstRow.map((expr, index) => ({
|
|
46
|
+
const columns = this.rows[0].map((_, index) => ({
|
|
48
47
|
name: this.columnNames?.[index] ?? `column_${index}`,
|
|
49
|
-
type:
|
|
48
|
+
type: this.mergedColumnType(index),
|
|
50
49
|
generated: false,
|
|
51
50
|
}));
|
|
52
51
|
return {
|
|
@@ -58,16 +57,40 @@ export class ValuesNode extends PlanNode {
|
|
|
58
57
|
rowConstraints: [],
|
|
59
58
|
};
|
|
60
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The type one VALUES column may honestly advertise: every row's expression
|
|
62
|
+
* contributes a value UNCONVERTED, so the column is the same shape as a set
|
|
63
|
+
* operation's output column and folds by the same rules
|
|
64
|
+
* (`mergeSetOpAdvertisedType`). Typing from the first row alone announced
|
|
65
|
+
* INTEGER for `VALUES (1), (1.5)` while the second row yields a fraction.
|
|
66
|
+
*/
|
|
67
|
+
mergedColumnType(index) {
|
|
68
|
+
const first = this.rows[0][index].getType();
|
|
69
|
+
let logicalType = first.logicalType;
|
|
70
|
+
let nullable = first.nullable;
|
|
71
|
+
for (let r = 1; r < this.rows.length; r++) {
|
|
72
|
+
// A ragged row is a user error, but `emitValues` is what reports it (with a
|
|
73
|
+
// location); typing must not crash on the way there.
|
|
74
|
+
const rowType = this.rows[r][index]?.getType();
|
|
75
|
+
if (!rowType)
|
|
76
|
+
continue;
|
|
77
|
+
logicalType = mergeSetOpAdvertisedType(logicalType, rowType.logicalType);
|
|
78
|
+
nullable ||= rowType.nullable;
|
|
79
|
+
}
|
|
80
|
+
if (logicalType === first.logicalType && nullable === first.nullable)
|
|
81
|
+
return first;
|
|
82
|
+
return { ...first, logicalType, nullable };
|
|
83
|
+
}
|
|
61
84
|
buildAttributes() {
|
|
62
85
|
if (this.rows.length === 0) {
|
|
63
86
|
return [];
|
|
64
87
|
}
|
|
65
88
|
// Create attributes for each column
|
|
66
89
|
const firstRow = this.rows[0];
|
|
67
|
-
return firstRow.map((
|
|
90
|
+
return firstRow.map((_expr, index) => ({
|
|
68
91
|
id: PlanNode.nextAttrId(),
|
|
69
92
|
name: this.columnNames?.[index] ?? `column_${index}`,
|
|
70
|
-
type:
|
|
93
|
+
type: this.mergedColumnType(index),
|
|
71
94
|
sourceRelation: `${this.nodeType}:${this.id}`
|
|
72
95
|
}));
|
|
73
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values-node.js","sourceRoot":"","sources":["../../../../src/planner/nodes/values-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAA4F,MAAM,gBAAgB,CAAC;AACpI,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,QAAQ;IASpB;IAEA;IAVA,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC;IAEzC,eAAe,CAAuB;IACtC,eAAe,CAAsB;IAE7C,YACE,KAAY;IACZ,0EAA0E;IAC1D,IAAkD;IAClE,gFAAgF;IAChE,WAAmC,EACnD,qBAA8B;IAC9B,4EAA4E;IAC5E,oBAAkC;QAElC,KAAK,CAAC,KAAK,EAAE,qBAAqB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,qBAAqB;QAPhE,SAAI,GAAJ,IAAI,CAA8C;QAElD,gBAAW,GAAX,WAAW,CAAwB;QAOnD,IAAI,CAAC,eAAe,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,eAAe,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE;YACrC,qEAAqE;YACrE,IAAI,oBAAoB,EAAE,CAAC;gBACzB,OAAO,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC,gBAAgB;YACvD,CAAC;YAED,O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M,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC5B,CAAC;IAEQ,QAAQ;QAChB,OAAO,kBAAkB,IAAI,CAAC,QAAQ,QAAQ,CAAC;IAChD,CAAC;IAEQ,oBAAoB;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/B,OAAO;YACN,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM;YAClC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACnE,CAAC;IACH,CAAC;CACD"}
|
|
@@ -2,6 +2,7 @@ import type { Scope } from '../scopes/scope.js';
|
|
|
2
2
|
import { PlanNode, type RelationalPlanNode, type ScalarPlanNode, type PhysicalProperties, type TableDescriptor, type RowDescriptor, type Attribute } from './plan-node.js';
|
|
3
3
|
import { PlanNodeType } from './plan-node-type.js';
|
|
4
4
|
import type { RelationType, ScalarType } from '../../common/datatype.js';
|
|
5
|
+
import type { ConflictResolution } from '../../common/constants.js';
|
|
5
6
|
/** When a separate {@link ViewMutationNode.returning} relation is captured. */
|
|
6
7
|
export type ReturningTiming = 'pre' | 'post';
|
|
7
8
|
/**
|
|
@@ -74,6 +75,47 @@ export interface MutationEnvelope {
|
|
|
74
75
|
* self-contained and the optimizer cannot dangle it.
|
|
75
76
|
*/
|
|
76
77
|
readonly keyDefaultRowDescriptor?: RowDescriptor;
|
|
78
|
+
/**
|
|
79
|
+
* Per-row logical CHECKs evaluated once per produced logical row, at the
|
|
80
|
+
* envelope — BEFORE the shared key is minted and before any member op runs.
|
|
81
|
+
* This is the row-local lens constraint seam for a decomposition INSERT
|
|
82
|
+
* (docs/lens.md § Constraint Attachment): the envelope row IS the produced
|
|
83
|
+
* logical row, so a check here fires regardless of which member ops the
|
|
84
|
+
* fan-out plans (an omitted / explicit-NULL column suppresses the member
|
|
85
|
+
* write, never the check). Subquery-free checks only — a subquery-bearing
|
|
86
|
+
* row-local check rides the anchor op as a deferred logical-view constraint
|
|
87
|
+
* instead (`buildDecompositionInsert`).
|
|
88
|
+
*/
|
|
89
|
+
readonly rowChecks?: ReadonlyArray<EnvelopeRowCheck>;
|
|
90
|
+
/**
|
|
91
|
+
* The row descriptor over the supplied envelope columns the {@link rowChecks}
|
|
92
|
+
* expressions' column refs resolve through — installed as a row slot over each
|
|
93
|
+
* source row for the duration of the per-row evaluation (the check-side dual of
|
|
94
|
+
* {@link keyDefaultRowDescriptor}, with its own fresh attribute ids). Present
|
|
95
|
+
* exactly when `rowChecks` is.
|
|
96
|
+
*/
|
|
97
|
+
readonly rowCheckRowDescriptor?: RowDescriptor;
|
|
98
|
+
/**
|
|
99
|
+
* The statement-level OR clause governing a failing {@link rowChecks} row:
|
|
100
|
+
* IGNORE skips the envelope row (the whole logical row — no member op sees it),
|
|
101
|
+
* FAIL / ROLLBACK throw their conflict subclass, ABORT / REPLACE throw a plain
|
|
102
|
+
* constraint error (REPLACE never masks a CHECK — SQLite parity, matching
|
|
103
|
+
* `runtime/row-constraints.ts`).
|
|
104
|
+
*/
|
|
105
|
+
readonly rowCheckOnConflict?: ConflictResolution;
|
|
106
|
+
}
|
|
107
|
+
/** One per-row logical CHECK evaluated at the mutation envelope. */
|
|
108
|
+
export interface EnvelopeRowCheck {
|
|
109
|
+
/** The routed-constraint name (`lens:<name>` / `lens:check`). */
|
|
110
|
+
readonly name: string;
|
|
111
|
+
/** Compiled predicate over the supplied envelope columns (NULL passes; only definite FALSE fails). */
|
|
112
|
+
readonly expression: ScalarPlanNode;
|
|
113
|
+
/**
|
|
114
|
+
* Pre-formatted violation text (`CHECK constraint failed: <name>[ (<expr>)]`),
|
|
115
|
+
* derived at plan time with the same shape `runtime/row-constraints.ts` derives,
|
|
116
|
+
* so the envelope seam reports identically to the constraint pipeline.
|
|
117
|
+
*/
|
|
118
|
+
readonly message: string;
|
|
77
119
|
}
|
|
78
120
|
/**
|
|
79
121
|
* The substrate node for view-/materialized-view-mediated DML.
|
|
@@ -246,7 +288,7 @@ export declare class ViewMutationNode extends PlanNode {
|
|
|
246
288
|
getType(): RelationType | ScalarType;
|
|
247
289
|
/** The view-projected RETURNING attributes, or `[]` for a void mutation. */
|
|
248
290
|
getAttributes(): readonly Attribute[];
|
|
249
|
-
/** Extra (non-base-op) plan children: the envelope source + optional key-default expr. */
|
|
291
|
+
/** Extra (non-base-op) plan children: the envelope source + optional key-default expr + per-row check exprs. */
|
|
250
292
|
private envelopeChildren;
|
|
251
293
|
getChildren(): readonly PlanNode[];
|
|
252
294
|
getRelations(): readonly RelationalPlanNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-mutation-node.d.ts","sourceRoot":"","sources":["../../../../src/planner/nodes/view-mutation-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAC7L,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"view-mutation-node.d.ts","sourceRoot":"","sources":["../../../../src/planner/nodes/view-mutation-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,KAAK,c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CAEtC;IAED,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAQrC,QAAQ,IAAI,MAAM;IAYlB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CASxD"}
|
|
@@ -154,13 +154,16 @@ export class ViewMutationNode extends PlanNode {
|
|
|
154
154
|
getAttributes() {
|
|
155
155
|
return this.resultRelation()?.getAttributes() ?? [];
|
|
156
156
|
}
|
|
157
|
-
/** Extra (non-base-op) plan children: the envelope source + optional key-default expr. */
|
|
157
|
+
/** Extra (non-base-op) plan children: the envelope source + optional key-default expr + per-row check exprs. */
|
|
158
158
|
envelopeChildren() {
|
|
159
159
|
if (!this.envelope)
|
|
160
160
|
return [];
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
const children = [this.envelope.source];
|
|
162
|
+
if (this.envelope.keyDefault)
|
|
163
|
+
children.push(this.envelope.keyDefault);
|
|
164
|
+
for (const check of this.envelope.rowChecks ?? [])
|
|
165
|
+
children.push(check.expression);
|
|
166
|
+
return children;
|
|
164
167
|
}
|
|
165
168
|
getChildren() {
|
|
166
169
|
// Order: base ops, then the optional RETURNING re-query, then the optional
|
|
@@ -223,12 +226,29 @@ export class ViewMutationNode extends PlanNode {
|
|
|
223
226
|
if (this.envelope) {
|
|
224
227
|
const newSource = newChildren[cursor];
|
|
225
228
|
cursor += 1;
|
|
226
|
-
|
|
229
|
+
let newKeyDefault;
|
|
230
|
+
if (this.envelope.keyDefault) {
|
|
231
|
+
newKeyDefault = newChildren[cursor];
|
|
232
|
+
cursor += 1;
|
|
233
|
+
}
|
|
234
|
+
// Rebuild each per-row check with its new expression, preserving name/message
|
|
235
|
+
// (sliced back in the same order envelopeChildren laid them out).
|
|
236
|
+
let newRowChecks = this.envelope.rowChecks;
|
|
237
|
+
if (this.envelope.rowChecks && this.envelope.rowChecks.length > 0) {
|
|
238
|
+
newRowChecks = this.envelope.rowChecks.map(check => {
|
|
239
|
+
const expression = newChildren[cursor];
|
|
240
|
+
cursor += 1;
|
|
241
|
+
return { ...check, expression };
|
|
242
|
+
});
|
|
243
|
+
}
|
|
227
244
|
newEnvelope = {
|
|
228
245
|
source: newSource,
|
|
229
246
|
descriptor: this.envelope.descriptor,
|
|
230
247
|
keyDefault: newKeyDefault,
|
|
231
248
|
keyDefaultRowDescriptor: this.envelope.keyDefaultRowDescriptor,
|
|
249
|
+
rowChecks: newRowChecks,
|
|
250
|
+
rowCheckRowDescriptor: this.envelope.rowCheckRowDescriptor,
|
|
251
|
+
rowCheckOnConflict: this.envelope.rowCheckOnConflict,
|
|
232
252
|
};
|
|
233
253
|
}
|
|
234
254
|
const unchanged = newChildren.length === this.getChildren().length
|
|
@@ -237,7 +257,8 @@ export class ViewMutationNode extends PlanNode {
|
|
|
237
257
|
&& (!this.identityCapture || newCapture.source === this.identityCapture.source)
|
|
238
258
|
&& (!this.nestedCaptures || this.nestedCaptures.every((c, i) => newNestedCaptures[i].source === c.source))
|
|
239
259
|
&& (!this.envelope || (newEnvelope.source === this.envelope.source
|
|
240
|
-
&& newEnvelope.keyDefault === this.envelope.keyDefault
|
|
260
|
+
&& newEnvelope.keyDefault === this.envelope.keyDefault
|
|
261
|
+
&& (!this.envelope.rowChecks || this.envelope.rowChecks.every((c, i) => newEnvelope.rowChecks[i].expression === c.expression))));
|
|
241
262
|
if (unchanged) {
|
|
242
263
|
return this;
|
|
243
264
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-mutation-node.js","sourceRoot":"","sources":["../../../../src/planner/nodes/view-mutation-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7L,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"view-mutation-node.js","sourceRoot":"","sources":["../../../../src/planner/nodes/view-mutation-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmI,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,CAAC,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1G,OAAO,kBAAkB,IAAI,CAAC,OAAO,CAAC,MAAM,WAAW,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAClH,CAAC;IAEQ,oBAAoB;QAC5B,OAAO;YACN,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;YACvF,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YAC9D,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9G,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;SAChH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -72,25 +72,54 @@ export declare class WindowNode extends PlanNode implements UnaryRelationalNode
|
|
|
72
72
|
readonly partitionExpressions: ScalarPlanNode[];
|
|
73
73
|
readonly orderByExpressions: ScalarPlanNode[];
|
|
74
74
|
readonly functionArguments: ScalarPlanNode[][];
|
|
75
|
-
/**
|
|
76
|
-
|
|
75
|
+
/**
|
|
76
|
+
* The WINDOW-GENERATED output attributes (one per function), supplied by
|
|
77
|
+
* `withChildren`/`withStreaming` so a window result column keeps ONE attribute
|
|
78
|
+
* id for the whole life of the plan. Only these are carried — the pass-through
|
|
79
|
+
* source attributes are always taken from the CURRENT source, so an optimizer
|
|
80
|
+
* rewrite of the source (AggregateNode → HashAggregate, an inserted Retrieve)
|
|
81
|
+
* cannot orphan the ids the projection above references.
|
|
82
|
+
*/
|
|
83
|
+
readonly predefinedWindowAttributes?: Attribute[] | undefined;
|
|
77
84
|
/** Set by `rule-monotonic-window` when the source streams in window order. */
|
|
78
85
|
readonly streaming?: StreamingWindowConfig | undefined;
|
|
79
86
|
readonly nodeType = PlanNodeType.Window;
|
|
80
87
|
private outputTypeCache;
|
|
81
88
|
private attributesCache;
|
|
82
89
|
constructor(scope: Scope, source: RelationalPlanNode, windowSpec: WindowSpec, functions: WindowFunctionCallNode[], partitionExpressions: ScalarPlanNode[], orderByExpressions: ScalarPlanNode[], functionArguments: ScalarPlanNode[][], estimatedCostOverride?: number,
|
|
83
|
-
/**
|
|
84
|
-
|
|
90
|
+
/**
|
|
91
|
+
* The WINDOW-GENERATED output attributes (one per function), supplied by
|
|
92
|
+
* `withChildren`/`withStreaming` so a window result column keeps ONE attribute
|
|
93
|
+
* id for the whole life of the plan. Only these are carried — the pass-through
|
|
94
|
+
* source attributes are always taken from the CURRENT source, so an optimizer
|
|
95
|
+
* rewrite of the source (AggregateNode → HashAggregate, an inserted Retrieve)
|
|
96
|
+
* cannot orphan the ids the projection above references.
|
|
97
|
+
*/
|
|
98
|
+
predefinedWindowAttributes?: Attribute[] | undefined,
|
|
85
99
|
/** Set by `rule-monotonic-window` when the source streams in window order. */
|
|
86
100
|
streaming?: StreamingWindowConfig | undefined);
|
|
87
101
|
getType(): RelationType;
|
|
88
102
|
getAttributes(): Attribute[];
|
|
103
|
+
/**
|
|
104
|
+
* The window-generated output attributes (one per function, parallel to
|
|
105
|
+
* `functions`), excluding the pass-through source attributes. This is the list
|
|
106
|
+
* `withChildren`/`withStreaming` carry across rebuilds, and the list the window
|
|
107
|
+
* phase records so the projection above addresses each window result by
|
|
108
|
+
* attribute id.
|
|
109
|
+
*/
|
|
110
|
+
getWindowAttributes(): Attribute[];
|
|
89
111
|
getChildren(): readonly PlanNode[];
|
|
90
112
|
withChildren(newChildren: readonly PlanNode[]): PlanNode;
|
|
91
113
|
/** Return a new WindowNode with the given streaming config attached. */
|
|
92
114
|
withStreaming(config: StreamingWindowConfig): WindowNode;
|
|
93
115
|
getRelations(): readonly [RelationalPlanNode];
|
|
116
|
+
/**
|
|
117
|
+
* The window's ORDER BY expressed as sort keys, in the shape
|
|
118
|
+
* `extractOrderingFromSortKeys` expects. `AST.OrderByClause.direction` is
|
|
119
|
+
* optional; anything that is not `'desc'` is ascending — the same reading
|
|
120
|
+
* `rule-monotonic-window` and the `monotonicOn` derivation use.
|
|
121
|
+
*/
|
|
122
|
+
private windowSortKeys;
|
|
94
123
|
computePhysical(childrenPhysical: PhysicalProperties[]): Partial<PhysicalProperties>;
|
|
95
124
|
get estimatedRows(): number | undefined;
|
|
96
125
|
toString(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-node.d.ts","sourceRoot":"","sources":["../../../../src/planner/nodes/window-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAwB,MAAM,gBAAgB,CAAC;AACjL,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,o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IvB,aAAa,IAAI,SAAS,EAAE;IAI5B;;;;;;OAMG;IACH,mBAAmB,IAAI,SAAS,EAAE;IAIlC,WAAW,IAAI,SAAS,QAAQ,EAAE;IAelC,YAAY,CAAC,WAAW,EAAE,SAAS,QAAQ,EAAE,GAAG,QAAQ;IA2DxD,wEAAwE;IACxE,aAAa,CAAC,MAAM,EAAE,qBAAqB,GAAG,UAAU;IAexD,YAAY,IAAI,SAAS,CAAC,kBAAkB,CAAC;IAI7C;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAOtB,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkEpF,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAEQ,QAAQ,IAAI,MAAM;IAalB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAoBxD"}
|
|
@@ -6,6 +6,7 @@ import { StatusCode } from '../../common/types.js';
|
|
|
6
6
|
import { ColumnReferenceNode } from './reference.js';
|
|
7
7
|
import { isUniqueDeterminant } from '../util/fd-utils.js';
|
|
8
8
|
import { physicalSourceRows } from '../util/row-estimates.js';
|
|
9
|
+
import { extractOrderingFromSortKeys } from '../framework/physical-utils.js';
|
|
9
10
|
/**
|
|
10
11
|
* Represents a window operation that computes window functions over partitions of rows.
|
|
11
12
|
* This node groups window functions that share the same window specification for efficiency.
|
|
@@ -17,14 +18,21 @@ export class WindowNode extends PlanNode {
|
|
|
17
18
|
partitionExpressions;
|
|
18
19
|
orderByExpressions;
|
|
19
20
|
functionArguments;
|
|
20
|
-
|
|
21
|
+
predefinedWindowAttributes;
|
|
21
22
|
streaming;
|
|
22
23
|
nodeType = PlanNodeType.Window;
|
|
23
24
|
outputTypeCache;
|
|
24
25
|
attributesCache;
|
|
25
26
|
constructor(scope, source, windowSpec, functions, partitionExpressions, orderByExpressions, functionArguments, estimatedCostOverride,
|
|
26
|
-
/**
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The WINDOW-GENERATED output attributes (one per function), supplied by
|
|
29
|
+
* `withChildren`/`withStreaming` so a window result column keeps ONE attribute
|
|
30
|
+
* id for the whole life of the plan. Only these are carried — the pass-through
|
|
31
|
+
* source attributes are always taken from the CURRENT source, so an optimizer
|
|
32
|
+
* rewrite of the source (AggregateNode → HashAggregate, an inserted Retrieve)
|
|
33
|
+
* cannot orphan the ids the projection above references.
|
|
34
|
+
*/
|
|
35
|
+
predefinedWindowAttributes,
|
|
28
36
|
/** Set by `rule-monotonic-window` when the source streams in window order. */
|
|
29
37
|
streaming) {
|
|
30
38
|
super(scope, estimatedCostOverride);
|
|
@@ -34,8 +42,14 @@ export class WindowNode extends PlanNode {
|
|
|
34
42
|
this.partitionExpressions = partitionExpressions;
|
|
35
43
|
this.orderByExpressions = orderByExpressions;
|
|
36
44
|
this.functionArguments = functionArguments;
|
|
37
|
-
this.
|
|
45
|
+
this.predefinedWindowAttributes = predefinedWindowAttributes;
|
|
38
46
|
this.streaming = streaming;
|
|
47
|
+
// The preserved list is positional against `functions`: a wrong length silently
|
|
48
|
+
// yields a mis-shaped attribute row (window results addressed to the wrong id),
|
|
49
|
+
// so reject it at construction rather than at some later read.
|
|
50
|
+
if (predefinedWindowAttributes && predefinedWindowAttributes.length !== functions.length) {
|
|
51
|
+
quereusError(`WindowNode expects ${functions.length} preserved window attributes, got ${predefinedWindowAttributes.length}`, StatusCode.INTERNAL);
|
|
52
|
+
}
|
|
39
53
|
this.outputTypeCache = new Cached(() => {
|
|
40
54
|
const sourceType = this.source.getType();
|
|
41
55
|
// Add window function columns to the source columns
|
|
@@ -54,18 +68,16 @@ export class WindowNode extends PlanNode {
|
|
|
54
68
|
};
|
|
55
69
|
});
|
|
56
70
|
this.attributesCache = new Cached(() => {
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
return this.predefinedAttributes.slice(); // Return a copy
|
|
60
|
-
}
|
|
61
|
-
// Preserve source attributes and add window function attributes
|
|
71
|
+
// Pass-through attributes always come from the CURRENT source; only the
|
|
72
|
+
// window-generated tail is preserved (or minted once, at build time).
|
|
62
73
|
const sourceAttrs = this.source.getAttributes();
|
|
63
|
-
const windowAttrs = this.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
const windowAttrs = this.predefinedWindowAttributes
|
|
75
|
+
?? this.functions.map((func) => ({
|
|
76
|
+
id: PlanNode.nextAttrId(),
|
|
77
|
+
name: func.alias || func.functionName.toLowerCase(),
|
|
78
|
+
type: func.getType(),
|
|
79
|
+
sourceRelation: `${this.nodeType}:${this.id}`
|
|
80
|
+
}));
|
|
69
81
|
return [...sourceAttrs, ...windowAttrs];
|
|
70
82
|
});
|
|
71
83
|
}
|
|
@@ -75,6 +87,16 @@ export class WindowNode extends PlanNode {
|
|
|
75
87
|
getAttributes() {
|
|
76
88
|
return this.attributesCache.value;
|
|
77
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The window-generated output attributes (one per function, parallel to
|
|
92
|
+
* `functions`), excluding the pass-through source attributes. This is the list
|
|
93
|
+
* `withChildren`/`withStreaming` carry across rebuilds, and the list the window
|
|
94
|
+
* phase records so the projection above addresses each window result by
|
|
95
|
+
* attribute id.
|
|
96
|
+
*/
|
|
97
|
+
getWindowAttributes() {
|
|
98
|
+
return this.getAttributes().slice(this.source.getAttributes().length);
|
|
99
|
+
}
|
|
78
100
|
getChildren() {
|
|
79
101
|
return [
|
|
80
102
|
// Include *both* the relational source and all scalar expression children so
|
|
@@ -119,50 +141,70 @@ export class WindowNode extends PlanNode {
|
|
|
119
141
|
if (!sourceChanged && !partitionChanged && !orderByChanged && !functionArgsChanged) {
|
|
120
142
|
return this;
|
|
121
143
|
}
|
|
122
|
-
// **CRITICAL**: Preserve original attribute IDs to maintain column reference stability
|
|
123
|
-
const originalAttributes = this.getAttributes();
|
|
124
144
|
return new WindowNode(this.scope, newSource, this.windowSpec, this.functions, newPartitionExpressions, newOrderByExpressions, newFunctionArguments, undefined,
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
|
|
145
|
+
// **CRITICAL**: always carry the window-generated attribute ids — the
|
|
146
|
+
// projection above references them, so they must survive even (especially)
|
|
147
|
+
// when the optimizer replaces the source. Pass-through attributes are
|
|
148
|
+
// recomputed from the new source.
|
|
149
|
+
this.getWindowAttributes(), this.streaming);
|
|
129
150
|
}
|
|
130
151
|
/** Return a new WindowNode with the given streaming config attached. */
|
|
131
152
|
withStreaming(config) {
|
|
132
|
-
return new WindowNode(this.scope, this.source, this.windowSpec, this.functions, this.partitionExpressions, this.orderByExpressions, this.functionArguments, undefined, this.
|
|
153
|
+
return new WindowNode(this.scope, this.source, this.windowSpec, this.functions, this.partitionExpressions, this.orderByExpressions, this.functionArguments, undefined, this.getWindowAttributes(), config);
|
|
133
154
|
}
|
|
134
155
|
getRelations() {
|
|
135
156
|
return [this.source];
|
|
136
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* The window's ORDER BY expressed as sort keys, in the shape
|
|
160
|
+
* `extractOrderingFromSortKeys` expects. `AST.OrderByClause.direction` is
|
|
161
|
+
* optional; anything that is not `'desc'` is ascending — the same reading
|
|
162
|
+
* `rule-monotonic-window` and the `monotonicOn` derivation use.
|
|
163
|
+
*/
|
|
164
|
+
windowSortKeys() {
|
|
165
|
+
return this.orderByExpressions.map((expression, i) => ({
|
|
166
|
+
expression,
|
|
167
|
+
direction: this.windowSpec.orderBy[i]?.direction === 'desc' ? 'desc' : 'asc',
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
137
170
|
computePhysical(childrenPhysical) {
|
|
138
171
|
const sourcePhysical = childrenPhysical[0];
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
172
|
+
// `ordering` (the exact emit order) and `monotonicOn` (the stronger
|
|
173
|
+
// per-attribute claim) come out of ONE split over [streaming, PARTITION BY,
|
|
174
|
+
// ORDER BY], so they cannot drift apart from each other or from what
|
|
175
|
+
// `runtime/emit/window.ts` yields. The four cases and the emitter function
|
|
176
|
+
// behind each are tabulated in docs/window-functions.md § "What the
|
|
177
|
+
// WindowNode advertises as its emit order".
|
|
178
|
+
// Column indices from `extractOrderingFromSortKeys` are positions in the
|
|
179
|
+
// SOURCE row; the window only APPENDS columns, so they need no shifting.
|
|
180
|
+
// NOTE: like SortNode, the derived `ordering` carries no NULLS FIRST/LAST
|
|
181
|
+
// information — it is `{ column, desc }` only. Harmless while every ordering
|
|
182
|
+
// consumer is null-placement-blind (merge join skips NULL keys wherever they
|
|
183
|
+
// land); if one is ever taught to honour an explicit `nulls`, this derivation
|
|
184
|
+
// and SortNode's must both withhold the ordering when `windowSpec.orderBy[i]
|
|
185
|
+
// .nulls` contradicts that consumer's convention.
|
|
151
186
|
// TODO: the partitioned case can be tightened (e.g. when the partition keys
|
|
152
187
|
// themselves are functionally determined by the candidate attribute) — out
|
|
153
188
|
// of scope for the carrier ticket.
|
|
189
|
+
let ordering;
|
|
154
190
|
let monotonicOn;
|
|
155
191
|
if (this.streaming) {
|
|
192
|
+
// Row pass-through: emitted in source order.
|
|
193
|
+
ordering = sourcePhysical?.ordering;
|
|
156
194
|
monotonicOn = sourcePhysical?.monotonicOn;
|
|
157
195
|
}
|
|
158
196
|
else if (this.partitionExpressions.length === 0) {
|
|
159
197
|
if (this.orderByExpressions.length === 0) {
|
|
198
|
+
// Buffered, but nothing to sort by — still source order.
|
|
199
|
+
ordering = sourcePhysical?.ordering;
|
|
160
200
|
monotonicOn = sourcePhysical?.monotonicOn;
|
|
161
201
|
}
|
|
162
202
|
else {
|
|
203
|
+
// Sorted by the window's ORDER BY; the source's order is gone.
|
|
204
|
+
const sourceAttrs = this.source.getAttributes();
|
|
205
|
+
ordering = extractOrderingFromSortKeys(this.windowSortKeys(), sourceAttrs);
|
|
163
206
|
const leadExpr = this.orderByExpressions[0];
|
|
164
207
|
if (leadExpr instanceof ColumnReferenceNode) {
|
|
165
|
-
const sourceAttrs = this.source.getAttributes();
|
|
166
208
|
const leadAttrId = leadExpr.attributeId;
|
|
167
209
|
const leadIdx = this.source.getAttributeIndex().get(leadAttrId) ?? -1;
|
|
168
210
|
if (leadIdx >= 0) {
|
|
@@ -173,10 +215,12 @@ export class WindowNode extends PlanNode {
|
|
|
173
215
|
}
|
|
174
216
|
}
|
|
175
217
|
}
|
|
218
|
+
// Buffered with a PARTITION BY falls through: whole partitions emit in
|
|
219
|
+
// first-seen order, so neither claim survives and both stay undefined.
|
|
176
220
|
return {
|
|
177
221
|
// Window functions don't change the row count — relay the PHYSICAL one.
|
|
178
222
|
estimatedRows: physicalSourceRows(sourcePhysical, this.source),
|
|
179
|
-
ordering
|
|
223
|
+
ordering,
|
|
180
224
|
monotonicOn,
|
|
181
225
|
// Window functions append columns but don't change the source row stream;
|
|
182
226
|
// FDs, equivalence classes, and constant bindings pass through on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-node.js","sourceRoot":"","sources":["../../../../src/planner/nodes/window-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAyI,MAAM,gBAAgB,CAAC;AAIjL,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"window-node.js","sourceR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