@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,198 +0,0 @@
|
|
|
1
|
-
import type { DmlExecutorNode } from '../../planner/nodes/dml-executor-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun, OutputValue } from '../types.js';
|
|
3
|
-
import { emitPlanNode, emitCallFromPlan } from '../emitters.js';
|
|
4
|
-
import { QuereusError } from '../../common/errors.js';
|
|
5
|
-
import { StatusCode, type Row, type SqlValue } from '../../common/types.js';
|
|
6
|
-
import { getVTable, disconnectVTable } from '../utils.js';
|
|
7
|
-
import { ConflictResolution } from '../../common/constants.js';
|
|
8
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
9
|
-
import { extractOldRowFromFlat, extractNewRowFromFlat } from '../../util/row-descriptor.js';
|
|
10
|
-
import { buildInsertStatement, buildUpdateStatement, buildDeleteStatement } from '../../util/mutation-statement.js';
|
|
11
|
-
import type { UpdateArgs } from '../../vtab/table.js';
|
|
12
|
-
|
|
13
|
-
export function emitDmlExecutor(plan: DmlExecutorNode, ctx: EmissionContext): Instruction {
|
|
14
|
-
const tableSchema = plan.table.tableSchema;
|
|
15
|
-
|
|
16
|
-
// Pre-calculate primary key column indices from schema (needed for update/delete)
|
|
17
|
-
const pkColumnIndicesInSchema = tableSchema.primaryKeyDefinition.map(pkColDef => pkColDef.index);
|
|
18
|
-
|
|
19
|
-
// Emit mutation context evaluators if present
|
|
20
|
-
const contextEvaluatorInstructions: Instruction[] = [];
|
|
21
|
-
if (plan.mutationContextValues && plan.contextAttributes) {
|
|
22
|
-
for (const attr of plan.contextAttributes) {
|
|
23
|
-
const valueNode = plan.mutationContextValues.get(attr.name);
|
|
24
|
-
if (!valueNode) {
|
|
25
|
-
throw new QuereusError(`Missing mutation context value for '${attr.name}'`, StatusCode.INTERNAL);
|
|
26
|
-
}
|
|
27
|
-
const instruction = emitCallFromPlan(valueNode, ctx);
|
|
28
|
-
contextEvaluatorInstructions.push(instruction);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// --- Operation-specific run generators ------------------------------------
|
|
33
|
-
|
|
34
|
-
// INSERT ----------------------------------------------------
|
|
35
|
-
async function* runInsert(ctx: RuntimeContext, rows: AsyncIterable<Row>, ...contextEvaluators: Array<(ctx: RuntimeContext) => OutputValue>): AsyncIterable<Row> {
|
|
36
|
-
const vtab = await getVTable(ctx, tableSchema);
|
|
37
|
-
|
|
38
|
-
// Evaluate mutation context once per statement
|
|
39
|
-
let contextRow: Row | undefined;
|
|
40
|
-
if (contextEvaluators.length > 0) {
|
|
41
|
-
contextRow = [];
|
|
42
|
-
for (const evaluator of contextEvaluators) {
|
|
43
|
-
const value = await evaluator(ctx) as SqlValue;
|
|
44
|
-
contextRow.push(value);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
for await (const flatRow of rows) {
|
|
50
|
-
const newRow = extractNewRowFromFlat(flatRow, tableSchema.columns.length);
|
|
51
|
-
|
|
52
|
-
// Build mutation statement if logging is enabled
|
|
53
|
-
let mutationStatement: string | undefined;
|
|
54
|
-
if (vtab.wantStatements) {
|
|
55
|
-
mutationStatement = buildInsertStatement(tableSchema, newRow, contextRow);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const args: UpdateArgs = {
|
|
59
|
-
operation: 'insert',
|
|
60
|
-
values: newRow,
|
|
61
|
-
oldKeyValues: undefined,
|
|
62
|
-
onConflict: plan.onConflict ?? ConflictResolution.ABORT,
|
|
63
|
-
mutationStatement
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
await vtab.update!(args);
|
|
67
|
-
|
|
68
|
-
// Track change (INSERT): record NEW primary key
|
|
69
|
-
const pkValues = tableSchema.primaryKeyDefinition.map(def => newRow[def.index]);
|
|
70
|
-
ctx.db._recordInsert(`${tableSchema.schemaName}.${tableSchema.name}`, pkValues);
|
|
71
|
-
yield flatRow; // make OLD/NEW available downstream (e.g. RETURNING)
|
|
72
|
-
}
|
|
73
|
-
} finally {
|
|
74
|
-
await disconnectVTable(ctx, vtab);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// UPDATE ----------------------------------------------------
|
|
79
|
-
async function* runUpdate(ctx: RuntimeContext, rows: AsyncIterable<Row>, ...contextEvaluators: Array<(ctx: RuntimeContext) => OutputValue>): AsyncIterable<Row> {
|
|
80
|
-
const vtab = await getVTable(ctx, tableSchema);
|
|
81
|
-
|
|
82
|
-
// Evaluate mutation context once per statement
|
|
83
|
-
let contextRow: Row | undefined;
|
|
84
|
-
if (contextEvaluators.length > 0) {
|
|
85
|
-
contextRow = [];
|
|
86
|
-
for (const evaluator of contextEvaluators) {
|
|
87
|
-
const value = await evaluator(ctx) as SqlValue;
|
|
88
|
-
contextRow.push(value);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
for await (const flatRow of rows) {
|
|
94
|
-
const oldRow = extractOldRowFromFlat(flatRow, tableSchema.columns.length);
|
|
95
|
-
const newRow = extractNewRowFromFlat(flatRow, tableSchema.columns.length);
|
|
96
|
-
|
|
97
|
-
// Extract primary key values from the OLD row (these identify which row to update)
|
|
98
|
-
const keyValues: SqlValue[] = pkColumnIndicesInSchema.map(pkColIdx => {
|
|
99
|
-
if (pkColIdx >= oldRow.length) {
|
|
100
|
-
throw new QuereusError(`PK column index ${pkColIdx} out of bounds for OLD row length ${oldRow.length} in UPDATE on '${tableSchema.name}'.`, StatusCode.INTERNAL);
|
|
101
|
-
}
|
|
102
|
-
return oldRow[pkColIdx];
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Build mutation statement if logging is enabled
|
|
106
|
-
let mutationStatement: string | undefined;
|
|
107
|
-
if (vtab.wantStatements) {
|
|
108
|
-
mutationStatement = buildUpdateStatement(tableSchema, newRow, keyValues, contextRow);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const args: UpdateArgs = {
|
|
112
|
-
operation: 'update',
|
|
113
|
-
values: newRow,
|
|
114
|
-
oldKeyValues: keyValues,
|
|
115
|
-
onConflict: ConflictResolution.ABORT,
|
|
116
|
-
mutationStatement
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
await vtab.update!(args);
|
|
120
|
-
|
|
121
|
-
// Track change (UPDATE): record OLD and NEW primary keys
|
|
122
|
-
const newKeyValues: SqlValue[] = tableSchema.primaryKeyDefinition.map(pkColDef => newRow[pkColDef.index]);
|
|
123
|
-
ctx.db._recordUpdate(`${tableSchema.schemaName}.${tableSchema.name}`, keyValues, newKeyValues);
|
|
124
|
-
yield flatRow;
|
|
125
|
-
}
|
|
126
|
-
} finally {
|
|
127
|
-
await disconnectVTable(ctx, vtab);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// DELETE ----------------------------------------------------
|
|
132
|
-
async function* runDelete(ctx: RuntimeContext, rows: AsyncIterable<Row>, ...contextEvaluators: Array<(ctx: RuntimeContext) => OutputValue>): AsyncIterable<Row> {
|
|
133
|
-
const vtab = await getVTable(ctx, tableSchema);
|
|
134
|
-
|
|
135
|
-
// Evaluate mutation context once per statement
|
|
136
|
-
let contextRow: Row | undefined;
|
|
137
|
-
if (contextEvaluators.length > 0) {
|
|
138
|
-
contextRow = [];
|
|
139
|
-
for (const evaluator of contextEvaluators) {
|
|
140
|
-
const value = await evaluator(ctx) as SqlValue;
|
|
141
|
-
contextRow.push(value);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
try {
|
|
146
|
-
for await (const flatRow of rows) {
|
|
147
|
-
const oldRow = extractOldRowFromFlat(flatRow, tableSchema.columns.length);
|
|
148
|
-
|
|
149
|
-
const keyValues: SqlValue[] = pkColumnIndicesInSchema.map(pkColIdx => {
|
|
150
|
-
if (pkColIdx >= oldRow.length) {
|
|
151
|
-
throw new QuereusError(`PK column index ${pkColIdx} out of bounds for OLD row length ${oldRow.length} in DELETE on '${tableSchema.name}'.`, StatusCode.INTERNAL);
|
|
152
|
-
}
|
|
153
|
-
return oldRow[pkColIdx];
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Build mutation statement if logging is enabled
|
|
157
|
-
let mutationStatement: string | undefined;
|
|
158
|
-
if (vtab.wantStatements) {
|
|
159
|
-
mutationStatement = buildDeleteStatement(tableSchema, keyValues, contextRow);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const args: UpdateArgs = {
|
|
163
|
-
operation: 'delete',
|
|
164
|
-
values: undefined,
|
|
165
|
-
oldKeyValues: keyValues,
|
|
166
|
-
onConflict: ConflictResolution.ABORT,
|
|
167
|
-
mutationStatement
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
await vtab.update!(args);
|
|
171
|
-
|
|
172
|
-
// Track change (DELETE): record OLD primary key
|
|
173
|
-
ctx.db._recordDelete(`${tableSchema.schemaName}.${tableSchema.name}`, keyValues);
|
|
174
|
-
yield flatRow;
|
|
175
|
-
}
|
|
176
|
-
} finally {
|
|
177
|
-
await disconnectVTable(ctx, vtab);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Select the correct generator based on operation
|
|
182
|
-
let run: InstructionRun;
|
|
183
|
-
switch (plan.operation) {
|
|
184
|
-
case 'insert': run = runInsert as InstructionRun; break;
|
|
185
|
-
case 'update': run = runUpdate as InstructionRun; break;
|
|
186
|
-
case 'delete': run = runDelete as InstructionRun; break;
|
|
187
|
-
default:
|
|
188
|
-
throw new QuereusError(`Unknown DML operation: ${plan.operation}`, StatusCode.INTERNAL);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const sourceInstruction = emitPlanNode(plan.source, ctx);
|
|
192
|
-
|
|
193
|
-
return {
|
|
194
|
-
params: [sourceInstruction, ...contextEvaluatorInstructions],
|
|
195
|
-
run,
|
|
196
|
-
note: `execute${plan.operation}(${plan.table.tableSchema.name})`
|
|
197
|
-
};
|
|
198
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { DropAssertionNode } from '../../planner/nodes/drop-assertion-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun } from '../types.js';
|
|
3
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
4
|
-
import { QuereusError } from '../../common/errors.js';
|
|
5
|
-
import { SqlValue, StatusCode } from '../../common/types.js';
|
|
6
|
-
import { createLogger } from '../../common/logger.js';
|
|
7
|
-
|
|
8
|
-
const log = createLogger('runtime:emit:drop-assertion');
|
|
9
|
-
|
|
10
|
-
export function emitDropAssertion(plan: DropAssertionNode, _ctx: EmissionContext): Instruction {
|
|
11
|
-
|
|
12
|
-
async function run(rctx: RuntimeContext): Promise<SqlValue> {
|
|
13
|
-
const schemaManager = rctx.db.schemaManager;
|
|
14
|
-
const schema = schemaManager.getMainSchema(); // Look in main schema for now
|
|
15
|
-
|
|
16
|
-
const existing = schema.getAssertion(plan.name);
|
|
17
|
-
if (!existing) {
|
|
18
|
-
if (plan.ifExists) {
|
|
19
|
-
log('Assertion %s not found, but IF EXISTS specified', plan.name);
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
throw new QuereusError(
|
|
23
|
-
`Assertion ${plan.name} not found`,
|
|
24
|
-
StatusCode.NOTFOUND
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const removed = schema.removeAssertion(plan.name);
|
|
29
|
-
if (!removed && !plan.ifExists) {
|
|
30
|
-
throw new QuereusError(
|
|
31
|
-
`Failed to remove assertion ${plan.name}`,
|
|
32
|
-
StatusCode.INTERNAL
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
log('Dropped assertion %s', plan.name);
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
params: [],
|
|
42
|
-
run: run as InstructionRun,
|
|
43
|
-
note: `dropAssertion(${plan.name})`
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { DropTableNode } from '../../planner/nodes/drop-table-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun } from '../types.js';
|
|
3
|
-
import { QuereusError } from '../../common/errors.js';
|
|
4
|
-
import { StatusCode, type SqlValue } from '../../common/types.js';
|
|
5
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
6
|
-
|
|
7
|
-
export function emitDropTable(plan: DropTableNode, ctx: EmissionContext): Instruction {
|
|
8
|
-
const schemaManager = ctx.db.schemaManager;
|
|
9
|
-
const stmt = plan.statementAst; // AST.DropStmt
|
|
10
|
-
|
|
11
|
-
const targetSchemaName = stmt.name.schema || schemaManager.getCurrentSchemaName();
|
|
12
|
-
const objectName = stmt.name.name;
|
|
13
|
-
|
|
14
|
-
if (stmt.objectType !== 'table') {
|
|
15
|
-
// This emitter is specifically for DROP TABLE.
|
|
16
|
-
// DROP VIEW, DROP INDEX would need their own PlanNodes and emitters, or a more generic DDL DropNode.
|
|
17
|
-
throw new QuereusError(`DROP for object type '${stmt.objectType}' is not supported by emitDropTable.`, StatusCode.UNSUPPORTED);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function run(rctx: RuntimeContext): Promise<SqlValue | undefined> {
|
|
21
|
-
await rctx.db.schemaManager.dropTable(targetSchemaName, objectName, stmt.ifExists);
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return { params: [], run: run as InstructionRun };
|
|
27
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { DropViewNode } from '../../planner/nodes/drop-view-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext } from '../types.js';
|
|
3
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
4
|
-
import { QuereusError } from '../../common/errors.js';
|
|
5
|
-
import { StatusCode, type SqlValue } from '../../common/types.js';
|
|
6
|
-
|
|
7
|
-
export function emitDropView(plan: DropViewNode, _ctx: EmissionContext): Instruction {
|
|
8
|
-
async function run(rctx: RuntimeContext): Promise<SqlValue> {
|
|
9
|
-
// Check if view exists
|
|
10
|
-
const existingView = rctx.db.schemaManager.getView(plan.schemaName, plan.viewName);
|
|
11
|
-
|
|
12
|
-
if (!existingView && !plan.ifExists) {
|
|
13
|
-
throw new QuereusError(
|
|
14
|
-
`View '${plan.schemaName}.${plan.viewName}' does not exist`,
|
|
15
|
-
StatusCode.ERROR
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!existingView && plan.ifExists) {
|
|
20
|
-
// View doesn't exist but IF EXISTS was specified, so this is a no-op
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Remove the view from the schema manager
|
|
25
|
-
const schema = rctx.db.schemaManager.getSchema(plan.schemaName);
|
|
26
|
-
if (!schema) {
|
|
27
|
-
throw new QuereusError(
|
|
28
|
-
`Schema '${plan.schemaName}' does not exist`,
|
|
29
|
-
StatusCode.ERROR
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const removed = schema.removeView(plan.viewName);
|
|
34
|
-
if (!removed && !plan.ifExists) {
|
|
35
|
-
throw new QuereusError(
|
|
36
|
-
`View '${plan.schemaName}.${plan.viewName}' does not exist`,
|
|
37
|
-
StatusCode.ERROR
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return null; // Explicitly return null for successful void operations
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
params: [],
|
|
46
|
-
run,
|
|
47
|
-
note: `dropView(${plan.schemaName}.${plan.viewName})`
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { FilterNode } from '../../planner/nodes/filter.js';
|
|
2
|
-
import type { Instruction, InstructionRun, RuntimeContext } from '../types.js';
|
|
3
|
-
import { emitPlanNode, emitCallFromPlan } from '../emitters.js';
|
|
4
|
-
import { OutputValue, type Row } from '../../common/types.js';
|
|
5
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
6
|
-
import { buildRowDescriptor } from '../../util/row-descriptor.js';
|
|
7
|
-
import { withRowContextGenerator } from '../context-helpers.js';
|
|
8
|
-
|
|
9
|
-
export function emitFilter(plan: FilterNode, ctx: EmissionContext): Instruction {
|
|
10
|
-
const sourceInstruction = emitPlanNode(plan.source, ctx);
|
|
11
|
-
const predicateFunc = emitCallFromPlan(plan.predicate, ctx);
|
|
12
|
-
|
|
13
|
-
// Create row descriptor for source attributes
|
|
14
|
-
const sourceRowDescriptor = buildRowDescriptor(plan.source.getAttributes());
|
|
15
|
-
|
|
16
|
-
async function* run(ctx: RuntimeContext, source: AsyncIterable<Row>, predicate: (ctx: RuntimeContext) => OutputValue): AsyncIterable<Row> {
|
|
17
|
-
yield* withRowContextGenerator(ctx, sourceRowDescriptor, source, async function* (sourceRow) {
|
|
18
|
-
const result = await predicate(ctx);
|
|
19
|
-
if (result) {
|
|
20
|
-
yield sourceRow;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
params: [sourceInstruction, predicateFunc],
|
|
27
|
-
run: run as InstructionRun,
|
|
28
|
-
note: `filter(${plan.predicate.toString()})`
|
|
29
|
-
};
|
|
30
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { InsertNode } from '../../planner/nodes/insert-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun } from '../types.js';
|
|
3
|
-
import { emitPlanNode } from '../emitters.js';
|
|
4
|
-
import type { Row } from '../../common/types.js';
|
|
5
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
6
|
-
|
|
7
|
-
export function emitInsert(plan: InsertNode, ctx: EmissionContext): Instruction {
|
|
8
|
-
// INSERT node now only handles data transformations and passes flat rows through.
|
|
9
|
-
// The actual database insert operations are handled by DmlExecutorNode.
|
|
10
|
-
// Type conversion is handled by the table manager's validateAndParse in performInsert.
|
|
11
|
-
async function* run(_ctx: RuntimeContext, sourceValue: AsyncIterable<Row>): AsyncIterable<Row> {
|
|
12
|
-
const tableSchema = plan.table.tableSchema;
|
|
13
|
-
const colCount = tableSchema.columns.length;
|
|
14
|
-
|
|
15
|
-
for await (const sourceRow of sourceValue) {
|
|
16
|
-
// Convert source row to flat OLD/NEW format
|
|
17
|
-
// For INSERT: OLD values are all NULL, NEW values are from source
|
|
18
|
-
const flatRow: Row = new Array(colCount * 2);
|
|
19
|
-
|
|
20
|
-
// Fill OLD section with NULLs (indices 0..n-1)
|
|
21
|
-
for (let i = 0; i < colCount; i++) {
|
|
22
|
-
flatRow[i] = null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Fill NEW section with source values (indices n..2n-1)
|
|
26
|
-
// No affinity conversion here - let the type system handle it
|
|
27
|
-
for (let colIdx = 0; colIdx < colCount; colIdx++) {
|
|
28
|
-
flatRow[colCount + colIdx] = sourceRow[colIdx];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
yield flatRow;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const sourceInstruction = emitPlanNode(plan.source, ctx);
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
params: [sourceInstruction],
|
|
39
|
-
run: run as InstructionRun,
|
|
40
|
-
note: `insertPrep(${plan.table.tableSchema.name})`
|
|
41
|
-
};
|
|
42
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Row } from '../../common/types.js';
|
|
2
|
-
import type { InternalRecursiveCTERefNode } from '../../planner/nodes/internal-recursive-cte-ref-node.js';
|
|
3
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
4
|
-
import { createValidatedInstruction } from '../emitters.js';
|
|
5
|
-
import type { Instruction, RuntimeContext } from '../types.js';
|
|
6
|
-
import { QuereusError } from '../../common/errors.js';
|
|
7
|
-
import { StatusCode } from '../../common/types.js';
|
|
8
|
-
import { buildRowDescriptor } from '../../util/row-descriptor.js';
|
|
9
|
-
import { withRowContextGenerator } from '../context-helpers.js';
|
|
10
|
-
|
|
11
|
-
export function emitInternalRecursiveCTERef(plan: InternalRecursiveCTERefNode, ctx: EmissionContext): Instruction {
|
|
12
|
-
// Create row descriptor for output attributes
|
|
13
|
-
const rowDescriptor = buildRowDescriptor(plan.getAttributes());
|
|
14
|
-
|
|
15
|
-
async function* run(rctx: RuntimeContext): AsyncIterable<Row> {
|
|
16
|
-
// Look up the working table from runtime context using the tableDescriptor
|
|
17
|
-
const tableGetter = rctx.tableContexts.get(plan.workingTableDescriptor);
|
|
18
|
-
if (!tableGetter) {
|
|
19
|
-
throw new QuereusError(
|
|
20
|
-
`Internal recursive CTE '${plan.cteName}' working table not found in context`,
|
|
21
|
-
StatusCode.INTERNAL
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Execute the working table and yield each row
|
|
26
|
-
yield* withRowContextGenerator(rctx, rowDescriptor, tableGetter(), async function* (row) {
|
|
27
|
-
yield row;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return createValidatedInstruction(
|
|
32
|
-
[], // No instruction parameters - data comes from table context
|
|
33
|
-
run,
|
|
34
|
-
ctx,
|
|
35
|
-
`internal_recursive_ref(${plan.cteName}${plan.alias ? ` AS ${plan.alias}` : ''})`
|
|
36
|
-
);
|
|
37
|
-
}
|
package/src/runtime/emit/join.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import type { JoinNode } from '../../planner/nodes/join-node.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun } from '../types.js';
|
|
3
|
-
import { emitCallFromPlan, emitPlanNode } from '../emitters.js';
|
|
4
|
-
import type { Row, OutputValue } from '../../common/types.js';
|
|
5
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
6
|
-
import { createLogger } from '../../common/logger.js';
|
|
7
|
-
import { compareSqlValues } from '../../util/comparison.js';
|
|
8
|
-
import { buildRowDescriptor } from '../../util/row-descriptor.js';
|
|
9
|
-
import { createRowSlot } from '../context-helpers.js';
|
|
10
|
-
import type { Attribute } from '../../planner/nodes/plan-node.js';
|
|
11
|
-
|
|
12
|
-
const log = createLogger('runtime:emit:join');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Emits a nested loop join instruction.
|
|
16
|
-
* This is a simple nested loop implementation that can handle all join types.
|
|
17
|
-
*/
|
|
18
|
-
export function emitLoopJoin(plan: JoinNode, ctx: EmissionContext): Instruction {
|
|
19
|
-
// Create row descriptors for left and right inputs
|
|
20
|
-
const leftAttributes = plan.left.getAttributes();
|
|
21
|
-
const leftRowDescriptor = buildRowDescriptor(leftAttributes);
|
|
22
|
-
|
|
23
|
-
const rightAttributes = plan.right.getAttributes();
|
|
24
|
-
const rightRowDescriptor = buildRowDescriptor(rightAttributes);
|
|
25
|
-
|
|
26
|
-
// NOTE: rightSource must be re-startable (optimizer facilitates through cache node)
|
|
27
|
-
async function* run(rctx: RuntimeContext, leftSource: AsyncIterable<Row>, rightCallback: (ctx: RuntimeContext) => AsyncIterable<Row>, conditionCallback?: (ctx: RuntimeContext) => OutputValue): AsyncIterable<Row> {
|
|
28
|
-
const joinType = plan.joinType;
|
|
29
|
-
|
|
30
|
-
log('Starting %s join between %d left attrs and %d right attrs',
|
|
31
|
-
joinType.toUpperCase(), leftAttributes.length, rightAttributes.length);
|
|
32
|
-
|
|
33
|
-
// Create row slots for efficient context management
|
|
34
|
-
const leftSlot = createRowSlot(rctx, leftRowDescriptor);
|
|
35
|
-
const rightSlot = createRowSlot(rctx, rightRowDescriptor);
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
// Process left side and join with right (pure streaming)
|
|
39
|
-
for await (const leftRow of leftSource) {
|
|
40
|
-
// Set up left context
|
|
41
|
-
leftSlot.set(leftRow);
|
|
42
|
-
|
|
43
|
-
let leftMatched = false;
|
|
44
|
-
|
|
45
|
-
// Stream through right side for each left row
|
|
46
|
-
for await (const rightRow of rightCallback(rctx)) {
|
|
47
|
-
// Set up right context
|
|
48
|
-
rightSlot.set(rightRow);
|
|
49
|
-
|
|
50
|
-
// Evaluate join condition
|
|
51
|
-
let conditionMet = true;
|
|
52
|
-
|
|
53
|
-
if (conditionCallback) {
|
|
54
|
-
// Evaluate the join condition using the callback provided by scheduler
|
|
55
|
-
const conditionResult = await conditionCallback(rctx);
|
|
56
|
-
conditionMet = !!conditionResult; // Convert to boolean
|
|
57
|
-
} else if (plan.usingColumns) {
|
|
58
|
-
// Handle USING condition: check equality of specified columns
|
|
59
|
-
conditionMet = evaluateUsingCondition(leftRow, rightRow, plan.usingColumns, leftAttributes, rightAttributes);
|
|
60
|
-
} else if (joinType === 'cross') {
|
|
61
|
-
// Cross join - always true
|
|
62
|
-
conditionMet = true;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (conditionMet) {
|
|
66
|
-
leftMatched = true;
|
|
67
|
-
yield [...leftRow, ...rightRow] as Row;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Handle outer join semantics - null padding for unmatched left rows
|
|
72
|
-
if (!leftMatched && (joinType === 'left' || joinType === 'full')) {
|
|
73
|
-
// Create null-padded row for left outer join
|
|
74
|
-
const nullPadding = new Array(rightAttributes.length).fill(null);
|
|
75
|
-
const outputRow = [...leftRow, ...nullPadding] as Row;
|
|
76
|
-
yield outputRow;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Handle right outer join semantics - we need to track which right rows were matched
|
|
81
|
-
// For now, we'll handle this in a simpler way by iterating again for right/full outer joins
|
|
82
|
-
if (joinType === 'right' || joinType === 'full') {
|
|
83
|
-
// For right outer joins, we need to find unmatched right rows
|
|
84
|
-
// This is more complex and less efficient - a real implementation would track matches
|
|
85
|
-
// For now, we'll implement a simplified version
|
|
86
|
-
log('Right/full outer join - checking for unmatched right rows');
|
|
87
|
-
|
|
88
|
-
// We'd need to track which right rows were matched during the main loop
|
|
89
|
-
// For now, we'll skip this implementation detail
|
|
90
|
-
// TODO: Implement proper right outer join semantics
|
|
91
|
-
}
|
|
92
|
-
} finally {
|
|
93
|
-
leftSlot.close();
|
|
94
|
-
rightSlot.close();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const leftInstruction = emitPlanNode(plan.left, ctx);
|
|
99
|
-
const rightInstruction = emitCallFromPlan(plan.right, ctx);
|
|
100
|
-
|
|
101
|
-
// Build the params array - include condition callback if present
|
|
102
|
-
const params = [leftInstruction, rightInstruction];
|
|
103
|
-
if (plan.condition) {
|
|
104
|
-
const conditionInstruction = emitCallFromPlan(plan.condition, ctx);
|
|
105
|
-
params.push(conditionInstruction);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return {
|
|
109
|
-
params,
|
|
110
|
-
run: run as InstructionRun,
|
|
111
|
-
note: `${plan.joinType} join (nested loop)`
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Evaluates USING condition by comparing specified columns from left and right rows
|
|
117
|
-
*/
|
|
118
|
-
function evaluateUsingCondition(
|
|
119
|
-
leftRow: Row,
|
|
120
|
-
rightRow: Row,
|
|
121
|
-
usingColumns: readonly string[],
|
|
122
|
-
leftAttributes: readonly Attribute[],
|
|
123
|
-
rightAttributes: readonly Attribute[]
|
|
124
|
-
): boolean {
|
|
125
|
-
for (const columnName of usingColumns) {
|
|
126
|
-
const leftColName = columnName.toLowerCase();
|
|
127
|
-
const rightColName = columnName.toLowerCase();
|
|
128
|
-
|
|
129
|
-
// Find column indices in left and right
|
|
130
|
-
const leftIndex = leftAttributes.findIndex(attr => attr.name.toLowerCase() === leftColName);
|
|
131
|
-
const rightIndex = rightAttributes.findIndex(attr => attr.name.toLowerCase() === rightColName);
|
|
132
|
-
|
|
133
|
-
if (leftIndex === -1 || rightIndex === -1) {
|
|
134
|
-
// Column not found - should not happen if planner is correct
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const leftValue = leftRow[leftIndex];
|
|
139
|
-
const rightValue = rightRow[rightIndex];
|
|
140
|
-
|
|
141
|
-
// Compare using SQL semantics
|
|
142
|
-
if (compareSqlValues(leftValue, rightValue) !== 0) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return true; // All USING columns match
|
|
148
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { LimitOffsetNode } from '../../planner/nodes/limit-offset.js';
|
|
2
|
-
import type { Instruction, RuntimeContext, InstructionRun } from '../types.js';
|
|
3
|
-
import { emitPlanNode, emitCallFromPlan } from '../emitters.js';
|
|
4
|
-
import { type SqlValue, type Row, MaybePromise } from '../../common/types.js';
|
|
5
|
-
import type { EmissionContext } from '../emission-context.js';
|
|
6
|
-
|
|
7
|
-
export function emitLimitOffset(plan: LimitOffsetNode, ctx: EmissionContext): Instruction {
|
|
8
|
-
async function* run(
|
|
9
|
-
ctx: RuntimeContext,
|
|
10
|
-
sourceRows: AsyncIterable<Row>,
|
|
11
|
-
...args: Array<(ctx: RuntimeContext) => MaybePromise<SqlValue>>
|
|
12
|
-
): AsyncIterable<Row> {
|
|
13
|
-
// Determine which args we have
|
|
14
|
-
let limitFn: ((ctx: RuntimeContext) => MaybePromise<SqlValue>) | undefined;
|
|
15
|
-
let offsetFn: ((ctx: RuntimeContext) => MaybePromise<SqlValue>) | undefined;
|
|
16
|
-
|
|
17
|
-
let argIndex = 0;
|
|
18
|
-
if (plan.limit) {
|
|
19
|
-
limitFn = args[argIndex++];
|
|
20
|
-
}
|
|
21
|
-
if (plan.offset) {
|
|
22
|
-
offsetFn = args[argIndex++];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Evaluate limit and offset
|
|
26
|
-
const limitValue = limitFn ? await limitFn(ctx) : null;
|
|
27
|
-
const offsetValue = offsetFn ? await offsetFn(ctx) : null;
|
|
28
|
-
|
|
29
|
-
// Convert to numbers, with defaults
|
|
30
|
-
let limit = limitValue !== null ? Number(limitValue) : Infinity;
|
|
31
|
-
let offset = offsetValue !== null ? Number(offsetValue) : 0;
|
|
32
|
-
|
|
33
|
-
// Validate values
|
|
34
|
-
if (limit < 0 || !Number.isFinite(limit)) {
|
|
35
|
-
limit = 0; // No rows if limit is negative or invalid
|
|
36
|
-
}
|
|
37
|
-
if (offset < 0 || !Number.isFinite(offset)) {
|
|
38
|
-
offset = 0; // No offset if negative or invalid
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Skip offset rows
|
|
42
|
-
let skipped = 0;
|
|
43
|
-
let emitted = 0;
|
|
44
|
-
|
|
45
|
-
for await (const row of sourceRows) {
|
|
46
|
-
if (skipped < offset) {
|
|
47
|
-
skipped++;
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (emitted >= limit) {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
yield row;
|
|
56
|
-
emitted++;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const sourceInstruction = emitPlanNode(plan.source, ctx);
|
|
61
|
-
const limitInstruction = plan.limit ? emitCallFromPlan(plan.limit, ctx) : undefined;
|
|
62
|
-
const offsetInstruction = plan.offset ? emitCallFromPlan(plan.offset, ctx) : undefined;
|
|
63
|
-
|
|
64
|
-
const params: Instruction[] = [sourceInstruction];
|
|
65
|
-
if (limitInstruction) params.push(limitInstruction);
|
|
66
|
-
if (offsetInstruction) params.push(offsetInstruction);
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
params,
|
|
70
|
-
run: run as InstructionRun,
|
|
71
|
-
note: `limit_offset(${plan.limit ? 'LIMIT' : ''}${plan.limit && plan.offset ? ',' : ''}${plan.offset ? 'OFFSET' : ''})`
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { MaybePromise, SqlValue } from "../../common/types.js";
|
|
2
|
-
import type { Instruction, InstructionRun, RuntimeContext } from "../types.js";
|
|
3
|
-
import type { LiteralNode } from "../../planner/nodes/scalar.js";
|
|
4
|
-
import { safeJsonStringify } from "../../util/serialization.js";
|
|
5
|
-
import type { EmissionContext } from "../emission-context.js";
|
|
6
|
-
|
|
7
|
-
export function emitLiteral(plan: LiteralNode, _ctx: EmissionContext): Instruction {
|
|
8
|
-
function run(_rctx: RuntimeContext): MaybePromise<SqlValue> {
|
|
9
|
-
return plan.expression.value;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
params: [],
|
|
14
|
-
run: run as InstructionRun,
|
|
15
|
-
note: `literal(${safeJsonStringify(plan.expression.value)})`
|
|
16
|
-
};
|
|
17
|
-
}
|