@quereus/quereus 0.7.3 → 0.7.4
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/package.json +3 -3
- package/dist/src/common/constants.js.map +0 -1
- package/dist/src/common/datatype.js.map +0 -1
- package/dist/src/common/errors.js.map +0 -1
- package/dist/src/common/json-types.js.map +0 -1
- package/dist/src/common/logger.js.map +0 -1
- package/dist/src/common/type-inference.js.map +0 -1
- package/dist/src/common/types.js.map +0 -1
- package/dist/src/core/database-options.js.map +0 -1
- package/dist/src/core/database.js.map +0 -1
- package/dist/src/core/param.js.map +0 -1
- package/dist/src/core/statement.js.map +0 -1
- package/dist/src/func/builtins/aggregate.js.map +0 -1
- package/dist/src/func/builtins/builtin-window-functions.js.map +0 -1
- package/dist/src/func/builtins/conversion.js.map +0 -1
- package/dist/src/func/builtins/datetime.js.map +0 -1
- package/dist/src/func/builtins/explain.js.map +0 -1
- package/dist/src/func/builtins/generation.js.map +0 -1
- package/dist/src/func/builtins/index.js.map +0 -1
- package/dist/src/func/builtins/json-helpers.js.map +0 -1
- package/dist/src/func/builtins/json-tvf.js.map +0 -1
- package/dist/src/func/builtins/json.js.map +0 -1
- package/dist/src/func/builtins/scalar.js.map +0 -1
- package/dist/src/func/builtins/schema.js.map +0 -1
- package/dist/src/func/builtins/string.js.map +0 -1
- package/dist/src/func/builtins/timespan.js.map +0 -1
- package/dist/src/func/context.js.map +0 -1
- package/dist/src/func/registration.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/parser/ast.js.map +0 -1
- package/dist/src/parser/index.js.map +0 -1
- package/dist/src/parser/lexer.js.map +0 -1
- package/dist/src/parser/parser.js.map +0 -1
- package/dist/src/parser/utils.js.map +0 -1
- package/dist/src/parser/visitor.js.map +0 -1
- package/dist/src/planner/analysis/binding-collector.js.map +0 -1
- package/dist/src/planner/analysis/const-evaluator.js.map +0 -1
- package/dist/src/planner/analysis/const-pass.js.map +0 -1
- package/dist/src/planner/analysis/constraint-extractor.js.map +0 -1
- package/dist/src/planner/analysis/predicate-normalizer.js.map +0 -1
- package/dist/src/planner/building/alter-table.js.map +0 -1
- package/dist/src/planner/building/block.js.map +0 -1
- package/dist/src/planner/building/constraint-builder.js.map +0 -1
- package/dist/src/planner/building/create-assertion.js.map +0 -1
- package/dist/src/planner/building/create-view.js.map +0 -1
- package/dist/src/planner/building/ddl.js.map +0 -1
- package/dist/src/planner/building/declare-schema.js.map +0 -1
- package/dist/src/planner/building/delete.js.map +0 -1
- package/dist/src/planner/building/drop-assertion.js.map +0 -1
- package/dist/src/planner/building/drop-table.js.map +0 -1
- package/dist/src/planner/building/drop-view.js.map +0 -1
- package/dist/src/planner/building/expression.js.map +0 -1
- package/dist/src/planner/building/function-call.js.map +0 -1
- package/dist/src/planner/building/insert.js.map +0 -1
- package/dist/src/planner/building/pragma.js.map +0 -1
- package/dist/src/planner/building/schema-resolution.js.map +0 -1
- package/dist/src/planner/building/select-aggregates.js.map +0 -1
- package/dist/src/planner/building/select-compound.js.map +0 -1
- package/dist/src/planner/building/select-context.js.map +0 -1
- package/dist/src/planner/building/select-modifiers.js.map +0 -1
- package/dist/src/planner/building/select-projections.js.map +0 -1
- package/dist/src/planner/building/select-window.js.map +0 -1
- package/dist/src/planner/building/select.js.map +0 -1
- package/dist/src/planner/building/table-function.js.map +0 -1
- package/dist/src/planner/building/table.js.map +0 -1
- package/dist/src/planner/building/transaction.js.map +0 -1
- package/dist/src/planner/building/update.js.map +0 -1
- package/dist/src/planner/building/with.js.map +0 -1
- package/dist/src/planner/cache/correlation-detector.js.map +0 -1
- package/dist/src/planner/cache/materialization-advisory.js.map +0 -1
- package/dist/src/planner/cache/reference-graph.js.map +0 -1
- package/dist/src/planner/cost/index.js.map +0 -1
- package/dist/src/planner/debug/logger-utils.js.map +0 -1
- package/dist/src/planner/debug.js.map +0 -1
- package/dist/src/planner/framework/characteristics.js.map +0 -1
- package/dist/src/planner/framework/context.js.map +0 -1
- package/dist/src/planner/framework/pass.js.map +0 -1
- package/dist/src/planner/framework/physical-utils.js.map +0 -1
- package/dist/src/planner/framework/registry.js.map +0 -1
- package/dist/src/planner/framework/trace.js.map +0 -1
- package/dist/src/planner/nodes/add-constraint-node.js.map +0 -1
- package/dist/src/planner/nodes/aggregate-function.js.map +0 -1
- package/dist/src/planner/nodes/aggregate-node.js.map +0 -1
- package/dist/src/planner/nodes/array-index-node.js.map +0 -1
- package/dist/src/planner/nodes/block.js.map +0 -1
- package/dist/src/planner/nodes/cache-node.js.map +0 -1
- package/dist/src/planner/nodes/constraint-check-node.js.map +0 -1
- package/dist/src/planner/nodes/create-assertion-node.js.map +0 -1
- package/dist/src/planner/nodes/create-index-node.js.map +0 -1
- package/dist/src/planner/nodes/create-table-node.js.map +0 -1
- package/dist/src/planner/nodes/create-view-node.js.map +0 -1
- package/dist/src/planner/nodes/cte-node.js.map +0 -1
- package/dist/src/planner/nodes/cte-reference-node.js.map +0 -1
- package/dist/src/planner/nodes/declarative-schema.js.map +0 -1
- package/dist/src/planner/nodes/delete-node.js.map +0 -1
- package/dist/src/planner/nodes/distinct-node.js.map +0 -1
- package/dist/src/planner/nodes/dml-executor-node.js.map +0 -1
- package/dist/src/planner/nodes/drop-assertion-node.js.map +0 -1
- package/dist/src/planner/nodes/drop-table-node.js.map +0 -1
- package/dist/src/planner/nodes/drop-view-node.js.map +0 -1
- package/dist/src/planner/nodes/filter.js.map +0 -1
- package/dist/src/planner/nodes/function.js.map +0 -1
- package/dist/src/planner/nodes/insert-node.js.map +0 -1
- package/dist/src/planner/nodes/internal-recursive-cte-ref-node.js.map +0 -1
- package/dist/src/planner/nodes/join-node.js.map +0 -1
- package/dist/src/planner/nodes/limit-offset.js.map +0 -1
- package/dist/src/planner/nodes/plan-node-type.js.map +0 -1
- package/dist/src/planner/nodes/plan-node.js.map +0 -1
- package/dist/src/planner/nodes/pragma.js.map +0 -1
- package/dist/src/planner/nodes/project-node.js.map +0 -1
- package/dist/src/planner/nodes/recursive-cte-node.js.map +0 -1
- package/dist/src/planner/nodes/reference.js.map +0 -1
- package/dist/src/planner/nodes/remote-query-node.js.map +0 -1
- package/dist/src/planner/nodes/retrieve-node.js.map +0 -1
- package/dist/src/planner/nodes/returning-node.js.map +0 -1
- package/dist/src/planner/nodes/scalar.js.map +0 -1
- package/dist/src/planner/nodes/sequencing-node.js.map +0 -1
- package/dist/src/planner/nodes/set-operation-node.js.map +0 -1
- package/dist/src/planner/nodes/single-row.js.map +0 -1
- package/dist/src/planner/nodes/sink-node.js.map +0 -1
- package/dist/src/planner/nodes/sort.js.map +0 -1
- package/dist/src/planner/nodes/stream-aggregate.js.map +0 -1
- package/dist/src/planner/nodes/subquery.js.map +0 -1
- package/dist/src/planner/nodes/table-access-nodes.js.map +0 -1
- package/dist/src/planner/nodes/table-function-call.js.map +0 -1
- package/dist/src/planner/nodes/transaction-node.js.map +0 -1
- package/dist/src/planner/nodes/update-node.js.map +0 -1
- package/dist/src/planner/nodes/values-node.js.map +0 -1
- package/dist/src/planner/nodes/view-reference-node.js.map +0 -1
- package/dist/src/planner/nodes/window-function.js.map +0 -1
- package/dist/src/planner/nodes/window-node.js.map +0 -1
- package/dist/src/planner/optimizer-tuning.js.map +0 -1
- package/dist/src/planner/optimizer.js.map +0 -1
- package/dist/src/planner/planning-context.js.map +0 -1
- package/dist/src/planner/resolve.js.map +0 -1
- package/dist/src/planner/rules/access/rule-select-access-path.js.map +0 -1
- package/dist/src/planner/rules/aggregate/rule-aggregate-streaming.js.map +0 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.js.map +0 -1
- package/dist/src/planner/rules/cache/rule-materialization-advisory.js.map +0 -1
- package/dist/src/planner/rules/cache/rule-mutating-subquery-cache.js.map +0 -1
- package/dist/src/planner/rules/join/rule-join-greedy-commute.js.map +0 -1
- package/dist/src/planner/rules/join/rule-join-key-inference.js.map +0 -1
- package/dist/src/planner/rules/join/rule-quickpick-enumeration.js.map +0 -1
- package/dist/src/planner/rules/predicate/rule-predicate-pushdown.js.map +0 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +0 -1
- package/dist/src/planner/scopes/aliased.js.map +0 -1
- package/dist/src/planner/scopes/base.js.map +0 -1
- package/dist/src/planner/scopes/empty.js.map +0 -1
- package/dist/src/planner/scopes/global.js.map +0 -1
- package/dist/src/planner/scopes/multi.js.map +0 -1
- package/dist/src/planner/scopes/param.js.map +0 -1
- package/dist/src/planner/scopes/registered.js.map +0 -1
- package/dist/src/planner/scopes/scope.js.map +0 -1
- package/dist/src/planner/stats/basic-estimates.js.map +0 -1
- package/dist/src/planner/stats/index.js.map +0 -1
- package/dist/src/planner/type-utils.js.map +0 -1
- package/dist/src/planner/util/key-utils.js.map +0 -1
- package/dist/src/planner/validation/determinism-validator.js.map +0 -1
- package/dist/src/planner/validation/plan-validator.js.map +0 -1
- package/dist/src/runtime/async-util.js.map +0 -1
- package/dist/src/runtime/cache/shared-cache.js.map +0 -1
- package/dist/src/runtime/context-helpers.js.map +0 -1
- package/dist/src/runtime/deferred-constraint-queue.js.map +0 -1
- package/dist/src/runtime/emission-context.js.map +0 -1
- package/dist/src/runtime/emit/add-constraint.js.map +0 -1
- package/dist/src/runtime/emit/aggregate.js.map +0 -1
- package/dist/src/runtime/emit/array-index.js.map +0 -1
- package/dist/src/runtime/emit/between.js.map +0 -1
- package/dist/src/runtime/emit/binary.js.map +0 -1
- package/dist/src/runtime/emit/block.js.map +0 -1
- package/dist/src/runtime/emit/cache.js.map +0 -1
- package/dist/src/runtime/emit/case.js.map +0 -1
- package/dist/src/runtime/emit/cast.js.map +0 -1
- package/dist/src/runtime/emit/collate.js.map +0 -1
- package/dist/src/runtime/emit/column-reference.js.map +0 -1
- package/dist/src/runtime/emit/constraint-check.js.map +0 -1
- package/dist/src/runtime/emit/create-assertion.js.map +0 -1
- package/dist/src/runtime/emit/create-index.js.map +0 -1
- package/dist/src/runtime/emit/create-table.js.map +0 -1
- package/dist/src/runtime/emit/create-view.js.map +0 -1
- package/dist/src/runtime/emit/cte-reference.js.map +0 -1
- package/dist/src/runtime/emit/cte.js.map +0 -1
- package/dist/src/runtime/emit/delete.js.map +0 -1
- package/dist/src/runtime/emit/distinct.js.map +0 -1
- package/dist/src/runtime/emit/dml-executor.js.map +0 -1
- package/dist/src/runtime/emit/drop-assertion.js.map +0 -1
- package/dist/src/runtime/emit/drop-table.js.map +0 -1
- package/dist/src/runtime/emit/drop-view.js.map +0 -1
- package/dist/src/runtime/emit/filter.js.map +0 -1
- package/dist/src/runtime/emit/insert.js.map +0 -1
- package/dist/src/runtime/emit/internal-recursive-cte-ref.js.map +0 -1
- package/dist/src/runtime/emit/join.js.map +0 -1
- package/dist/src/runtime/emit/limit-offset.js.map +0 -1
- package/dist/src/runtime/emit/literal.js.map +0 -1
- package/dist/src/runtime/emit/parameter.js.map +0 -1
- package/dist/src/runtime/emit/pragma.js.map +0 -1
- package/dist/src/runtime/emit/project.js.map +0 -1
- package/dist/src/runtime/emit/recursive-cte.js.map +0 -1
- package/dist/src/runtime/emit/remote-query.js.map +0 -1
- package/dist/src/runtime/emit/retrieve.js.map +0 -1
- package/dist/src/runtime/emit/returning.js.map +0 -1
- package/dist/src/runtime/emit/scalar-function.js.map +0 -1
- package/dist/src/runtime/emit/scan.js.map +0 -1
- package/dist/src/runtime/emit/schema-declarative.js.map +0 -1
- package/dist/src/runtime/emit/sequencing.js.map +0 -1
- package/dist/src/runtime/emit/set-operation.js.map +0 -1
- package/dist/src/runtime/emit/sink.js.map +0 -1
- package/dist/src/runtime/emit/sort.js.map +0 -1
- package/dist/src/runtime/emit/subquery.js.map +0 -1
- package/dist/src/runtime/emit/table-valued-function.js.map +0 -1
- package/dist/src/runtime/emit/temporal-arithmetic.js.map +0 -1
- package/dist/src/runtime/emit/transaction.js.map +0 -1
- package/dist/src/runtime/emit/unary.js.map +0 -1
- package/dist/src/runtime/emit/update.js.map +0 -1
- package/dist/src/runtime/emit/values.js.map +0 -1
- package/dist/src/runtime/emit/window-function.js.map +0 -1
- package/dist/src/runtime/emit/window.js.map +0 -1
- package/dist/src/runtime/emitters.js.map +0 -1
- package/dist/src/runtime/register.js.map +0 -1
- package/dist/src/runtime/scheduler.js.map +0 -1
- package/dist/src/runtime/types.js.map +0 -1
- package/dist/src/runtime/utils.js.map +0 -1
- package/dist/src/schema/assertion.js.map +0 -1
- package/dist/src/schema/catalog.js.map +0 -1
- package/dist/src/schema/change-events.js.map +0 -1
- package/dist/src/schema/column.js.map +0 -1
- package/dist/src/schema/declared-schema-manager.js.map +0 -1
- package/dist/src/schema/function.js.map +0 -1
- package/dist/src/schema/manager.js.map +0 -1
- package/dist/src/schema/schema-differ.js.map +0 -1
- package/dist/src/schema/schema-hasher.js.map +0 -1
- package/dist/src/schema/schema.js.map +0 -1
- package/dist/src/schema/table.js.map +0 -1
- package/dist/src/schema/view.js.map +0 -1
- package/dist/src/schema/window-function.js.map +0 -1
- package/dist/src/types/builtin-types.js.map +0 -1
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/json-type.js.map +0 -1
- package/dist/src/types/logical-type.js.map +0 -1
- package/dist/src/types/plugin-interface.js.map +0 -1
- package/dist/src/types/registry.js.map +0 -1
- package/dist/src/types/temporal-types.js.map +0 -1
- package/dist/src/types/validation.js.map +0 -1
- package/dist/src/util/affinity.js.map +0 -1
- package/dist/src/util/ast-stringify.js.map +0 -1
- package/dist/src/util/cached.js.map +0 -1
- package/dist/src/util/coercion.js.map +0 -1
- package/dist/src/util/comparison.js.map +0 -1
- package/dist/src/util/environment.js.map +0 -1
- package/dist/src/util/hash.js.map +0 -1
- package/dist/src/util/latches.js.map +0 -1
- package/dist/src/util/mutation-statement.js.map +0 -1
- package/dist/src/util/patterns.js.map +0 -1
- package/dist/src/util/plan-formatter.js.map +0 -1
- package/dist/src/util/plugin-helper.js.map +0 -1
- package/dist/src/util/row-descriptor.js.map +0 -1
- package/dist/src/util/serialization.js.map +0 -1
- package/dist/src/util/sql-literal.js.map +0 -1
- package/dist/src/util/working-table-iterable.js.map +0 -1
- package/dist/src/vtab/best-access-plan.js.map +0 -1
- package/dist/src/vtab/connection.js.map +0 -1
- package/dist/src/vtab/filter-info.js.map +0 -1
- package/dist/src/vtab/index-info.js.map +0 -1
- package/dist/src/vtab/manifest.js.map +0 -1
- package/dist/src/vtab/memory/connection.js.map +0 -1
- package/dist/src/vtab/memory/index.js.map +0 -1
- package/dist/src/vtab/memory/layer/base-cursor.js.map +0 -1
- package/dist/src/vtab/memory/layer/base.js.map +0 -1
- package/dist/src/vtab/memory/layer/connection.js.map +0 -1
- package/dist/src/vtab/memory/layer/interface.js.map +0 -1
- package/dist/src/vtab/memory/layer/manager.js.map +0 -1
- package/dist/src/vtab/memory/layer/safe-iterate.js.map +0 -1
- package/dist/src/vtab/memory/layer/scan-plan.js.map +0 -1
- package/dist/src/vtab/memory/layer/transaction-cursor.js.map +0 -1
- package/dist/src/vtab/memory/layer/transaction.js.map +0 -1
- package/dist/src/vtab/memory/module.js.map +0 -1
- package/dist/src/vtab/memory/table.js.map +0 -1
- package/dist/src/vtab/memory/types.js.map +0 -1
- package/dist/src/vtab/memory/utils/logging.js.map +0 -1
- package/dist/src/vtab/memory/utils/primary-key.js.map +0 -1
- package/dist/src/vtab/module.js.map +0 -1
- package/dist/src/vtab/table.js.map +0 -1
- package/src/common/constants.ts +0 -60
- package/src/common/datatype.ts +0 -85
- package/src/common/errors.ts +0 -189
- package/src/common/json-types.ts +0 -16
- package/src/common/logger.ts +0 -97
- package/src/common/type-inference.ts +0 -39
- package/src/common/types.ts +0 -151
- package/src/core/database-options.ts +0 -258
- package/src/core/database.ts +0 -1461
- package/src/core/param.ts +0 -56
- package/src/core/statement.ts +0 -528
- package/src/func/builtins/aggregate.ts +0 -269
- package/src/func/builtins/builtin-window-functions.ts +0 -166
- package/src/func/builtins/conversion.ts +0 -226
- package/src/func/builtins/datetime.ts +0 -500
- package/src/func/builtins/explain.ts +0 -779
- package/src/func/builtins/generation.ts +0 -43
- package/src/func/builtins/index.ts +0 -167
- package/src/func/builtins/json-helpers.ts +0 -237
- package/src/func/builtins/json-tvf.ts +0 -224
- package/src/func/builtins/json.ts +0 -588
- package/src/func/builtins/scalar.ts +0 -423
- package/src/func/builtins/schema.ts +0 -213
- package/src/func/builtins/string.ts +0 -306
- package/src/func/builtins/timespan.ts +0 -179
- package/src/func/context.ts +0 -258
- package/src/func/registration.ts +0 -201
- package/src/index.ts +0 -172
- package/src/parser/ast.ts +0 -581
- package/src/parser/index.ts +0 -65
- package/src/parser/lexer.ts +0 -806
- package/src/parser/parser.ts +0 -3352
- package/src/parser/utils.ts +0 -10
- package/src/parser/visitor.ts +0 -188
- package/src/planner/analysis/README.md +0 -93
- package/src/planner/analysis/binding-collector.ts +0 -83
- package/src/planner/analysis/const-evaluator.ts +0 -63
- package/src/planner/analysis/const-pass.ts +0 -282
- package/src/planner/analysis/constraint-extractor.ts +0 -764
- package/src/planner/analysis/predicate-normalizer.ts +0 -237
- package/src/planner/building/alter-table.ts +0 -49
- package/src/planner/building/block.ts +0 -93
- package/src/planner/building/constraint-builder.ts +0 -178
- package/src/planner/building/create-assertion.ts +0 -7
- package/src/planner/building/create-view.ts +0 -29
- package/src/planner/building/ddl.ts +0 -24
- package/src/planner/building/declare-schema.ts +0 -22
- package/src/planner/building/delete.ts +0 -218
- package/src/planner/building/drop-assertion.ts +0 -11
- package/src/planner/building/drop-table.ts +0 -13
- package/src/planner/building/drop-view.ts +0 -19
- package/src/planner/building/expression.ts +0 -205
- package/src/planner/building/function-call.ts +0 -129
- package/src/planner/building/insert.ts +0 -435
- package/src/planner/building/pragma.ts +0 -34
- package/src/planner/building/schema-resolution.ts +0 -176
- package/src/planner/building/select-aggregates.ts +0 -318
- package/src/planner/building/select-compound.ts +0 -119
- package/src/planner/building/select-context.ts +0 -85
- package/src/planner/building/select-modifiers.ts +0 -236
- package/src/planner/building/select-projections.ts +0 -177
- package/src/planner/building/select-window.ts +0 -259
- package/src/planner/building/select.ts +0 -567
- package/src/planner/building/table-function.ts +0 -49
- package/src/planner/building/table.ts +0 -40
- package/src/planner/building/transaction.ts +0 -23
- package/src/planner/building/update.ts +0 -331
- package/src/planner/building/with.ts +0 -180
- package/src/planner/cache/correlation-detector.ts +0 -83
- package/src/planner/cache/materialization-advisory.ts +0 -265
- package/src/planner/cache/reference-graph.ts +0 -196
- package/src/planner/cost/index.ts +0 -169
- package/src/planner/debug/logger-utils.ts +0 -68
- package/src/planner/debug.ts +0 -480
- package/src/planner/framework/README.md +0 -132
- package/src/planner/framework/characteristics.ts +0 -503
- package/src/planner/framework/context.ts +0 -239
- package/src/planner/framework/pass.ts +0 -354
- package/src/planner/framework/physical-utils.ts +0 -210
- package/src/planner/framework/registry.ts +0 -261
- package/src/planner/framework/trace.ts +0 -259
- package/src/planner/nodes/add-constraint-node.ts +0 -62
- package/src/planner/nodes/aggregate-function.ts +0 -155
- package/src/planner/nodes/aggregate-node.ts +0 -267
- package/src/planner/nodes/array-index-node.ts +0 -50
- package/src/planner/nodes/block.ts +0 -80
- package/src/planner/nodes/cache-node.ts +0 -103
- package/src/planner/nodes/constraint-check-node.ts +0 -138
- package/src/planner/nodes/create-assertion-node.ts +0 -51
- package/src/planner/nodes/create-index-node.ts +0 -41
- package/src/planner/nodes/create-table-node.ts +0 -35
- package/src/planner/nodes/create-view-node.ts +0 -44
- package/src/planner/nodes/cte-node.ts +0 -168
- package/src/planner/nodes/cte-reference-node.ts +0 -125
- package/src/planner/nodes/declarative-schema.ts +0 -221
- package/src/planner/nodes/delete-node.ts +0 -102
- package/src/planner/nodes/distinct-node.ts +0 -107
- package/src/planner/nodes/dml-executor-node.ts +0 -104
- package/src/planner/nodes/drop-assertion-node.ts +0 -50
- package/src/planner/nodes/drop-table-node.ts +0 -36
- package/src/planner/nodes/drop-view-node.ts +0 -37
- package/src/planner/nodes/filter.ts +0 -144
- package/src/planner/nodes/function.ts +0 -98
- package/src/planner/nodes/insert-node.ts +0 -126
- package/src/planner/nodes/internal-recursive-cte-ref-node.ts +0 -61
- package/src/planner/nodes/join-node.ts +0 -336
- package/src/planner/nodes/limit-offset.ts +0 -144
- package/src/planner/nodes/plan-node-type.ts +0 -95
- package/src/planner/nodes/plan-node.ts +0 -503
- package/src/planner/nodes/pragma.ts +0 -98
- package/src/planner/nodes/project-node.ts +0 -337
- package/src/planner/nodes/recursive-cte-node.ts +0 -158
- package/src/planner/nodes/reference.ts +0 -334
- package/src/planner/nodes/remote-query-node.ts +0 -73
- package/src/planner/nodes/retrieve-node.ts +0 -86
- package/src/planner/nodes/returning-node.ts +0 -269
- package/src/planner/nodes/scalar.ts +0 -772
- package/src/planner/nodes/sequencing-node.ts +0 -113
- package/src/planner/nodes/set-operation-node.ts +0 -87
- package/src/planner/nodes/single-row.ts +0 -85
- package/src/planner/nodes/sink-node.ts +0 -61
- package/src/planner/nodes/sort.ts +0 -166
- package/src/planner/nodes/stream-aggregate.ts +0 -293
- package/src/planner/nodes/subquery.ts +0 -268
- package/src/planner/nodes/table-access-nodes.ts +0 -323
- package/src/planner/nodes/table-function-call.ts +0 -134
- package/src/planner/nodes/transaction-node.ts +0 -55
- package/src/planner/nodes/update-node.ts +0 -138
- package/src/planner/nodes/values-node.ts +0 -244
- package/src/planner/nodes/view-reference-node.ts +0 -97
- package/src/planner/nodes/window-function.ts +0 -73
- package/src/planner/nodes/window-node.ts +0 -199
- package/src/planner/optimizer-tuning.ts +0 -105
- package/src/planner/optimizer.ts +0 -332
- package/src/planner/planning-context.ts +0 -190
- package/src/planner/resolve.ts +0 -101
- package/src/planner/rules/README.md +0 -96
- package/src/planner/rules/access/rule-select-access-path.ts +0 -399
- package/src/planner/rules/aggregate/rule-aggregate-streaming.ts +0 -162
- package/src/planner/rules/cache/rule-cte-optimization.ts +0 -79
- package/src/planner/rules/cache/rule-materialization-advisory.ts +0 -77
- package/src/planner/rules/cache/rule-mutating-subquery-cache.ts +0 -104
- package/src/planner/rules/join/rule-join-greedy-commute.ts +0 -48
- package/src/planner/rules/join/rule-join-key-inference.ts +0 -35
- package/src/planner/rules/join/rule-quickpick-enumeration.ts +0 -267
- package/src/planner/rules/predicate/rule-predicate-pushdown.ts +0 -144
- package/src/planner/rules/retrieve/rule-grow-retrieve.ts +0 -337
- package/src/planner/scopes/aliased.ts +0 -50
- package/src/planner/scopes/base.ts +0 -10
- package/src/planner/scopes/empty.ts +0 -12
- package/src/planner/scopes/global.ts +0 -73
- package/src/planner/scopes/multi.ts +0 -40
- package/src/planner/scopes/param.ts +0 -95
- package/src/planner/scopes/registered.ts +0 -67
- package/src/planner/scopes/scope.ts +0 -16
- package/src/planner/stats/basic-estimates.ts +0 -107
- package/src/planner/stats/index.ts +0 -158
- package/src/planner/type-utils.ts +0 -87
- package/src/planner/util/key-utils.ts +0 -46
- package/src/planner/validation/determinism-validator.ts +0 -104
- package/src/planner/validation/plan-validator.ts +0 -335
- package/src/runtime/async-util.ts +0 -283
- package/src/runtime/cache/shared-cache.ts +0 -169
- package/src/runtime/context-helpers.ts +0 -191
- package/src/runtime/deferred-constraint-queue.ts +0 -196
- package/src/runtime/emission-context.ts +0 -319
- package/src/runtime/emit/add-constraint.ts +0 -78
- package/src/runtime/emit/aggregate.ts +0 -581
- package/src/runtime/emit/array-index.ts +0 -25
- package/src/runtime/emit/between.ts +0 -51
- package/src/runtime/emit/binary.ts +0 -357
- package/src/runtime/emit/block.ts +0 -23
- package/src/runtime/emit/cache.ts +0 -64
- package/src/runtime/emit/case.ts +0 -87
- package/src/runtime/emit/cast.ts +0 -151
- package/src/runtime/emit/collate.ts +0 -9
- package/src/runtime/emit/column-reference.ts +0 -17
- package/src/runtime/emit/constraint-check.ts +0 -290
- package/src/runtime/emit/create-assertion.ts +0 -82
- package/src/runtime/emit/create-index.ts +0 -15
- package/src/runtime/emit/create-table.ts +0 -15
- package/src/runtime/emit/create-view.ts +0 -52
- package/src/runtime/emit/cte-reference.ts +0 -38
- package/src/runtime/emit/cte.ts +0 -39
- package/src/runtime/emit/delete.ts +0 -24
- package/src/runtime/emit/distinct.ts +0 -40
- package/src/runtime/emit/dml-executor.ts +0 -198
- package/src/runtime/emit/drop-assertion.ts +0 -45
- package/src/runtime/emit/drop-table.ts +0 -27
- package/src/runtime/emit/drop-view.ts +0 -49
- package/src/runtime/emit/filter.ts +0 -30
- package/src/runtime/emit/insert.ts +0 -42
- package/src/runtime/emit/internal-recursive-cte-ref.ts +0 -37
- package/src/runtime/emit/join.ts +0 -148
- package/src/runtime/emit/limit-offset.ts +0 -73
- package/src/runtime/emit/literal.ts +0 -17
- package/src/runtime/emit/parameter.ts +0 -59
- package/src/runtime/emit/pragma.ts +0 -56
- package/src/runtime/emit/project.ts +0 -46
- package/src/runtime/emit/recursive-cte.ts +0 -111
- package/src/runtime/emit/remote-query.ts +0 -47
- package/src/runtime/emit/retrieve.ts +0 -15
- package/src/runtime/emit/returning.ts +0 -41
- package/src/runtime/emit/scalar-function.ts +0 -69
- package/src/runtime/emit/scan.ts +0 -106
- package/src/runtime/emit/schema-declarative.ts +0 -215
- package/src/runtime/emit/sequencing.ts +0 -24
- package/src/runtime/emit/set-operation.ts +0 -141
- package/src/runtime/emit/sink.ts +0 -27
- package/src/runtime/emit/sort.ts +0 -75
- package/src/runtime/emit/subquery.ts +0 -203
- package/src/runtime/emit/table-valued-function.ts +0 -106
- package/src/runtime/emit/temporal-arithmetic.ts +0 -302
- package/src/runtime/emit/transaction.ts +0 -205
- package/src/runtime/emit/unary.ts +0 -101
- package/src/runtime/emit/update.ts +0 -66
- package/src/runtime/emit/values.ts +0 -66
- package/src/runtime/emit/window-function.ts +0 -42
- package/src/runtime/emit/window.ts +0 -458
- package/src/runtime/emitters.ts +0 -183
- package/src/runtime/register.ts +0 -150
- package/src/runtime/scheduler.ts +0 -488
- package/src/runtime/types.ts +0 -242
- package/src/runtime/utils.ts +0 -177
- package/src/schema/assertion.ts +0 -21
- package/src/schema/catalog.ts +0 -269
- package/src/schema/change-events.ts +0 -80
- package/src/schema/column.ts +0 -51
- package/src/schema/declared-schema-manager.ts +0 -82
- package/src/schema/function.ts +0 -188
- package/src/schema/manager.ts +0 -1034
- package/src/schema/schema-differ.ts +0 -214
- package/src/schema/schema-hasher.ts +0 -26
- package/src/schema/schema.ts +0 -222
- package/src/schema/table.ts +0 -409
- package/src/schema/view.ts +0 -19
- package/src/schema/window-function.ts +0 -56
- package/src/types/builtin-types.ts +0 -350
- package/src/types/index.ts +0 -17
- package/src/types/json-type.ts +0 -152
- package/src/types/logical-type.ts +0 -91
- package/src/types/plugin-interface.ts +0 -10
- package/src/types/registry.ts +0 -204
- package/src/types/temporal-types.ts +0 -290
- package/src/types/validation.ts +0 -120
- package/src/util/affinity.ts +0 -151
- package/src/util/ast-stringify.ts +0 -887
- package/src/util/cached.ts +0 -25
- package/src/util/coercion.ts +0 -113
- package/src/util/comparison.ts +0 -510
- package/src/util/environment.ts +0 -52
- package/src/util/hash.ts +0 -90
- package/src/util/latches.ts +0 -47
- package/src/util/mutation-statement.ts +0 -135
- package/src/util/patterns.ts +0 -56
- package/src/util/plan-formatter.ts +0 -48
- package/src/util/plugin-helper.ts +0 -110
- package/src/util/row-descriptor.ts +0 -105
- package/src/util/serialization.ts +0 -47
- package/src/util/sql-literal.ts +0 -22
- package/src/util/working-table-iterable.ts +0 -38
- package/src/vtab/best-access-plan.ts +0 -244
- package/src/vtab/connection.ts +0 -36
- package/src/vtab/filter-info.ts +0 -23
- package/src/vtab/index-info.ts +0 -84
- package/src/vtab/manifest.ts +0 -86
- package/src/vtab/memory/connection.ts +0 -73
- package/src/vtab/memory/index.ts +0 -191
- package/src/vtab/memory/layer/base-cursor.ts +0 -124
- package/src/vtab/memory/layer/base.ts +0 -275
- package/src/vtab/memory/layer/connection.ts +0 -203
- package/src/vtab/memory/layer/interface.ts +0 -47
- package/src/vtab/memory/layer/manager.ts +0 -909
- package/src/vtab/memory/layer/safe-iterate.ts +0 -49
- package/src/vtab/memory/layer/scan-plan.ts +0 -84
- package/src/vtab/memory/layer/transaction-cursor.ts +0 -162
- package/src/vtab/memory/layer/transaction.ts +0 -229
- package/src/vtab/memory/module.ts +0 -667
- package/src/vtab/memory/table.ts +0 -251
- package/src/vtab/memory/types.ts +0 -23
- package/src/vtab/memory/utils/logging.ts +0 -36
- package/src/vtab/memory/utils/primary-key.ts +0 -163
- package/src/vtab/module.ts +0 -162
- package/src/vtab/table.ts +0 -177
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import type { ScalarPlanNode } from '../nodes/plan-node.js';
|
|
2
|
-
import { PlanNodeType } from '../nodes/plan-node-type.js';
|
|
3
|
-
import { BinaryOpNode, UnaryOpNode, LiteralNode, BetweenNode } from '../nodes/scalar.js';
|
|
4
|
-
import { ColumnReferenceNode } from '../nodes/reference.js';
|
|
5
|
-
import { InNode } from '../nodes/subquery.js';
|
|
6
|
-
import type * as AST from '../../parser/ast.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Normalize a predicate for push-down and constraint extraction.
|
|
10
|
-
*
|
|
11
|
-
* Transformations (conservative, no CNF/DNF expansion):
|
|
12
|
-
* - Push NOT down (De Morgan) for AND/OR and double-negation elimination
|
|
13
|
-
* - Invert simple comparisons under NOT (>, >=, <, <=)
|
|
14
|
-
* - Canonicalize nested AND/OR by flattening binary trees
|
|
15
|
-
* - Normalize child predicates recursively
|
|
16
|
-
*
|
|
17
|
-
* Notes:
|
|
18
|
-
* - We intentionally do NOT distribute OR over AND (to avoid blow-ups)
|
|
19
|
-
* - NOT of equality becomes "!="; extractor treats it as residual (acceptable)
|
|
20
|
-
* - NOT of BETWEEN toggles the node's 'not' flag
|
|
21
|
-
*/
|
|
22
|
-
export function normalizePredicate(expr: ScalarPlanNode): ScalarPlanNode {
|
|
23
|
-
return normalize(expr);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function normalize(node: ScalarPlanNode): ScalarPlanNode {
|
|
27
|
-
switch (node.nodeType) {
|
|
28
|
-
case PlanNodeType.UnaryOp: {
|
|
29
|
-
const u = node as UnaryOpNode;
|
|
30
|
-
if (u.expression.operator === 'NOT') {
|
|
31
|
-
return pushNotDown(u.operand);
|
|
32
|
-
}
|
|
33
|
-
// Recurse
|
|
34
|
-
const normalizedOperand = normalize(u.operand);
|
|
35
|
-
return normalizedOperand === u.operand
|
|
36
|
-
? u
|
|
37
|
-
: new UnaryOpNode(u.scope, u.expression, normalizedOperand);
|
|
38
|
-
}
|
|
39
|
-
case PlanNodeType.BinaryOp: {
|
|
40
|
-
const b = node as BinaryOpNode;
|
|
41
|
-
const op = b.expression.operator;
|
|
42
|
-
if (op === 'AND' || op === 'OR') {
|
|
43
|
-
// Normalize children first
|
|
44
|
-
const left = normalize(b.left);
|
|
45
|
-
const right = normalize(b.right);
|
|
46
|
-
// Flatten nested same-op nodes
|
|
47
|
-
const parts = collectAssociative(op, [left, right]);
|
|
48
|
-
if (op === 'OR') {
|
|
49
|
-
const collapsed = tryCollapseOrToIn(b.scope, parts);
|
|
50
|
-
if (collapsed) return collapsed;
|
|
51
|
-
}
|
|
52
|
-
return rebuildAssociative(b.scope, op, parts, b.expression);
|
|
53
|
-
}
|
|
54
|
-
// Other binary ops: normalize children only
|
|
55
|
-
const nLeft = normalize(b.left);
|
|
56
|
-
const nRight = normalize(b.right);
|
|
57
|
-
if (nLeft === b.left && nRight === b.right) {
|
|
58
|
-
return b;
|
|
59
|
-
}
|
|
60
|
-
return new BinaryOpNode(b.scope, b.expression, nLeft, nRight);
|
|
61
|
-
}
|
|
62
|
-
case PlanNodeType.Between: {
|
|
63
|
-
// Normalize sub-expressions only
|
|
64
|
-
const bt = node as BetweenNode;
|
|
65
|
-
const nExpr = normalize(bt.expr);
|
|
66
|
-
const nLower = normalize(bt.lower);
|
|
67
|
-
const nUpper = normalize(bt.upper);
|
|
68
|
-
if (nExpr === bt.expr && nLower === bt.lower && nUpper === bt.upper) {
|
|
69
|
-
return bt;
|
|
70
|
-
}
|
|
71
|
-
return new BetweenNode(bt.scope, bt.expression, nExpr, nLower, nUpper);
|
|
72
|
-
}
|
|
73
|
-
default:
|
|
74
|
-
return node;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function pushNotDown(node: ScalarPlanNode): ScalarPlanNode {
|
|
79
|
-
// NOT over NOT
|
|
80
|
-
if (node.nodeType === PlanNodeType.UnaryOp) {
|
|
81
|
-
const u = node as UnaryOpNode;
|
|
82
|
-
if (u.expression.operator === 'NOT') {
|
|
83
|
-
return normalize(u.operand);
|
|
84
|
-
}
|
|
85
|
-
// NOT over other unary ops: leave as residual NOT(op)
|
|
86
|
-
const nOp = normalize(u.operand);
|
|
87
|
-
return nOp === u.operand ? new UnaryOpNode(u.scope, u.expression, nOp) : new UnaryOpNode(u.scope, u.expression, nOp);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (node.nodeType === PlanNodeType.BinaryOp) {
|
|
91
|
-
const b = node as BinaryOpNode;
|
|
92
|
-
const op = b.expression.operator;
|
|
93
|
-
// De Morgan for boolean connectives
|
|
94
|
-
if (op === 'AND' || op === 'OR') {
|
|
95
|
-
const negLeft = pushNotDown(b.left);
|
|
96
|
-
const negRight = pushNotDown(b.right);
|
|
97
|
-
const flipped = op === 'AND' ? 'OR' : 'AND';
|
|
98
|
-
const expr: AST.BinaryExpr = { type: 'binary', operator: flipped, left: (b.expression.left as AST.Expression), right: (b.expression.right as AST.Expression) };
|
|
99
|
-
// Rebuild and normalize/flatten
|
|
100
|
-
const combined = rebuildAssociative(b.scope, flipped, [negLeft, negRight], expr);
|
|
101
|
-
return combined;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Invert simple comparisons
|
|
105
|
-
const inverted = invertComparisonIfPossible(b);
|
|
106
|
-
if (inverted) {
|
|
107
|
-
return normalize(inverted);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Otherwise, keep as NOT(binary) by wrapping a NOT
|
|
111
|
-
const normalizedLeft = normalize(b.left);
|
|
112
|
-
const normalizedRight = normalize(b.right);
|
|
113
|
-
const rebuilt = (normalizedLeft === b.left && normalizedRight === b.right)
|
|
114
|
-
? b
|
|
115
|
-
: new BinaryOpNode(b.scope, b.expression, normalizedLeft, normalizedRight);
|
|
116
|
-
const notAst: AST.UnaryExpr = { type: 'unary', operator: 'NOT', expr: b.expression };
|
|
117
|
-
return new UnaryOpNode(b.scope, notAst, rebuilt);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (node.nodeType === PlanNodeType.Between) {
|
|
121
|
-
// Toggle the NOT flag on BETWEEN
|
|
122
|
-
const bt = node as BetweenNode;
|
|
123
|
-
const ast: AST.BetweenExpr = { ...bt.expression, not: !bt.expression.not };
|
|
124
|
-
const nExpr = normalize(bt.expr);
|
|
125
|
-
const nLower = normalize(bt.lower);
|
|
126
|
-
const nUpper = normalize(bt.upper);
|
|
127
|
-
return new BetweenNode(bt.scope, ast, nExpr, nLower, nUpper);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Generic fallback: NOT(expr) as unary
|
|
131
|
-
const notAst: AST.UnaryExpr = { type: 'unary', operator: 'NOT', expr: (node as any).expression };
|
|
132
|
-
return new UnaryOpNode((node as any).scope, notAst, normalize(node));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function collectAssociative(op: string, parts: ScalarPlanNode[]): ScalarPlanNode[] {
|
|
136
|
-
const result: ScalarPlanNode[] = [];
|
|
137
|
-
for (const p of parts) {
|
|
138
|
-
if (p.nodeType === PlanNodeType.BinaryOp) {
|
|
139
|
-
const b = p as BinaryOpNode;
|
|
140
|
-
if (b.expression.operator === op) {
|
|
141
|
-
result.push(...collectAssociative(op, [b.left, b.right]));
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
result.push(p);
|
|
146
|
-
}
|
|
147
|
-
return result;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function rebuildAssociative(scope: any, op: string, parts: ScalarPlanNode[], baseExpr: AST.BinaryExpr): ScalarPlanNode {
|
|
151
|
-
if (parts.length === 0) {
|
|
152
|
-
// Degenerate; shouldn't happen
|
|
153
|
-
return new LiteralNode(scope, { type: 'literal', value: 1 });
|
|
154
|
-
}
|
|
155
|
-
if (parts.length === 1) {
|
|
156
|
-
return parts[0];
|
|
157
|
-
}
|
|
158
|
-
// Left-associative rebuild
|
|
159
|
-
let acc = parts[0];
|
|
160
|
-
for (let i = 1; i < parts.length; i++) {
|
|
161
|
-
const right = parts[i];
|
|
162
|
-
const newAst: AST.BinaryExpr = { type: 'binary', operator: op, left: (acc as any).expression ?? baseExpr.left, right: (right as any).expression ?? baseExpr.right };
|
|
163
|
-
acc = new BinaryOpNode(scope, newAst, acc, right);
|
|
164
|
-
}
|
|
165
|
-
return acc;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function invertComparisonIfPossible(b: BinaryOpNode): ScalarPlanNode | null {
|
|
169
|
-
const op = b.expression.operator;
|
|
170
|
-
const flippedOp = flipComparison(op);
|
|
171
|
-
if (!flippedOp) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
const ast: AST.BinaryExpr = { type: 'binary', operator: flippedOp, left: b.expression.left, right: b.expression.right };
|
|
175
|
-
return new BinaryOpNode(b.scope, ast, b.left, b.right);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function flipComparison(op: string): string | null {
|
|
179
|
-
switch (op) {
|
|
180
|
-
case '>': return '<=';
|
|
181
|
-
case '>=': return '<';
|
|
182
|
-
case '<': return '>=';
|
|
183
|
-
case '<=': return '>';
|
|
184
|
-
case '=': return '!='; // extractor will treat as residual; acceptable
|
|
185
|
-
default: return null;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Attempt to collapse OR of equalities into an IN list when:
|
|
190
|
-
// - All disjuncts are of the form (col = literal)
|
|
191
|
-
// - The same column is used
|
|
192
|
-
// - Literal list is small (<= 32) to avoid large INs
|
|
193
|
-
function tryCollapseOrToIn(scope: any, disjuncts: ScalarPlanNode[]): ScalarPlanNode | null {
|
|
194
|
-
const values: LiteralNode[] = [];
|
|
195
|
-
let column: ColumnReferenceNode | null = null;
|
|
196
|
-
|
|
197
|
-
for (const d of disjuncts) {
|
|
198
|
-
if (d.nodeType !== PlanNodeType.BinaryOp) return null;
|
|
199
|
-
const b = d as BinaryOpNode;
|
|
200
|
-
if (b.expression.operator !== '=') return null;
|
|
201
|
-
|
|
202
|
-
// Two patterns: col = lit OR lit = col
|
|
203
|
-
let col: ColumnReferenceNode | null = null;
|
|
204
|
-
let lit: LiteralNode | null = null;
|
|
205
|
-
if (b.left.nodeType === PlanNodeType.ColumnReference && b.right.nodeType === PlanNodeType.Literal) {
|
|
206
|
-
col = b.left as ColumnReferenceNode;
|
|
207
|
-
lit = b.right as LiteralNode;
|
|
208
|
-
} else if (b.left.nodeType === PlanNodeType.Literal && b.right.nodeType === PlanNodeType.ColumnReference) {
|
|
209
|
-
col = b.right as ColumnReferenceNode;
|
|
210
|
-
lit = b.left as LiteralNode;
|
|
211
|
-
} else {
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (!column) {
|
|
216
|
-
column = col;
|
|
217
|
-
} else if (column.attributeId !== col.attributeId) {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
values.push(lit);
|
|
222
|
-
if (values.length > 32) return null; // avoid creating huge IN lists
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (!column || values.length === 0) return null;
|
|
226
|
-
|
|
227
|
-
// Build an InNode with constant values
|
|
228
|
-
const ast: AST.InExpr = {
|
|
229
|
-
type: 'in',
|
|
230
|
-
expr: (column as any).expression,
|
|
231
|
-
values: values.map(v => (v as any).expression)
|
|
232
|
-
};
|
|
233
|
-
const inNode = new InNode((column as any).scope, ast, column, undefined, values);
|
|
234
|
-
return inNode;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type * as AST from '../../parser/ast.js';
|
|
2
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
3
|
-
import { AddConstraintNode } from '../nodes/add-constraint-node.js';
|
|
4
|
-
import { buildTableReference } from './table.js';
|
|
5
|
-
import { QuereusError } from '../../common/errors.js';
|
|
6
|
-
import { StatusCode } from '../../common/types.js';
|
|
7
|
-
import type { VoidNode } from '../nodes/plan-node.js';
|
|
8
|
-
|
|
9
|
-
export function buildAlterTableStmt(
|
|
10
|
-
ctx: PlanningContext,
|
|
11
|
-
stmt: AST.AlterTableStmt,
|
|
12
|
-
): VoidNode {
|
|
13
|
-
const tableRetrieve = buildTableReference({ type: 'table', table: stmt.table }, ctx);
|
|
14
|
-
const tableReference = tableRetrieve.tableRef; // Extract the actual TableReferenceNode
|
|
15
|
-
|
|
16
|
-
switch (stmt.action.type) {
|
|
17
|
-
case 'addConstraint': {
|
|
18
|
-
// Convert RowOp[] (e.g., ['insert','update']) to bitmask understood by runtime.
|
|
19
|
-
const operations = stmt.action.constraint.operations ?? ['insert','update'];
|
|
20
|
-
|
|
21
|
-
const constraintWithBitmask = {
|
|
22
|
-
...stmt.action.constraint,
|
|
23
|
-
operations
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return new AddConstraintNode(
|
|
27
|
-
ctx.scope,
|
|
28
|
-
tableReference,
|
|
29
|
-
constraintWithBitmask
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
case 'renameTable':
|
|
34
|
-
case 'renameColumn':
|
|
35
|
-
case 'addColumn':
|
|
36
|
-
case 'dropColumn':
|
|
37
|
-
throw new QuereusError(
|
|
38
|
-
`ALTER TABLE ${stmt.action.type} is not yet implemented`,
|
|
39
|
-
StatusCode.UNSUPPORTED
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
default:
|
|
43
|
-
throw new QuereusError(
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
-
`Unknown ALTER TABLE action: ${(stmt.action as any).type}`,
|
|
46
|
-
StatusCode.INTERNAL
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { BlockNode } from '../nodes/block.js';
|
|
2
|
-
import * as AST from '../../parser/ast.js';
|
|
3
|
-
import type { PlanNode } from '../nodes/plan-node.js';
|
|
4
|
-
import { buildSelectStmt } from './select.js';
|
|
5
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
6
|
-
import { buildCreateTableStmt } from './ddl.js';
|
|
7
|
-
import { buildCreateIndexStmt } from './ddl.js';
|
|
8
|
-
import { buildDropTableStmt } from './drop-table.js';
|
|
9
|
-
import { buildCreateViewStmt } from './create-view.js';
|
|
10
|
-
import { buildDropViewStmt } from './drop-view.js';
|
|
11
|
-
import { buildCreateAssertionStmt } from './create-assertion.js';
|
|
12
|
-
import { buildDropAssertionStmt } from './drop-assertion.js';
|
|
13
|
-
import { buildInsertStmt } from './insert.js';
|
|
14
|
-
import { buildUpdateStmt } from './update.js';
|
|
15
|
-
import { buildDeleteStmt } from './delete.js';
|
|
16
|
-
import { buildAlterTableStmt } from './alter-table.js';
|
|
17
|
-
import { buildBeginStmt, buildCommitStmt, buildRollbackStmt, buildSavepointStmt, buildReleaseStmt } from './transaction.js';
|
|
18
|
-
import { buildPragmaStmt } from './pragma.js';
|
|
19
|
-
import { buildValuesStmt } from './select.js';
|
|
20
|
-
import { quereusError } from '../../common/errors.js';
|
|
21
|
-
import { StatusCode } from '../../common/types.js';
|
|
22
|
-
import { buildDeclareSchemaStmt, buildDiffSchemaStmt, buildApplySchemaStmt, buildExplainSchemaStmt } from './declare-schema.js';
|
|
23
|
-
|
|
24
|
-
export function buildBlock(ctx: PlanningContext, statements: AST.Statement[]): BlockNode {
|
|
25
|
-
const plannedStatements = statements.map((stmt) => {
|
|
26
|
-
switch (stmt.type) {
|
|
27
|
-
case 'select':
|
|
28
|
-
// buildSelectStmt returns a BatchNode, which is a PlanNode.
|
|
29
|
-
return buildSelectStmt(ctx, stmt as AST.SelectStmt);
|
|
30
|
-
case 'createTable':
|
|
31
|
-
return buildCreateTableStmt(ctx, stmt as AST.CreateTableStmt);
|
|
32
|
-
case 'createIndex':
|
|
33
|
-
return buildCreateIndexStmt(ctx, stmt as AST.CreateIndexStmt);
|
|
34
|
-
case 'createView':
|
|
35
|
-
return buildCreateViewStmt(ctx, stmt as AST.CreateViewStmt);
|
|
36
|
-
case 'createAssertion':
|
|
37
|
-
return buildCreateAssertionStmt(ctx, stmt as AST.CreateAssertionStmt);
|
|
38
|
-
case 'drop':
|
|
39
|
-
if (stmt.objectType === 'table') {
|
|
40
|
-
return buildDropTableStmt(ctx, stmt as AST.DropStmt);
|
|
41
|
-
} else if (stmt.objectType === 'view') {
|
|
42
|
-
return buildDropViewStmt(ctx, stmt as AST.DropStmt);
|
|
43
|
-
} else if (stmt.objectType === 'assertion') {
|
|
44
|
-
return buildDropAssertionStmt(ctx, stmt as AST.DropStmt);
|
|
45
|
-
}
|
|
46
|
-
break;
|
|
47
|
-
case 'insert':
|
|
48
|
-
return buildInsertStmt(ctx, stmt as AST.InsertStmt);
|
|
49
|
-
case 'update':
|
|
50
|
-
return buildUpdateStmt(ctx, stmt as AST.UpdateStmt);
|
|
51
|
-
case 'delete':
|
|
52
|
-
return buildDeleteStmt(ctx, stmt as AST.DeleteStmt);
|
|
53
|
-
case 'begin':
|
|
54
|
-
return buildBeginStmt(ctx, stmt as AST.BeginStmt);
|
|
55
|
-
case 'commit':
|
|
56
|
-
return buildCommitStmt(ctx, stmt as AST.CommitStmt);
|
|
57
|
-
case 'rollback':
|
|
58
|
-
return buildRollbackStmt(ctx, stmt as AST.RollbackStmt);
|
|
59
|
-
case 'savepoint':
|
|
60
|
-
return buildSavepointStmt(ctx, stmt as AST.SavepointStmt);
|
|
61
|
-
case 'release':
|
|
62
|
-
return buildReleaseStmt(ctx, stmt as AST.ReleaseStmt);
|
|
63
|
-
case 'pragma':
|
|
64
|
-
return buildPragmaStmt(ctx, stmt as AST.PragmaStmt);
|
|
65
|
-
case 'alterTable':
|
|
66
|
-
return buildAlterTableStmt(ctx, stmt as AST.AlterTableStmt);
|
|
67
|
-
case 'values':
|
|
68
|
-
return buildValuesStmt(ctx, stmt as AST.ValuesStmt);
|
|
69
|
-
case 'declareSchema':
|
|
70
|
-
return buildDeclareSchemaStmt(ctx, stmt as unknown as AST.DeclareSchemaStmt);
|
|
71
|
-
case 'diffSchema':
|
|
72
|
-
return buildDiffSchemaStmt(ctx, stmt as unknown as AST.DiffSchemaStmt);
|
|
73
|
-
case 'applySchema':
|
|
74
|
-
return buildApplySchemaStmt(ctx, stmt as unknown as AST.ApplySchemaStmt);
|
|
75
|
-
case 'explainSchema':
|
|
76
|
-
return buildExplainSchemaStmt(ctx, stmt as unknown as AST.ExplainSchemaStmt);
|
|
77
|
-
default:
|
|
78
|
-
// Throw an exception for unsupported statement types
|
|
79
|
-
quereusError(
|
|
80
|
-
`Unsupported statement type: ${(stmt as AST.Statement).type}`,
|
|
81
|
-
StatusCode.UNSUPPORTED,
|
|
82
|
-
undefined,
|
|
83
|
-
stmt
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
}).filter(p => p !== undefined) as PlanNode[]; // Ensure we only have valid PlanNodes and cast
|
|
87
|
-
|
|
88
|
-
// The final BatchNode for the entire batch.
|
|
89
|
-
// Its scope is batchParameterScope, and it contains all successfully planned statements.
|
|
90
|
-
return new BlockNode(ctx.scope, plannedStatements, { ...ctx.parameters });
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
2
|
-
import type { TableSchema, RowConstraintSchema } from '../../schema/table.js';
|
|
3
|
-
import type { RowOpFlag } from '../../schema/table.js';
|
|
4
|
-
import type { Attribute, RowDescriptor } from '../nodes/plan-node.js';
|
|
5
|
-
import type { ConstraintCheck } from '../nodes/constraint-check-node.js';
|
|
6
|
-
import { RegisteredScope } from '../scopes/registered.js';
|
|
7
|
-
import { buildExpression } from './expression.js';
|
|
8
|
-
import { PlanNodeType } from '../nodes/plan-node-type.js';
|
|
9
|
-
import { ColumnReferenceNode } from '../nodes/reference.js';
|
|
10
|
-
import type { ScalarPlanNode } from '../nodes/plan-node.js';
|
|
11
|
-
import * as AST from '../../parser/ast.js';
|
|
12
|
-
import { validateDeterministicConstraint } from '../validation/determinism-validator.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Determines if a constraint should be checked for the given operation
|
|
16
|
-
*/
|
|
17
|
-
function shouldCheckConstraint(constraint: RowConstraintSchema, operation: RowOpFlag): boolean {
|
|
18
|
-
// Check if the current operation is in the constraint's operations bitmask
|
|
19
|
-
return (constraint.operations & operation) !== 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Builds constraint check expressions at plan time.
|
|
24
|
-
* This allows the optimizer to see and optimize constraint expressions.
|
|
25
|
-
*/
|
|
26
|
-
export function buildConstraintChecks(
|
|
27
|
-
ctx: PlanningContext,
|
|
28
|
-
tableSchema: TableSchema,
|
|
29
|
-
operation: RowOpFlag,
|
|
30
|
-
oldAttributes: Attribute[],
|
|
31
|
-
newAttributes: Attribute[],
|
|
32
|
-
_flatRowDescriptor: RowDescriptor,
|
|
33
|
-
contextAttributes: Attribute[] = []
|
|
34
|
-
): ConstraintCheck[] {
|
|
35
|
-
// Build attribute ID mappings for column registration
|
|
36
|
-
const newAttrIdByCol: Record<string, number> = {};
|
|
37
|
-
const oldAttrIdByCol: Record<string, number> = {};
|
|
38
|
-
|
|
39
|
-
newAttributes.forEach((attr, columnIndex) => {
|
|
40
|
-
if (columnIndex < tableSchema.columns.length) {
|
|
41
|
-
const column = tableSchema.columns[columnIndex];
|
|
42
|
-
newAttrIdByCol[column.name.toLowerCase()] = attr.id;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
oldAttributes.forEach((attr, columnIndex) => {
|
|
47
|
-
if (columnIndex < tableSchema.columns.length) {
|
|
48
|
-
const column = tableSchema.columns[columnIndex];
|
|
49
|
-
oldAttrIdByCol[column.name.toLowerCase()] = attr.id;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Filter constraints by operation
|
|
54
|
-
const applicableConstraints = tableSchema.checkConstraints
|
|
55
|
-
.filter(constraint => shouldCheckConstraint(constraint, operation));
|
|
56
|
-
|
|
57
|
-
// Build expression nodes for each constraint
|
|
58
|
-
return applicableConstraints.map(constraint => {
|
|
59
|
-
// Create scope with OLD/NEW column access for constraint evaluation
|
|
60
|
-
const constraintScope = new RegisteredScope(ctx.scope);
|
|
61
|
-
|
|
62
|
-
// Register mutation context variables FIRST (so they shadow column names if conflicts exist)
|
|
63
|
-
contextAttributes.forEach((attr, contextVarIndex) => {
|
|
64
|
-
if (contextVarIndex < (tableSchema.mutationContext?.length || 0)) {
|
|
65
|
-
const contextVar = tableSchema.mutationContext![contextVarIndex];
|
|
66
|
-
const varNameLower = contextVar.name.toLowerCase();
|
|
67
|
-
|
|
68
|
-
// Register both unqualified and qualified names
|
|
69
|
-
constraintScope.subscribeFactory(varNameLower, (exp, s) =>
|
|
70
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, attr.type, attr.id, contextVarIndex)
|
|
71
|
-
);
|
|
72
|
-
constraintScope.subscribeFactory(`context.${varNameLower}`, (exp, s) =>
|
|
73
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, attr.type, attr.id, contextVarIndex)
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// Register column symbols (similar to current emitConstraintCheck logic)
|
|
79
|
-
tableSchema.columns.forEach((tableColumn, tableColIndex) => {
|
|
80
|
-
const colNameLower = tableColumn.name.toLowerCase();
|
|
81
|
-
|
|
82
|
-
// Register NEW.col and unqualified col (defaults to NEW for INSERT/UPDATE, OLD for DELETE)
|
|
83
|
-
const newAttrId = newAttrIdByCol[colNameLower];
|
|
84
|
-
if (newAttrId !== undefined) {
|
|
85
|
-
const newColumnType = {
|
|
86
|
-
typeClass: 'scalar' as const,
|
|
87
|
-
logicalType: tableColumn.logicalType,
|
|
88
|
-
nullable: !tableColumn.notNull,
|
|
89
|
-
isReadOnly: false
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// NEW.column
|
|
93
|
-
constraintScope.registerSymbol(`new.${colNameLower}`, (exp, s) =>
|
|
94
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, newColumnType, newAttrId, tableColIndex));
|
|
95
|
-
|
|
96
|
-
// For INSERT/UPDATE, unqualified column defaults to NEW
|
|
97
|
-
if (operation === 1 || operation === 2) { // INSERT or UPDATE
|
|
98
|
-
constraintScope.registerSymbol(colNameLower, (exp, s) =>
|
|
99
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, newColumnType, newAttrId, tableColIndex));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Register OLD.col
|
|
104
|
-
const oldAttrId = oldAttrIdByCol[colNameLower];
|
|
105
|
-
if (oldAttrId !== undefined) {
|
|
106
|
-
const oldColumnType = {
|
|
107
|
-
typeClass: 'scalar' as const,
|
|
108
|
-
logicalType: tableColumn.logicalType,
|
|
109
|
-
nullable: true, // OLD values can be NULL (especially for INSERT)
|
|
110
|
-
isReadOnly: false
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// OLD.column
|
|
114
|
-
constraintScope.registerSymbol(`old.${colNameLower}`, (exp, s) =>
|
|
115
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, oldColumnType, oldAttrId, tableColIndex));
|
|
116
|
-
|
|
117
|
-
// For DELETE, unqualified column defaults to OLD
|
|
118
|
-
if (operation === 4) { // DELETE
|
|
119
|
-
constraintScope.registerSymbol(colNameLower, (exp, s) =>
|
|
120
|
-
new ColumnReferenceNode(s, exp as AST.ColumnExpr, oldColumnType, oldAttrId, tableColIndex));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// Build the constraint expression using the specialized scope
|
|
126
|
-
// Temporarily set the current schema to match the table's schema
|
|
127
|
-
// This ensures unqualified table references in CHECK constraints resolve correctly
|
|
128
|
-
const originalCurrentSchema = ctx.schemaManager.getCurrentSchemaName();
|
|
129
|
-
const needsSchemaSwitch = tableSchema.schemaName !== originalCurrentSchema;
|
|
130
|
-
|
|
131
|
-
if (needsSchemaSwitch) {
|
|
132
|
-
ctx.schemaManager.setCurrentSchema(tableSchema.schemaName);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
try {
|
|
136
|
-
const expression = buildExpression(
|
|
137
|
-
{ ...ctx, scope: constraintScope },
|
|
138
|
-
constraint.expr
|
|
139
|
-
) as ScalarPlanNode;
|
|
140
|
-
|
|
141
|
-
// Validate that the constraint expression is deterministic
|
|
142
|
-
const constraintName = constraint.name ?? `_check_${tableSchema.name}`;
|
|
143
|
-
validateDeterministicConstraint(expression, constraintName, tableSchema.name);
|
|
144
|
-
|
|
145
|
-
// Heuristic: auto-defer if the expression contains a subquery
|
|
146
|
-
// or references a different relation via attribute bindings (NEW/OLD already localized).
|
|
147
|
-
const needsDeferred = containsSubquery(expression);
|
|
148
|
-
|
|
149
|
-
return {
|
|
150
|
-
constraint,
|
|
151
|
-
expression,
|
|
152
|
-
deferrable: needsDeferred,
|
|
153
|
-
initiallyDeferred: needsDeferred,
|
|
154
|
-
containsSubquery: needsDeferred
|
|
155
|
-
} satisfies ConstraintCheck;
|
|
156
|
-
} finally {
|
|
157
|
-
// Restore original schema context
|
|
158
|
-
if (needsSchemaSwitch) {
|
|
159
|
-
ctx.schemaManager.setCurrentSchema(originalCurrentSchema);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function containsSubquery(expr: ScalarPlanNode): boolean {
|
|
166
|
-
const stack: ScalarPlanNode[] = [expr];
|
|
167
|
-
while (stack.length) {
|
|
168
|
-
const n = stack.pop()!;
|
|
169
|
-
if (n.nodeType === PlanNodeType.ScalarSubquery || n.nodeType === PlanNodeType.Exists) {
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
for (const c of n.getChildren()) {
|
|
173
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
|
-
stack.push(c as any);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
2
|
-
import type * as AST from '../../parser/ast.js';
|
|
3
|
-
import { CreateAssertionNode } from '../nodes/create-assertion-node.js';
|
|
4
|
-
|
|
5
|
-
export function buildCreateAssertionStmt(ctx: PlanningContext, stmt: AST.CreateAssertionStmt): CreateAssertionNode {
|
|
6
|
-
return new CreateAssertionNode(ctx.scope, stmt.name, stmt.check);
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type * as AST from '../../parser/ast.js';
|
|
2
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
3
|
-
import { CreateViewNode } from '../nodes/create-view-node.js';
|
|
4
|
-
import { createViewToString } from '../../util/ast-stringify.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Builds a plan node for CREATE VIEW statements.
|
|
8
|
-
*/
|
|
9
|
-
export function buildCreateViewStmt(ctx: PlanningContext, stmt: AST.CreateViewStmt): CreateViewNode {
|
|
10
|
-
// Extract schema and view name
|
|
11
|
-
const schemaName = stmt.view.schema || 'main';
|
|
12
|
-
const viewName = stmt.view.name;
|
|
13
|
-
|
|
14
|
-
// The original SQL text is needed for the view definition
|
|
15
|
-
// Reconstruct it from the AST using the proper stringifier
|
|
16
|
-
const sql = createViewToString(stmt);
|
|
17
|
-
|
|
18
|
-
return new CreateViewNode(
|
|
19
|
-
ctx.scope,
|
|
20
|
-
viewName,
|
|
21
|
-
schemaName,
|
|
22
|
-
stmt.ifNotExists,
|
|
23
|
-
stmt.columns,
|
|
24
|
-
stmt.select,
|
|
25
|
-
sql
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type * as AST from '../../parser/ast.js';
|
|
2
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
3
|
-
import { CreateTableNode } from '../nodes/create-table-node.js';
|
|
4
|
-
import { CreateIndexNode } from '../nodes/create-index-node.js';
|
|
5
|
-
|
|
6
|
-
export function buildCreateTableStmt(
|
|
7
|
-
context: PlanningContext,
|
|
8
|
-
stmt: AST.CreateTableStmt,
|
|
9
|
-
): CreateTableNode {
|
|
10
|
-
return new CreateTableNode(
|
|
11
|
-
context.scope,
|
|
12
|
-
stmt,
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function buildCreateIndexStmt(
|
|
17
|
-
context: PlanningContext,
|
|
18
|
-
stmt: AST.CreateIndexStmt
|
|
19
|
-
): CreateIndexNode {
|
|
20
|
-
return new CreateIndexNode(
|
|
21
|
-
context.scope,
|
|
22
|
-
stmt
|
|
23
|
-
);
|
|
24
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type * as AST from '../../parser/ast.js';
|
|
2
|
-
import type { PlanningContext } from '../planning-context.js';
|
|
3
|
-
import type { PlanNode } from '../nodes/plan-node.js';
|
|
4
|
-
import { DeclareSchemaNode, DiffSchemaNode, ApplySchemaNode, ExplainSchemaNode } from '../nodes/declarative-schema.js';
|
|
5
|
-
|
|
6
|
-
export function buildDeclareSchemaStmt(ctx: PlanningContext, stmt: AST.DeclareSchemaStmt): PlanNode {
|
|
7
|
-
return new DeclareSchemaNode(ctx.scope, stmt);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function buildDiffSchemaStmt(ctx: PlanningContext, stmt: AST.DiffSchemaStmt): PlanNode {
|
|
11
|
-
return new DiffSchemaNode(ctx.scope, stmt);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function buildApplySchemaStmt(ctx: PlanningContext, stmt: AST.ApplySchemaStmt): PlanNode {
|
|
15
|
-
return new ApplySchemaNode(ctx.scope, stmt);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function buildExplainSchemaStmt(ctx: PlanningContext, stmt: AST.ExplainSchemaStmt): PlanNode {
|
|
19
|
-
return new ExplainSchemaNode(ctx.scope, stmt);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|