@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
package/src/runtime/types.ts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import type { RuntimeValue, SqlParameters, OutputValue, Row } from "../common/types.js";
|
|
2
|
-
import type { Database } from "../core/database.js";
|
|
3
|
-
import type { Statement } from "../core/statement.js";
|
|
4
|
-
import type { RowDescriptor, RowGetter, TableDescriptor, TableGetter } from "../planner/nodes/plan-node.js";
|
|
5
|
-
import type { Scheduler } from "./scheduler.js";
|
|
6
|
-
import type { EmissionContext } from "./emission-context.js";
|
|
7
|
-
import type { VirtualTableConnection } from "../vtab/connection.js";
|
|
8
|
-
import type { PlanNode } from '../planner/nodes/plan-node.js';
|
|
9
|
-
|
|
10
|
-
// Re-export types from common/types.js for convenience
|
|
11
|
-
export type { OutputValue };
|
|
12
|
-
|
|
13
|
-
export type RuntimeContext = {
|
|
14
|
-
db: Database;
|
|
15
|
-
stmt: Statement | undefined; // Undefined for transient exec statements
|
|
16
|
-
params: SqlParameters; // User-provided values for the current execution
|
|
17
|
-
/** Row contexts by row descriptor */
|
|
18
|
-
context: Map<RowDescriptor, RowGetter>;
|
|
19
|
-
/** Table contexts by table name, used for recursive CTEs or other temporary table situations */
|
|
20
|
-
tableContexts: Map<TableDescriptor, TableGetter>;
|
|
21
|
-
/** Debug tracer for instruction execution, if enabled */
|
|
22
|
-
tracer?: InstructionTracer;
|
|
23
|
-
/** Active connection for the current transaction context */
|
|
24
|
-
activeConnection?: VirtualTableConnection;
|
|
25
|
-
/** Whether to collect runtime execution metrics */
|
|
26
|
-
enableMetrics: boolean;
|
|
27
|
-
/** Context tracking for debugging context leaks */
|
|
28
|
-
contextTracker?: ContextTracker;
|
|
29
|
-
/** Stack of currently executing plan nodes (only when tracing enabled) */
|
|
30
|
-
planStack?: PlanNode[];
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type InstructionRun = (ctx: RuntimeContext, ...args: RuntimeValue[]) => OutputValue;
|
|
34
|
-
|
|
35
|
-
export type Instruction = {
|
|
36
|
-
params: Instruction[];
|
|
37
|
-
run: InstructionRun;
|
|
38
|
-
/** Optional human-readable note about what this instruction does */
|
|
39
|
-
note?: string;
|
|
40
|
-
/** Optional sub-programs used to execute this instruction - this is here for tracing purposes */
|
|
41
|
-
programs?: Scheduler[];
|
|
42
|
-
/** Optional emission context for schema validation */
|
|
43
|
-
emissionContext?: EmissionContext;
|
|
44
|
-
/** Optional runtime statistics collected during execution */
|
|
45
|
-
runtimeStats?: InstructionRuntimeStats;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Runtime statistics for instruction execution
|
|
50
|
-
*/
|
|
51
|
-
export interface InstructionRuntimeStats {
|
|
52
|
-
/** Number of input values/rows processed */
|
|
53
|
-
in: number;
|
|
54
|
-
/** Number of output values/rows produced */
|
|
55
|
-
out: number;
|
|
56
|
-
/** Total execution time in nanoseconds */
|
|
57
|
-
elapsedNs: bigint;
|
|
58
|
-
/** Number of times this instruction was executed */
|
|
59
|
-
executions: number;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** * Trace event for instruction execution. */
|
|
63
|
-
export interface InstructionTraceEvent {
|
|
64
|
-
instructionIndex: number;
|
|
65
|
-
note?: string;
|
|
66
|
-
type: 'input' | 'output' | 'row' | 'error';
|
|
67
|
-
timestamp: number;
|
|
68
|
-
args?: RuntimeValue[];
|
|
69
|
-
result?: OutputValue;
|
|
70
|
-
error?: string;
|
|
71
|
-
/** Information about sub-programs if this instruction has any */
|
|
72
|
-
subPrograms?: SubProgramInfo[];
|
|
73
|
-
/** Row index within the async iterable (for 'row' type events) */
|
|
74
|
-
rowIndex?: number;
|
|
75
|
-
/** Row data (for 'row' type events) */
|
|
76
|
-
row?: Row;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Information about a sub-program for tracing purposes */
|
|
80
|
-
export interface SubProgramInfo {
|
|
81
|
-
programIndex: number;
|
|
82
|
-
instructionCount: number;
|
|
83
|
-
rootNote?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** * Interface for tracing instruction execution. */
|
|
87
|
-
export interface InstructionTracer {
|
|
88
|
-
/** Called before an instruction executes */
|
|
89
|
-
traceInput(instructionIndex: number, instruction: Instruction, args: RuntimeValue[]): void;
|
|
90
|
-
/** Called after an instruction executes */
|
|
91
|
-
traceOutput(instructionIndex: number, instruction: Instruction, result: OutputValue): void;
|
|
92
|
-
/** Called when an instruction throws an error */
|
|
93
|
-
traceError(instructionIndex: number, instruction: Instruction, error: Error): void;
|
|
94
|
-
/** Called for each row emitted by an async iterable instruction */
|
|
95
|
-
traceRow(instructionIndex: number, instruction: Instruction, rowIndex: number, row: Row): void;
|
|
96
|
-
/** Gets collected trace events (if supported by the tracer) */
|
|
97
|
-
getTraceEvents?(): InstructionTraceEvent[];
|
|
98
|
-
/** Gets information about all sub-programs encountered during tracing */
|
|
99
|
-
getSubPrograms?(): Map<number, { scheduler: Scheduler; parentInstructionIndex: number }>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** * Tracer that collects execution events for later analysis. */
|
|
103
|
-
export class CollectingInstructionTracer implements InstructionTracer {
|
|
104
|
-
private events: InstructionTraceEvent[] = [];
|
|
105
|
-
private subPrograms = new Map<number, { scheduler: Scheduler; parentInstructionIndex: number }>();
|
|
106
|
-
private nextSubProgramId = 0;
|
|
107
|
-
|
|
108
|
-
traceInput(instructionIndex: number, instruction: Instruction, args: RuntimeValue[]): void {
|
|
109
|
-
const subPrograms = this.collectSubProgramInfo(instructionIndex, instruction);
|
|
110
|
-
|
|
111
|
-
this.events.push({
|
|
112
|
-
instructionIndex,
|
|
113
|
-
note: instruction.note,
|
|
114
|
-
type: 'input',
|
|
115
|
-
timestamp: Date.now(),
|
|
116
|
-
args: this.cloneArgs(args),
|
|
117
|
-
subPrograms
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
traceOutput(instructionIndex: number, instruction: Instruction, result: OutputValue): void {
|
|
122
|
-
this.events.push({
|
|
123
|
-
instructionIndex,
|
|
124
|
-
note: instruction.note,
|
|
125
|
-
type: 'output',
|
|
126
|
-
timestamp: Date.now(),
|
|
127
|
-
result: this.cloneResult(result)
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
traceError(instructionIndex: number, instruction: Instruction, error: Error): void {
|
|
132
|
-
this.events.push({
|
|
133
|
-
instructionIndex,
|
|
134
|
-
note: instruction.note,
|
|
135
|
-
type: 'error',
|
|
136
|
-
timestamp: Date.now(),
|
|
137
|
-
error: error.message
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
traceRow(instructionIndex: number, instruction: Instruction, rowIndex: number, row: Row): void {
|
|
142
|
-
this.events.push({
|
|
143
|
-
instructionIndex,
|
|
144
|
-
note: instruction.note,
|
|
145
|
-
type: 'row',
|
|
146
|
-
timestamp: Date.now(),
|
|
147
|
-
rowIndex,
|
|
148
|
-
row
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
getTraceEvents(): InstructionTraceEvent[] {
|
|
153
|
-
return [...this.events];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
getSubPrograms(): Map<number, { scheduler: Scheduler; parentInstructionIndex: number }> {
|
|
157
|
-
return new Map(this.subPrograms);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
clear(): void {
|
|
161
|
-
this.events = [];
|
|
162
|
-
this.subPrograms.clear();
|
|
163
|
-
this.nextSubProgramId = 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
private collectSubProgramInfo(instructionIndex: number, instruction: Instruction): SubProgramInfo[] | undefined {
|
|
167
|
-
if (!instruction.programs || instruction.programs.length === 0) {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return instruction.programs.map(scheduler => {
|
|
172
|
-
const programId = this.nextSubProgramId++;
|
|
173
|
-
this.subPrograms.set(programId, { scheduler, parentInstructionIndex: instructionIndex });
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
programIndex: programId,
|
|
177
|
-
instructionCount: scheduler.instructions.length,
|
|
178
|
-
rootNote: scheduler.instructions[scheduler.instructions.length - 1]?.note
|
|
179
|
-
};
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
private cloneArgs(args: RuntimeValue[]): RuntimeValue[] {
|
|
184
|
-
return args.map(arg => this.cloneValue(arg));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
private cloneResult(result: OutputValue): OutputValue {
|
|
188
|
-
if (result instanceof Promise) {
|
|
189
|
-
return result.then(resolved => this.cloneValue(resolved as RuntimeValue));
|
|
190
|
-
}
|
|
191
|
-
return this.cloneValue(result as RuntimeValue);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
private cloneValue(value: RuntimeValue): RuntimeValue {
|
|
195
|
-
if (value === null || value === undefined) return value;
|
|
196
|
-
if (typeof value === 'function') return '[Function]';
|
|
197
|
-
if (typeof value === 'object' && value && Symbol.asyncIterator in value) return '[AsyncIterable]';
|
|
198
|
-
if (Array.isArray(value)) return value.map(v => this.cloneValue(v as RuntimeValue)) as RuntimeValue;
|
|
199
|
-
if (typeof value === 'object') return '[Object]';
|
|
200
|
-
return value as RuntimeValue;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Tracks context additions and removals for debugging context leaks
|
|
206
|
-
*/
|
|
207
|
-
export interface ContextTracker {
|
|
208
|
-
/** Record that a context was added */
|
|
209
|
-
addContext(descriptor: RowDescriptor, source: string): void;
|
|
210
|
-
/** Record that a context was removed */
|
|
211
|
-
removeContext(descriptor: RowDescriptor): void;
|
|
212
|
-
/** Get all remaining contexts with their sources */
|
|
213
|
-
getRemainingContexts(): Array<{ descriptor: RowDescriptor; source: string }>;
|
|
214
|
-
/** Check if there are any remaining contexts */
|
|
215
|
-
hasRemainingContexts(): boolean;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Default implementation of ContextTracker
|
|
220
|
-
*/
|
|
221
|
-
export class DefaultContextTracker implements ContextTracker {
|
|
222
|
-
private contexts = new Map<RowDescriptor, string>();
|
|
223
|
-
|
|
224
|
-
addContext(descriptor: RowDescriptor, source: string): void {
|
|
225
|
-
this.contexts.set(descriptor, source);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
removeContext(descriptor: RowDescriptor): void {
|
|
229
|
-
this.contexts.delete(descriptor);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
getRemainingContexts(): Array<{ descriptor: RowDescriptor; source: string }> {
|
|
233
|
-
return Array.from(this.contexts.entries()).map(([descriptor, source]) => ({
|
|
234
|
-
descriptor,
|
|
235
|
-
source
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
hasRemainingContexts(): boolean {
|
|
240
|
-
return this.contexts.size > 0;
|
|
241
|
-
}
|
|
242
|
-
}
|
package/src/runtime/utils.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { QuereusError } from '../common/errors.js';
|
|
3
|
-
import { StatusCode } from '../common/types.js';
|
|
4
|
-
import type { TableSchema } from '../schema/table.js';
|
|
5
|
-
import type { VirtualTable } from '../vtab/table.js';
|
|
6
|
-
import type { RuntimeContext } from './types.js';
|
|
7
|
-
import type { VirtualTableConnection } from '../vtab/connection.js';
|
|
8
|
-
import { createLogger } from '../common/logger.js';
|
|
9
|
-
import type { MemoryVirtualTableConnection } from '../vtab/memory/connection.js';
|
|
10
|
-
import type { MemoryTable } from '../vtab/memory/table.js';
|
|
11
|
-
import type { RowDescriptor, Attribute } from '../planner/nodes/plan-node.js';
|
|
12
|
-
|
|
13
|
-
const log = createLogger('runtime:utils');
|
|
14
|
-
const errorLog = log.extend('error');
|
|
15
|
-
export const ctxLog = createLogger('runtime:context');
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Check if a value is an AsyncIterable.
|
|
19
|
-
*
|
|
20
|
-
* NOTE: Hermes (React Native's JS engine) has a bug where AsyncGenerator objects
|
|
21
|
-
* don't have Symbol.asyncIterator as an own or inherited property, even though
|
|
22
|
-
* they are valid async iterables. We work around this by also checking for
|
|
23
|
-
* the presence of a .next() method (duck typing for async iterators).
|
|
24
|
-
*/
|
|
25
|
-
export function isAsyncIterable<T>(value: unknown): value is AsyncIterable<T> {
|
|
26
|
-
if (typeof value !== 'object' || value === null) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
// Standard check: Symbol.asyncIterator
|
|
30
|
-
if (Symbol.asyncIterator in value) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
// Hermes workaround: AsyncGenerator has .next() but not Symbol.asyncIterator
|
|
34
|
-
const maybeAsyncGen = value as { next?: unknown; constructor?: { name?: string } };
|
|
35
|
-
if (typeof maybeAsyncGen.next === 'function' &&
|
|
36
|
-
maybeAsyncGen.constructor?.name === 'AsyncGenerator') {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get an AsyncIterator from an AsyncIterable, handling Hermes's missing Symbol.asyncIterator.
|
|
44
|
-
*
|
|
45
|
-
* @throws TypeError if value is not a valid async iterable
|
|
46
|
-
*/
|
|
47
|
-
export function getAsyncIterator<T>(value: AsyncIterable<T>): AsyncIterator<T> {
|
|
48
|
-
// Standard path: use Symbol.asyncIterator
|
|
49
|
-
if (Symbol.asyncIterator in value) {
|
|
50
|
-
return value[Symbol.asyncIterator]();
|
|
51
|
-
}
|
|
52
|
-
// Hermes workaround: AsyncGenerator is its own iterator
|
|
53
|
-
const maybeAsyncGen = value as unknown as { next?: () => Promise<IteratorResult<T>>; constructor?: { name?: string } };
|
|
54
|
-
if (typeof maybeAsyncGen.next === 'function' &&
|
|
55
|
-
maybeAsyncGen.constructor?.name === 'AsyncGenerator') {
|
|
56
|
-
return maybeAsyncGen as AsyncIterator<T>;
|
|
57
|
-
}
|
|
58
|
-
throw new TypeError('Value is not async iterable');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export async function asyncIterableToArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {
|
|
62
|
-
const result: T[] = [];
|
|
63
|
-
for await (const item of iterable) {
|
|
64
|
-
result.push(item);
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Helper to get or create a VirtualTable connection for a given table.
|
|
71
|
-
* This ensures transaction consistency by reusing connections within the same context.
|
|
72
|
-
*/
|
|
73
|
-
export async function getVTableConnection(ctx: RuntimeContext, tableSchema: TableSchema): Promise<VirtualTableConnection> {
|
|
74
|
-
const tableName = tableSchema.name; // Use just the table name, not fully qualified
|
|
75
|
-
|
|
76
|
-
// Check if we already have an active connection for this table
|
|
77
|
-
const existingConnections = ctx.db.getConnectionsForTable(tableName);
|
|
78
|
-
if (existingConnections.length > 0) {
|
|
79
|
-
log(`Reusing existing connection for table ${tableName}`);
|
|
80
|
-
return existingConnections[0];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Create a new VirtualTable instance
|
|
84
|
-
const vtab = await getVTable(ctx, tableSchema);
|
|
85
|
-
|
|
86
|
-
// Try to create a connection if the table supports it
|
|
87
|
-
let connection: VirtualTableConnection;
|
|
88
|
-
if (vtab.createConnection) {
|
|
89
|
-
connection = await vtab.createConnection();
|
|
90
|
-
log(`Created new connection ${connection.connectionId} for table ${tableName}`);
|
|
91
|
-
} else if (vtab.getConnection) {
|
|
92
|
-
const existingConn = vtab.getConnection();
|
|
93
|
-
if (existingConn) {
|
|
94
|
-
connection = existingConn;
|
|
95
|
-
log(`Using existing internal connection ${connection.connectionId} for table ${tableName}`);
|
|
96
|
-
} else {
|
|
97
|
-
throw new QuereusError(`Table '${tableName}' does not support connections`, StatusCode.INTERNAL);
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
throw new QuereusError(`Table '${tableName}' does not support connections`, StatusCode.INTERNAL);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Register the connection with the database
|
|
104
|
-
await ctx.db.registerConnection(connection);
|
|
105
|
-
|
|
106
|
-
// Set as the active connection in the runtime context if none is set
|
|
107
|
-
if (!ctx.activeConnection) {
|
|
108
|
-
ctx.activeConnection = connection;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return connection;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Helper to get the VirtualTable instance for a given TableReferenceNode.
|
|
116
|
-
* This is the legacy method that creates ephemeral instances.
|
|
117
|
-
* When reusing connections, this will also inject the existing connection into the VirtualTable.
|
|
118
|
-
*/
|
|
119
|
-
export async function getVTable(ctx: RuntimeContext, tableSchema: TableSchema): Promise<VirtualTable> {
|
|
120
|
-
// All tables are virtual, so vtabModuleName should always be present.
|
|
121
|
-
if (!tableSchema.vtabModuleName) {
|
|
122
|
-
throw new QuereusError(`Table schema for '${tableSchema.name}' is missing vtabModuleName.`, StatusCode.INTERNAL);
|
|
123
|
-
}
|
|
124
|
-
const moduleInfo = ctx.db._getVtabModule(tableSchema.vtabModuleName);
|
|
125
|
-
if (!moduleInfo) {
|
|
126
|
-
throw new QuereusError(`Virtual table module '${tableSchema.vtabModuleName}' not found for table '${tableSchema.name}'`, StatusCode.ERROR);
|
|
127
|
-
}
|
|
128
|
-
const module = moduleInfo.module;
|
|
129
|
-
if (typeof module.connect !== 'function') {
|
|
130
|
-
throw new QuereusError(`Virtual table module '${tableSchema.vtabModuleName}' does not implement connect`, StatusCode.MISUSE);
|
|
131
|
-
}
|
|
132
|
-
const vtabArgs = tableSchema.vtabArgs || {};
|
|
133
|
-
const vtabInstance = module.connect(ctx.db, moduleInfo.auxData, tableSchema.vtabModuleName, tableSchema.schemaName, tableSchema.name, vtabArgs);
|
|
134
|
-
|
|
135
|
-
// If we have an active connection for this table, inject it into the VirtualTable
|
|
136
|
-
const tableName = tableSchema.name;
|
|
137
|
-
const existingConnections = ctx.db.getConnectionsForTable(tableName);
|
|
138
|
-
if (existingConnections.length > 0 && tableSchema.vtabModuleName === 'memory') {
|
|
139
|
-
const memoryConnection = existingConnections[0] as MemoryVirtualTableConnection;
|
|
140
|
-
const memoryTable = vtabInstance as MemoryTable;
|
|
141
|
-
if (memoryConnection.getMemoryConnection && memoryTable.setConnection) {
|
|
142
|
-
memoryTable.setConnection(memoryConnection.getMemoryConnection());
|
|
143
|
-
log(`Injected existing connection into VirtualTable for table ${tableName}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return vtabInstance;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Helper to properly disconnect and unregister a VirtualTable instance.
|
|
152
|
-
*/
|
|
153
|
-
export async function disconnectVTable(ctx: RuntimeContext, vtab: VirtualTable): Promise<void> {
|
|
154
|
-
// Disconnect the VirtualTable instance
|
|
155
|
-
if (typeof vtab.disconnect === 'function') {
|
|
156
|
-
await vtab.disconnect().catch((e: any) => {
|
|
157
|
-
errorLog(`Error during disconnect for table '${vtab.tableName}': ${e}`);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Helper function to log context push operations
|
|
164
|
-
*/
|
|
165
|
-
export function logContextPush(descriptor: RowDescriptor, note: string, attributes?: readonly Attribute[]) {
|
|
166
|
-
const attrs = Object.keys(descriptor).filter(k => descriptor[parseInt(k)] !== undefined);
|
|
167
|
-
const attrNames = attributes ? attributes.map(attr => `${attr.name}(#${attr.id})`).join(',') : 'unknown';
|
|
168
|
-
ctxLog('PUSH context %s: attrs=[%s] names=[%s]', note, attrs.join(','), attrNames);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Helper function to log context pop operations
|
|
173
|
-
*/
|
|
174
|
-
export function logContextPop(descriptor: RowDescriptor, note: string) {
|
|
175
|
-
const attrs = Object.keys(descriptor).filter(k => descriptor[parseInt(k)] !== undefined);
|
|
176
|
-
ctxLog('POP context %s: attrs=[%s]', note, attrs.join(','));
|
|
177
|
-
}
|
package/src/schema/assertion.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface AssertionDependentTable {
|
|
2
|
-
/** Instance-unique table reference key, e.g. schema.table#nodeId */
|
|
3
|
-
relationKey: string;
|
|
4
|
-
/** Base table identifier, e.g. schema.table */
|
|
5
|
-
base: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IntegrityAssertionSchema {
|
|
9
|
-
/** Unique assertion name */
|
|
10
|
-
name: string;
|
|
11
|
-
/** SQL text of the violation-producing query. Any returned row indicates a violation. */
|
|
12
|
-
violationSql: string;
|
|
13
|
-
/** Whether the assertion is deferrable. Currently always enforced at COMMIT. */
|
|
14
|
-
deferrable: boolean;
|
|
15
|
-
/** If true, initially deferred. Currently informational. */
|
|
16
|
-
initiallyDeferred: boolean;
|
|
17
|
-
/** Base tables referenced; filled during assertion preparation/creation. */
|
|
18
|
-
dependentTables?: AssertionDependentTable[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
package/src/schema/catalog.ts
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import type { Database } from '../core/database.js';
|
|
2
|
-
import type { TableSchema, IndexSchema } from './table.js';
|
|
3
|
-
import type { ViewSchema } from './view.js';
|
|
4
|
-
import type { IntegrityAssertionSchema } from './assertion.js';
|
|
5
|
-
import { createTableToString, createViewToString, createIndexToString } from '../util/ast-stringify.js';
|
|
6
|
-
import type * as AST from '../parser/ast.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Represents a catalog snapshot of the current database schema state
|
|
10
|
-
*/
|
|
11
|
-
export interface SchemaCatalog {
|
|
12
|
-
schemaName: string;
|
|
13
|
-
tables: CatalogTable[];
|
|
14
|
-
views: CatalogView[];
|
|
15
|
-
indexes: CatalogIndex[];
|
|
16
|
-
assertions: CatalogAssertion[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CatalogTable {
|
|
20
|
-
name: string;
|
|
21
|
-
ddl: string;
|
|
22
|
-
columns: Array<{ name: string; type: string; notNull: boolean; primaryKey: boolean }>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface CatalogView {
|
|
26
|
-
name: string;
|
|
27
|
-
ddl: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CatalogIndex {
|
|
31
|
-
name: string;
|
|
32
|
-
tableName: string;
|
|
33
|
-
ddl: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface CatalogAssertion {
|
|
37
|
-
name: string;
|
|
38
|
-
ddl: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Collects current schema state from the database into a catalog representation
|
|
43
|
-
*/
|
|
44
|
-
export function collectSchemaCatalog(db: Database, schemaName: string = 'main'): SchemaCatalog {
|
|
45
|
-
const schema = db.schemaManager.getSchema(schemaName);
|
|
46
|
-
if (!schema) {
|
|
47
|
-
return {
|
|
48
|
-
schemaName,
|
|
49
|
-
tables: [],
|
|
50
|
-
views: [],
|
|
51
|
-
indexes: [],
|
|
52
|
-
assertions: []
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const tables: CatalogTable[] = [];
|
|
57
|
-
const views: CatalogView[] = [];
|
|
58
|
-
const indexes: CatalogIndex[] = [];
|
|
59
|
-
const assertions: CatalogAssertion[] = [];
|
|
60
|
-
|
|
61
|
-
// Collect tables
|
|
62
|
-
for (const tableSchema of schema.getAllTables()) {
|
|
63
|
-
if (!tableSchema.isView) {
|
|
64
|
-
tables.push(tableSchemaToCatalog(tableSchema));
|
|
65
|
-
|
|
66
|
-
// Collect indexes for this table
|
|
67
|
-
if (tableSchema.indexes && tableSchema.indexes.length > 0) {
|
|
68
|
-
for (const indexSchema of tableSchema.indexes) {
|
|
69
|
-
indexes.push({
|
|
70
|
-
name: indexSchema.name,
|
|
71
|
-
tableName: tableSchema.name,
|
|
72
|
-
ddl: generateIndexDDL(indexSchema, tableSchema)
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Collect views
|
|
80
|
-
for (const viewSchema of schema.getAllViews()) {
|
|
81
|
-
views.push(viewSchemaToCatalog(viewSchema));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Collect assertions
|
|
85
|
-
for (const assertionSchema of schema.getAllAssertions()) {
|
|
86
|
-
assertions.push(assertionSchemaToCatalog(assertionSchema));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
schemaName,
|
|
91
|
-
tables,
|
|
92
|
-
views,
|
|
93
|
-
indexes,
|
|
94
|
-
assertions
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function tableSchemaToCatalog(tableSchema: TableSchema): CatalogTable {
|
|
99
|
-
// Generate canonical DDL from TableSchema
|
|
100
|
-
const ddl = generateTableDDL(tableSchema);
|
|
101
|
-
|
|
102
|
-
const columns = tableSchema.columns.map(col => ({
|
|
103
|
-
name: col.name,
|
|
104
|
-
type: col.logicalType.name,
|
|
105
|
-
notNull: col.notNull,
|
|
106
|
-
primaryKey: col.primaryKey
|
|
107
|
-
}));
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
name: tableSchema.name,
|
|
111
|
-
ddl,
|
|
112
|
-
columns
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function viewSchemaToCatalog(viewSchema: ViewSchema): CatalogView {
|
|
117
|
-
return {
|
|
118
|
-
name: viewSchema.name,
|
|
119
|
-
ddl: viewSchema.sql
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function assertionSchemaToCatalog(assertionSchema: IntegrityAssertionSchema): CatalogAssertion {
|
|
124
|
-
return {
|
|
125
|
-
name: assertionSchema.name,
|
|
126
|
-
ddl: `CREATE ASSERTION ${assertionSchema.name} CHECK (${assertionSchema.violationSql})`
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Generates canonical DDL for an index from its schema
|
|
132
|
-
*/
|
|
133
|
-
function generateIndexDDL(indexSchema: IndexSchema, tableSchema: TableSchema): string {
|
|
134
|
-
// Convert IndexSchema back to AST CreateIndexStmt for stringification
|
|
135
|
-
const indexStmt: AST.CreateIndexStmt = {
|
|
136
|
-
type: 'createIndex',
|
|
137
|
-
index: { type: 'identifier', name: indexSchema.name },
|
|
138
|
-
table: { type: 'identifier', name: tableSchema.name },
|
|
139
|
-
ifNotExists: false,
|
|
140
|
-
isUnique: false,
|
|
141
|
-
columns: indexSchema.columns.map(col => ({
|
|
142
|
-
name: tableSchema.columns[col.index].name,
|
|
143
|
-
expr: undefined,
|
|
144
|
-
collation: col.collation,
|
|
145
|
-
direction: col.desc ? 'desc' : 'asc'
|
|
146
|
-
}))
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
return createIndexToString(indexStmt);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Generates canonical DDL for a table from its schema
|
|
154
|
-
*/
|
|
155
|
-
function generateTableDDL(tableSchema: TableSchema): string {
|
|
156
|
-
const parts: string[] = ['CREATE TABLE'];
|
|
157
|
-
|
|
158
|
-
if (tableSchema.isTemporary) {
|
|
159
|
-
parts.push('TEMP');
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
parts.push(`"${tableSchema.name}"`);
|
|
163
|
-
|
|
164
|
-
// Generate column definitions
|
|
165
|
-
const columnDefs: string[] = [];
|
|
166
|
-
for (const col of tableSchema.columns) {
|
|
167
|
-
let colDef = `"${col.name}"`;
|
|
168
|
-
if (col.logicalType) {
|
|
169
|
-
colDef += ` ${col.logicalType.name}`;
|
|
170
|
-
}
|
|
171
|
-
if (col.notNull) {
|
|
172
|
-
colDef += ' NOT NULL';
|
|
173
|
-
}
|
|
174
|
-
if (col.primaryKey && tableSchema.primaryKeyDefinition.length === 1) {
|
|
175
|
-
colDef += ' PRIMARY KEY';
|
|
176
|
-
}
|
|
177
|
-
columnDefs.push(colDef);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Add table-level PRIMARY KEY if composite
|
|
181
|
-
if (tableSchema.primaryKeyDefinition.length > 1) {
|
|
182
|
-
const pkCols = tableSchema.primaryKeyDefinition
|
|
183
|
-
.map(pk => `"${tableSchema.columns[pk.index].name}"`)
|
|
184
|
-
.join(', ');
|
|
185
|
-
columnDefs.push(`PRIMARY KEY (${pkCols})`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
parts.push(`(${columnDefs.join(', ')})`);
|
|
189
|
-
|
|
190
|
-
// Add USING clause
|
|
191
|
-
if (tableSchema.vtabModuleName) {
|
|
192
|
-
parts.push(`USING ${tableSchema.vtabModuleName}`);
|
|
193
|
-
if (tableSchema.vtabArgs && Object.keys(tableSchema.vtabArgs).length > 0) {
|
|
194
|
-
const args = Object.entries(tableSchema.vtabArgs)
|
|
195
|
-
.map(([key, value]) => `${key} = ${JSON.stringify(value)}`)
|
|
196
|
-
.join(', ');
|
|
197
|
-
parts.push(`(${args})`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return parts.join(' ');
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Generates canonical DDL from a declared schema AST
|
|
206
|
-
*/
|
|
207
|
-
export function generateDeclaredDDL(declaredSchema: AST.DeclareSchemaStmt, targetSchema?: string): string[] {
|
|
208
|
-
const ddlStatements: string[] = [];
|
|
209
|
-
|
|
210
|
-
for (const item of declaredSchema.items) {
|
|
211
|
-
switch (item.type) {
|
|
212
|
-
case 'declaredTable': {
|
|
213
|
-
// Qualify table name with schema if specified
|
|
214
|
-
const tableStmt = item.tableStmt;
|
|
215
|
-
if (targetSchema && targetSchema !== 'main' && !tableStmt.table.schema) {
|
|
216
|
-
const qualifiedStmt: AST.CreateTableStmt = {
|
|
217
|
-
...tableStmt,
|
|
218
|
-
table: {
|
|
219
|
-
...tableStmt.table,
|
|
220
|
-
schema: targetSchema
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
ddlStatements.push(createTableToString(qualifiedStmt));
|
|
224
|
-
} else {
|
|
225
|
-
ddlStatements.push(createTableToString(tableStmt));
|
|
226
|
-
}
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
case 'declaredIndex': {
|
|
230
|
-
// Generate index DDL using AST stringifier
|
|
231
|
-
const indexStmt = item.indexStmt;
|
|
232
|
-
if (targetSchema && targetSchema !== 'main' && !indexStmt.table.schema) {
|
|
233
|
-
const qualifiedStmt: AST.CreateIndexStmt = {
|
|
234
|
-
...indexStmt,
|
|
235
|
-
table: {
|
|
236
|
-
...indexStmt.table,
|
|
237
|
-
schema: targetSchema
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
ddlStatements.push(createIndexToString(qualifiedStmt));
|
|
241
|
-
} else {
|
|
242
|
-
ddlStatements.push(createIndexToString(indexStmt));
|
|
243
|
-
}
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
case 'declaredView': {
|
|
247
|
-
// Qualify view name with schema if specified
|
|
248
|
-
const viewStmt = item.viewStmt;
|
|
249
|
-
if (targetSchema && targetSchema !== 'main' && !viewStmt.view.schema) {
|
|
250
|
-
const qualifiedStmt: AST.CreateViewStmt = {
|
|
251
|
-
...viewStmt,
|
|
252
|
-
view: {
|
|
253
|
-
...viewStmt.view,
|
|
254
|
-
schema: targetSchema
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
ddlStatements.push(createViewToString(qualifiedStmt));
|
|
258
|
-
} else {
|
|
259
|
-
ddlStatements.push(createViewToString(viewStmt));
|
|
260
|
-
}
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return ddlStatements;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|