@quereus/quereus 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/schema/manager.d.ts.map +1 -1
- package/dist/src/schema/manager.js +19 -18
- 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,38 +0,0 @@
|
|
|
1
|
-
import type { Row } from '../common/types.js';
|
|
2
|
-
import type { RuntimeContext } from '../runtime/types.js';
|
|
3
|
-
import type { RowDescriptor } from '../planner/nodes/plan-node.js';
|
|
4
|
-
import { withRowContextGenerator } from '../runtime/context-helpers.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A reusable async iterable for working table data that can be iterated multiple times.
|
|
8
|
-
* Similar to CachedIterable but for runtime-generated working table data.
|
|
9
|
-
* Used primarily in recursive CTE execution where the working table needs to be
|
|
10
|
-
* accessed multiple times during recursive iterations.
|
|
11
|
-
*/
|
|
12
|
-
export class WorkingTableIterable implements AsyncIterable<Row> {
|
|
13
|
-
constructor(
|
|
14
|
-
private rows: Row[],
|
|
15
|
-
private rctx: RuntimeContext,
|
|
16
|
-
private rowDescriptor: RowDescriptor
|
|
17
|
-
) {}
|
|
18
|
-
|
|
19
|
-
async *[Symbol.asyncIterator](): AsyncIterator<Row> {
|
|
20
|
-
// Convert rows array to async iterable
|
|
21
|
-
async function* rowsIterable(rows: Row[]): AsyncIterable<Row> {
|
|
22
|
-
for (const row of rows) {
|
|
23
|
-
yield row;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Use the helper to manage context
|
|
28
|
-
yield* withRowContextGenerator(
|
|
29
|
-
this.rctx,
|
|
30
|
-
this.rowDescriptor,
|
|
31
|
-
rowsIterable(this.rows),
|
|
32
|
-
async function* (row) {
|
|
33
|
-
yield row;
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modern, type-safe replacement for xBestIndex API
|
|
3
|
-
* Provides better type safety, clearer intent, and extensibility for future optimizations
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
-
import { quereusError } from '../common/errors.js';
|
|
8
|
-
import { StatusCode, type SqlValue } from '../common/types.js';
|
|
9
|
-
import type { LogicalType } from '../types/logical-type.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Constraint operators that can be pushed down to virtual tables
|
|
13
|
-
*/
|
|
14
|
-
export type ConstraintOp = '=' | '>' | '>=' | '<' | '<=' | 'MATCH' | 'LIKE' | 'GLOB' | 'IS NULL' | 'IS NOT NULL' | 'IN' | 'NOT IN';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Column metadata provided to virtual tables for planning
|
|
18
|
-
*/
|
|
19
|
-
export interface ColumnMeta {
|
|
20
|
-
/** Column index in the table */
|
|
21
|
-
index: number;
|
|
22
|
-
/** Column name */
|
|
23
|
-
name: string;
|
|
24
|
-
/** Logical type information */
|
|
25
|
-
type: LogicalType;
|
|
26
|
-
/** Whether this column is part of the primary key */
|
|
27
|
-
isPrimaryKey: boolean;
|
|
28
|
-
/** Whether this column has a unique constraint */
|
|
29
|
-
isUnique: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* A predicate constraint extracted from WHERE clause
|
|
34
|
-
*/
|
|
35
|
-
export interface PredicateConstraint {
|
|
36
|
-
/** Column index this constraint applies to */
|
|
37
|
-
columnIndex: number;
|
|
38
|
-
/** Constraint operator */
|
|
39
|
-
op: ConstraintOp;
|
|
40
|
-
/** Constant value if this is a column-constant comparison */
|
|
41
|
-
value?: SqlValue;
|
|
42
|
-
/** Whether this constraint can be used by the virtual table */
|
|
43
|
-
usable: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Ordering specification for ORDER BY clauses
|
|
48
|
-
*/
|
|
49
|
-
export interface OrderingSpec {
|
|
50
|
-
/** Column index to order by */
|
|
51
|
-
columnIndex: number;
|
|
52
|
-
/** True for descending order, false for ascending */
|
|
53
|
-
desc: boolean;
|
|
54
|
-
/** Whether NULL values should come first or last */
|
|
55
|
-
nullsFirst?: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Request object passed to getBestAccessPlan containing query planning information
|
|
60
|
-
*/
|
|
61
|
-
export interface BestAccessPlanRequest {
|
|
62
|
-
/** Column metadata for the table */
|
|
63
|
-
columns: readonly ColumnMeta[];
|
|
64
|
-
/** Extracted predicate constraints from WHERE clause */
|
|
65
|
-
filters: readonly PredicateConstraint[];
|
|
66
|
-
/** Required ordering that ancestor nodes need (ORDER BY) */
|
|
67
|
-
requiredOrdering?: readonly OrderingSpec[];
|
|
68
|
-
/** LIMIT value known at plan time */
|
|
69
|
-
limit?: number | null;
|
|
70
|
-
/** Estimated rows hint from planner (may be unknown) */
|
|
71
|
-
estimatedRows?: number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Result object returned by getBestAccessPlan describing the chosen query plan
|
|
76
|
-
*/
|
|
77
|
-
export interface BestAccessPlanResult {
|
|
78
|
-
/** Which filters were handled by the virtual table (parallel to filters array) */
|
|
79
|
-
handledFilters: readonly boolean[];
|
|
80
|
-
/** Optional JavaScript filter function for residual predicates */
|
|
81
|
-
residualFilter?: (row: any) => boolean;
|
|
82
|
-
/** Estimated cost in arbitrary virtual CPU units */
|
|
83
|
-
cost: number;
|
|
84
|
-
/** Estimated number of rows this plan will return */
|
|
85
|
-
rows: number | undefined;
|
|
86
|
-
/** Ordering guaranteed by this access plan */
|
|
87
|
-
providesOrdering?: readonly OrderingSpec[];
|
|
88
|
-
/** Name of the index that provides the ordering (if any) */
|
|
89
|
-
orderingIndexName?: string;
|
|
90
|
-
/** Whether this plan guarantees unique rows (helps DISTINCT optimization) */
|
|
91
|
-
isSet?: boolean;
|
|
92
|
-
/** Free-text explanation for debugging */
|
|
93
|
-
explains?: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Builder class for constructing access plan results
|
|
98
|
-
*/
|
|
99
|
-
export class AccessPlanBuilder {
|
|
100
|
-
private result: Partial<BestAccessPlanResult> = {};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Create a full table scan access plan
|
|
104
|
-
*/
|
|
105
|
-
static fullScan(estimatedRows: number): AccessPlanBuilder {
|
|
106
|
-
return new AccessPlanBuilder()
|
|
107
|
-
.setCost(estimatedRows * 1.0) // Sequential scan cost
|
|
108
|
-
.setRows(estimatedRows)
|
|
109
|
-
.setExplanation('Full table scan');
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Create an equality match access plan (index seek)
|
|
114
|
-
*/
|
|
115
|
-
static eqMatch(matchedRows: number, indexCost: number = 0.5): AccessPlanBuilder {
|
|
116
|
-
return new AccessPlanBuilder()
|
|
117
|
-
.setCost(indexCost + matchedRows * 0.3)
|
|
118
|
-
.setRows(matchedRows)
|
|
119
|
-
.setIsSet(matchedRows <= 1)
|
|
120
|
-
.setExplanation('Index equality seek');
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Create a range scan access plan
|
|
125
|
-
*/
|
|
126
|
-
static rangeScan(estimatedRows: number, indexCost: number = 0.3): AccessPlanBuilder {
|
|
127
|
-
return new AccessPlanBuilder()
|
|
128
|
-
.setCost(indexCost + estimatedRows * 0.5)
|
|
129
|
-
.setRows(estimatedRows)
|
|
130
|
-
.setExplanation('Index range scan');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Set the estimated cost of this access plan
|
|
135
|
-
*/
|
|
136
|
-
setCost(cost: number): this {
|
|
137
|
-
this.result.cost = cost;
|
|
138
|
-
return this;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Set the estimated number of rows
|
|
143
|
-
*/
|
|
144
|
-
setRows(rows: number | undefined): this {
|
|
145
|
-
this.result.rows = rows;
|
|
146
|
-
return this;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Set which filters are handled by this plan
|
|
151
|
-
*/
|
|
152
|
-
setHandledFilters(handledFilters: readonly boolean[]): this {
|
|
153
|
-
this.result.handledFilters = handledFilters;
|
|
154
|
-
return this;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Set the ordering provided by this plan
|
|
159
|
-
*/
|
|
160
|
-
setOrdering(ordering: readonly OrderingSpec[]): this {
|
|
161
|
-
this.result.providesOrdering = ordering;
|
|
162
|
-
return this;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Set whether this plan produces unique rows
|
|
167
|
-
*/
|
|
168
|
-
setIsSet(isSet: boolean): this {
|
|
169
|
-
this.result.isSet = isSet;
|
|
170
|
-
return this;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Set an explanation for debugging
|
|
175
|
-
*/
|
|
176
|
-
setExplanation(explanation: string): this {
|
|
177
|
-
this.result.explains = explanation;
|
|
178
|
-
return this;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Set a residual filter function
|
|
183
|
-
*/
|
|
184
|
-
setResidualFilter(filter: (row: any) => boolean): this {
|
|
185
|
-
this.result.residualFilter = filter;
|
|
186
|
-
return this;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Build the final access plan result
|
|
191
|
-
*/
|
|
192
|
-
build(): BestAccessPlanResult {
|
|
193
|
-
// Ensure required fields are set
|
|
194
|
-
if (this.result.cost === undefined) {
|
|
195
|
-
quereusError('Access plan cost must be set', StatusCode.INTERNAL);
|
|
196
|
-
}
|
|
197
|
-
if (this.result.handledFilters === undefined) {
|
|
198
|
-
this.result.handledFilters = [];
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return this.result as BestAccessPlanResult;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Validation function for access plan results
|
|
207
|
-
* Throws if the plan violates basic contracts
|
|
208
|
-
*/
|
|
209
|
-
export function validateAccessPlan(
|
|
210
|
-
request: BestAccessPlanRequest,
|
|
211
|
-
result: BestAccessPlanResult
|
|
212
|
-
): void {
|
|
213
|
-
// Validate handledFilters array length
|
|
214
|
-
if (result.handledFilters.length !== request.filters.length) {
|
|
215
|
-
quereusError(
|
|
216
|
-
`handledFilters length (${result.handledFilters.length}) must match filters length (${request.filters.length})`,
|
|
217
|
-
StatusCode.FORMAT
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// Validate cost is non-negative
|
|
222
|
-
if (result.cost < 0) {
|
|
223
|
-
quereusError(`Access plan cost cannot be negative: ${result.cost}`, StatusCode.INTERNAL);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Validate rows is non-negative if specified
|
|
227
|
-
if (result.rows !== undefined && result.rows < 0) {
|
|
228
|
-
quereusError(`Access plan rows cannot be negative: ${result.rows}`, StatusCode.INTERNAL);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Validate ordering column indexes
|
|
232
|
-
if (result.providesOrdering) {
|
|
233
|
-
for (const order of result.providesOrdering) {
|
|
234
|
-
if (order.columnIndex < 0 || order.columnIndex >= request.columns.length) {
|
|
235
|
-
quereusError(
|
|
236
|
-
`Invalid ordering column index ${order.columnIndex}, must be 0-${request.columns.length - 1}`,
|
|
237
|
-
StatusCode.FORMAT
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
package/src/vtab/connection.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { MaybePromise } from "../common/types.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Generic interface for VirtualTable connections that support transactions.
|
|
5
|
-
* This allows different vtab modules to implement their own connection strategies
|
|
6
|
-
* while providing a consistent interface for transaction operations.
|
|
7
|
-
*/
|
|
8
|
-
export interface VirtualTableConnection {
|
|
9
|
-
/** Unique identifier for this connection */
|
|
10
|
-
readonly connectionId: string;
|
|
11
|
-
|
|
12
|
-
/** Name of the table this connection is associated with */
|
|
13
|
-
readonly tableName: string;
|
|
14
|
-
|
|
15
|
-
// Transaction methods
|
|
16
|
-
/** Begins a transaction on this connection */
|
|
17
|
-
begin(): MaybePromise<void>;
|
|
18
|
-
|
|
19
|
-
/** Commits the current transaction */
|
|
20
|
-
commit(): MaybePromise<void>;
|
|
21
|
-
|
|
22
|
-
/** Rolls back the current transaction */
|
|
23
|
-
rollback(): MaybePromise<void>;
|
|
24
|
-
|
|
25
|
-
/** Creates a savepoint with the given index */
|
|
26
|
-
createSavepoint(index: number): MaybePromise<void>;
|
|
27
|
-
|
|
28
|
-
/** Releases a savepoint with the given index */
|
|
29
|
-
releaseSavepoint(index: number): MaybePromise<void>;
|
|
30
|
-
|
|
31
|
-
/** Rolls back to a savepoint with the given index */
|
|
32
|
-
rollbackToSavepoint(index: number): MaybePromise<void>;
|
|
33
|
-
|
|
34
|
-
/** Disconnects and cleans up this connection */
|
|
35
|
-
disconnect(): MaybePromise<void>;
|
|
36
|
-
}
|
package/src/vtab/filter-info.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { SqlValue } from '../common/types.js';
|
|
2
|
-
import type { IndexConstraint, IndexInfo } from './index-info.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Structure to pass all necessary filter and planning information
|
|
6
|
-
* to a virtual table's xOpen method when cursors are not used.
|
|
7
|
-
*/
|
|
8
|
-
export interface FilterInfo {
|
|
9
|
-
/** The index number chosen by xBestIndex (output of xBestIndex) */
|
|
10
|
-
idxNum: number;
|
|
11
|
-
/** The index string chosen by xBestIndex (output of xBestIndex) */
|
|
12
|
-
idxStr: string | null;
|
|
13
|
-
/** Array of WHERE clause constraints (input to xBestIndex/xOpen) */
|
|
14
|
-
constraints: ReadonlyArray<{ constraint: IndexConstraint, argvIndex: number }>;
|
|
15
|
-
/** Values for ?. argvIndex in constraints (input to xOpen) */
|
|
16
|
-
args: ReadonlyArray<SqlValue>;
|
|
17
|
-
/**
|
|
18
|
-
* The IndexInfo object AFTER xBestIndex has populated its output fields
|
|
19
|
-
* (aConstraintUsage, orderByConsumed, estimatedCost, estimatedRows, idxFlags).
|
|
20
|
-
* This is needed by xOpen to understand how constraints were used by the planner.
|
|
21
|
-
*/
|
|
22
|
-
indexInfoOutput: IndexInfo;
|
|
23
|
-
}
|
package/src/vtab/index-info.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { IndexConstraintOp } from '../common/constants.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Information about a specific constraint in the WHERE clause
|
|
5
|
-
*/
|
|
6
|
-
export interface IndexConstraint {
|
|
7
|
-
/** Column index constrained (0 based) */
|
|
8
|
-
iColumn: number;
|
|
9
|
-
/** Constraint operator (EQ, GT, etc.) */
|
|
10
|
-
op: IndexConstraintOp;
|
|
11
|
-
/** True if the constraint expression is usable */
|
|
12
|
-
usable: boolean;
|
|
13
|
-
/** Internal offset used by Quereus - ignore in xBestIndex */
|
|
14
|
-
iTermOffset?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Information about a term in the ORDER BY clause
|
|
19
|
-
*/
|
|
20
|
-
export interface IndexOrderBy {
|
|
21
|
-
/** Column index */
|
|
22
|
-
iColumn: number;
|
|
23
|
-
/** True for DESC, False for ASC */
|
|
24
|
-
desc: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Usage information for a constraint, filled by xBestIndex
|
|
29
|
-
*/
|
|
30
|
-
export interface IndexConstraintUsage {
|
|
31
|
-
/** If >0, constraint value becomes the (argvIndex-1)-th arg to xFilter */
|
|
32
|
-
argvIndex: number;
|
|
33
|
-
/** If true, Quereus might skip re-checking this constraint */
|
|
34
|
-
omit: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Structure passed to xBestIndex method containing information about
|
|
39
|
-
* WHERE and ORDER BY clauses relevant to the virtual table.
|
|
40
|
-
* The xBestIndex method must fill the output fields to describe the chosen query plan.
|
|
41
|
-
*/
|
|
42
|
-
export interface IndexInfo {
|
|
43
|
-
// --- Inputs ---
|
|
44
|
-
|
|
45
|
-
/** Number of entries in aConstraint */
|
|
46
|
-
nConstraint: number;
|
|
47
|
-
/** Array of WHERE clause constraints */
|
|
48
|
-
aConstraint: ReadonlyArray<IndexConstraint>;
|
|
49
|
-
|
|
50
|
-
/** Number of terms in the ORDER BY clause */
|
|
51
|
-
nOrderBy: number;
|
|
52
|
-
/** Array of ORDER BY terms */
|
|
53
|
-
aOrderBy: ReadonlyArray<IndexOrderBy>;
|
|
54
|
-
|
|
55
|
-
/** Mask of columns used by the statement (bit N set if column N is used) */
|
|
56
|
-
colUsed: bigint;
|
|
57
|
-
|
|
58
|
-
// --- Outputs ---
|
|
59
|
-
|
|
60
|
-
/** Usage details for each constraint */
|
|
61
|
-
aConstraintUsage: IndexConstraintUsage[];
|
|
62
|
-
|
|
63
|
-
/** Number identifying the chosen index strategy (passed to xFilter) */
|
|
64
|
-
idxNum: number;
|
|
65
|
-
/** String identifying the chosen index strategy (passed to xFilter) */
|
|
66
|
-
idxStr: string | null;
|
|
67
|
-
|
|
68
|
-
/** True if output from xFilter/xNext will satisfy ORDER BY */
|
|
69
|
-
orderByConsumed: boolean;
|
|
70
|
-
|
|
71
|
-
/** Estimated cost of this strategy (lower is better) */
|
|
72
|
-
estimatedCost: number;
|
|
73
|
-
/** Estimated number of rows returned by this strategy */
|
|
74
|
-
estimatedRows: bigint;
|
|
75
|
-
|
|
76
|
-
/** Mask of SQLITE_INDEX_SCAN_* flags */
|
|
77
|
-
idxFlags: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** Flags for IndexInfo.idxFlags */
|
|
81
|
-
export enum IndexScanFlags {
|
|
82
|
-
/** Scan visits at most 1 row */
|
|
83
|
-
UNIQUE = 0x0001,
|
|
84
|
-
}
|
package/src/vtab/manifest.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import type { SqlValue } from '../common/types.js';
|
|
3
|
-
import type { FunctionSchema } from '../schema/function.js';
|
|
4
|
-
import type { CollationFunction } from '../util/comparison.js';
|
|
5
|
-
import type { TypePluginInfo } from '../types/plugin-interface.js';
|
|
6
|
-
|
|
7
|
-
// Re-export TypePluginInfo so it can be imported from this module
|
|
8
|
-
export type { TypePluginInfo };
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Configuration setting definition for a plugin
|
|
12
|
-
*/
|
|
13
|
-
export interface PluginSetting {
|
|
14
|
-
key: string; // "path"
|
|
15
|
-
label: string; // "JSON Path"
|
|
16
|
-
type: 'string' | 'number' | 'boolean' | 'select';
|
|
17
|
-
default?: SqlValue;
|
|
18
|
-
options?: SqlValue[]; // for select type
|
|
19
|
-
help?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Virtual table module registration info
|
|
24
|
-
*/
|
|
25
|
-
export interface VTablePluginInfo {
|
|
26
|
-
name: string; // module name for registration
|
|
27
|
-
module: any; // the VirtualTableModule implementation
|
|
28
|
-
auxData?: unknown; // optional auxiliary data
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Function registration info
|
|
33
|
-
*/
|
|
34
|
-
export interface FunctionPluginInfo {
|
|
35
|
-
schema: FunctionSchema; // complete function schema
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Collation registration info
|
|
40
|
-
*/
|
|
41
|
-
export interface CollationPluginInfo {
|
|
42
|
-
name: string; // collation name
|
|
43
|
-
func: CollationFunction; // comparison function
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Plugin registration items - what the plugin wants to register
|
|
48
|
-
*/
|
|
49
|
-
export interface PluginRegistrations {
|
|
50
|
-
vtables?: VTablePluginInfo[];
|
|
51
|
-
functions?: FunctionPluginInfo[];
|
|
52
|
-
collations?: CollationPluginInfo[];
|
|
53
|
-
types?: TypePluginInfo[];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Plugin manifest that describes the plugin's metadata and configuration options
|
|
58
|
-
*/
|
|
59
|
-
export interface PluginManifest {
|
|
60
|
-
name: string; // "JSON_TABLE"
|
|
61
|
-
version: string; // "1.0.0"
|
|
62
|
-
author?: string;
|
|
63
|
-
description?: string;
|
|
64
|
-
pragmaPrefix?: string; // default = name, used for PRAGMA commands
|
|
65
|
-
settings?: PluginSetting[]; // configuration options
|
|
66
|
-
capabilities?: string[]; // e.g. ['scan', 'index', 'write']
|
|
67
|
-
|
|
68
|
-
// Plugin type indicators (for UI display)
|
|
69
|
-
provides?: {
|
|
70
|
-
vtables?: string[]; // names of vtable modules provided
|
|
71
|
-
functions?: string[]; // names of functions provided
|
|
72
|
-
collations?: string[]; // names of collations provided
|
|
73
|
-
types?: string[]; // names of types provided
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Plugin record used for persistence across sessions
|
|
79
|
-
*/
|
|
80
|
-
export interface PluginRecord {
|
|
81
|
-
id: string; // UUID for this installation
|
|
82
|
-
url: string; // Full URL to the ES module
|
|
83
|
-
enabled: boolean; // Whether to load at startup
|
|
84
|
-
manifest?: PluginManifest; // Cached after first successful load
|
|
85
|
-
config: Record<string, SqlValue>; // User-configured values
|
|
86
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { VirtualTableConnection } from '../connection.js';
|
|
2
|
-
import type { MemoryTableConnection } from './layer/connection.js';
|
|
3
|
-
import { createLogger } from '../../common/logger.js';
|
|
4
|
-
|
|
5
|
-
const log = createLogger('vtab:memory:vtab-connection');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* VirtualTableConnection implementation for memory tables.
|
|
9
|
-
* Wraps the existing MemoryTableConnection to provide the generic interface.
|
|
10
|
-
*/
|
|
11
|
-
export class MemoryVirtualTableConnection implements VirtualTableConnection {
|
|
12
|
-
public readonly connectionId: string;
|
|
13
|
-
public readonly tableName: string;
|
|
14
|
-
private memoryConnection: MemoryTableConnection;
|
|
15
|
-
|
|
16
|
-
constructor(tableName: string, memoryConnection: MemoryTableConnection) {
|
|
17
|
-
this.connectionId = `memory-${tableName}-${memoryConnection.connectionId}`;
|
|
18
|
-
this.tableName = tableName;
|
|
19
|
-
this.memoryConnection = memoryConnection;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Begins a transaction on this connection */
|
|
23
|
-
begin(): void {
|
|
24
|
-
log(`BEGIN transaction on connection ${this.connectionId}`);
|
|
25
|
-
this.memoryConnection.begin();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** Commits the current transaction */
|
|
29
|
-
async commit(): Promise<void> {
|
|
30
|
-
log(`COMMIT transaction on connection ${this.connectionId}`);
|
|
31
|
-
await this.memoryConnection.commit();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Rolls back the current transaction */
|
|
35
|
-
rollback(): void {
|
|
36
|
-
log(`ROLLBACK transaction on connection ${this.connectionId}`);
|
|
37
|
-
this.memoryConnection.rollback();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Creates a savepoint with the given index */
|
|
41
|
-
createSavepoint(index: number): void {
|
|
42
|
-
log(`CREATE SAVEPOINT ${index} on connection ${this.connectionId}`);
|
|
43
|
-
this.memoryConnection.createSavepoint(index);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Releases a savepoint with the given index */
|
|
47
|
-
releaseSavepoint(index: number): void {
|
|
48
|
-
log(`RELEASE SAVEPOINT ${index} on connection ${this.connectionId}`);
|
|
49
|
-
this.memoryConnection.releaseSavepoint(index);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Rolls back to a savepoint with the given index */
|
|
53
|
-
rollbackToSavepoint(index: number): void {
|
|
54
|
-
log(`ROLLBACK TO SAVEPOINT ${index} on connection ${this.connectionId}`);
|
|
55
|
-
this.memoryConnection.rollbackToSavepoint(index);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Disconnects and cleans up this connection */
|
|
59
|
-
async disconnect(): Promise<void> {
|
|
60
|
-
log(`DISCONNECT connection ${this.connectionId}`);
|
|
61
|
-
// The MemoryTableConnection doesn't have a disconnect method,
|
|
62
|
-
// but we can clear any pending transaction state
|
|
63
|
-
if (this.memoryConnection.pendingTransactionLayer) {
|
|
64
|
-
log(`Rolling back pending transaction on disconnect for ${this.connectionId}`);
|
|
65
|
-
this.memoryConnection.rollback();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Gets the underlying MemoryTableConnection for internal use */
|
|
70
|
-
getMemoryConnection(): MemoryTableConnection {
|
|
71
|
-
return this.memoryConnection;
|
|
72
|
-
}
|
|
73
|
-
}
|