opfsql 0.0.2
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/LICENSE +19 -0
- package/README.md +198 -0
- package/dist/binder/core/context.d.ts +15 -0
- package/dist/binder/core/errors.d.ts +4 -0
- package/dist/binder/core/helpers.d.ts +6 -0
- package/dist/binder/core/operators.d.ts +12 -0
- package/dist/binder/core/plan-utils.d.ts +4 -0
- package/dist/binder/core/scope.d.ts +34 -0
- package/dist/binder/core/type-check.d.ts +5 -0
- package/dist/binder/core/type-map.d.ts +8 -0
- package/dist/binder/core/utils/eval-constant.d.ts +4 -0
- package/dist/binder/core/utils/extract-columns.d.ts +4 -0
- package/dist/binder/core/utils/find-column.d.ts +4 -0
- package/dist/binder/core/utils/require-table.d.ts +3 -0
- package/dist/binder/expression/aggregate.d.ts +11 -0
- package/dist/binder/expression/between.d.ts +5 -0
- package/dist/binder/expression/case.d.ts +5 -0
- package/dist/binder/expression/cast.d.ts +5 -0
- package/dist/binder/expression/column-ref.d.ts +5 -0
- package/dist/binder/expression/comparison.d.ts +5 -0
- package/dist/binder/expression/conjunction.d.ts +5 -0
- package/dist/binder/expression/constant.d.ts +3 -0
- package/dist/binder/expression/function.d.ts +5 -0
- package/dist/binder/expression/index.d.ts +5 -0
- package/dist/binder/expression/operator.d.ts +5 -0
- package/dist/binder/expression/parameter.d.ts +4 -0
- package/dist/binder/expression/same-expression.d.ts +3 -0
- package/dist/binder/expression/star.d.ts +5 -0
- package/dist/binder/expression/subquery.d.ts +5 -0
- package/dist/binder/index.d.ts +30 -0
- package/dist/binder/statement/alter-table.d.ts +4 -0
- package/dist/binder/statement/create-index.d.ts +4 -0
- package/dist/binder/statement/create-table.d.ts +4 -0
- package/dist/binder/statement/cte.d.ts +16 -0
- package/dist/binder/statement/delete.d.ts +4 -0
- package/dist/binder/statement/drop.d.ts +3 -0
- package/dist/binder/statement/insert.d.ts +4 -0
- package/dist/binder/statement/query-node.d.ts +5 -0
- package/dist/binder/statement/select.d.ts +5 -0
- package/dist/binder/statement/set-operation.d.ts +5 -0
- package/dist/binder/statement/update.d.ts +4 -0
- package/dist/binder/table-ref/base-table.d.ts +5 -0
- package/dist/binder/table-ref/index.d.ts +5 -0
- package/dist/binder/table-ref/join.d.ts +6 -0
- package/dist/binder/table-ref/subquery.d.ts +5 -0
- package/dist/binder/tests/aggregates.test.d.ts +1 -0
- package/dist/binder/tests/binder.test.d.ts +1 -0
- package/dist/binder/tests/cte.test.d.ts +1 -0
- package/dist/binder/tests/ddl.test.d.ts +1 -0
- package/dist/binder/tests/dml.test.d.ts +1 -0
- package/dist/binder/tests/expressions.test.d.ts +1 -0
- package/dist/binder/tests/join.test.d.ts +1 -0
- package/dist/binder/tests/misc.test.d.ts +1 -0
- package/dist/binder/tests/select.test.d.ts +1 -0
- package/dist/binder/tests/subquery.test.d.ts +1 -0
- package/dist/binder/tests/test_helpers.d.ts +14 -0
- package/dist/binder/tests/union.test.d.ts +1 -0
- package/dist/binder/tests/utils.test.d.ts +1 -0
- package/dist/binder/types.d.ts +401 -0
- package/dist/engine/engine.d.ts +23 -0
- package/dist/engine/explain.d.ts +3 -0
- package/dist/engine/index.d.ts +3 -0
- package/dist/engine/session.d.ts +43 -0
- package/dist/engine/tests/engine.test.d.ts +1 -0
- package/dist/engine/tests/explain-format.test.d.ts +1 -0
- package/dist/engine/tests/explain.test.d.ts +1 -0
- package/dist/engine/tests/session.test.d.ts +1 -0
- package/dist/engine/types.d.ts +19 -0
- package/dist/executor/ddl/alter-drop.d.ts +5 -0
- package/dist/executor/ddl/create.d.ts +5 -0
- package/dist/executor/ddl/index.d.ts +2 -0
- package/dist/executor/ddl.d.ts +8 -0
- package/dist/executor/dml/delete.d.ts +5 -0
- package/dist/executor/dml/index.d.ts +3 -0
- package/dist/executor/dml/insert.d.ts +5 -0
- package/dist/executor/dml/update.d.ts +5 -0
- package/dist/executor/dml/utils/coerce.d.ts +3 -0
- package/dist/executor/dml/utils/index-maintenance.d.ts +5 -0
- package/dist/executor/dml/utils/scan.d.ts +16 -0
- package/dist/executor/dml.d.ts +8 -0
- package/dist/executor/errors.d.ts +4 -0
- package/dist/executor/evaluate/aggregate.d.ts +4 -0
- package/dist/executor/evaluate/between.d.ts +5 -0
- package/dist/executor/evaluate/case.d.ts +5 -0
- package/dist/executor/evaluate/cast.d.ts +5 -0
- package/dist/executor/evaluate/column-ref.d.ts +5 -0
- package/dist/executor/evaluate/comparison.d.ts +5 -0
- package/dist/executor/evaluate/compile.d.ts +11 -0
- package/dist/executor/evaluate/conjunction.d.ts +5 -0
- package/dist/executor/evaluate/context.d.ts +9 -0
- package/dist/executor/evaluate/function.d.ts +5 -0
- package/dist/executor/evaluate/functions/md5.d.ts +1 -0
- package/dist/executor/evaluate/functions/normalize-json.d.ts +8 -0
- package/dist/executor/evaluate/helpers.d.ts +14 -0
- package/dist/executor/evaluate/index.d.ts +6 -0
- package/dist/executor/evaluate/json-access.d.ts +7 -0
- package/dist/executor/evaluate/operator.d.ts +5 -0
- package/dist/executor/evaluate/parameter.d.ts +4 -0
- package/dist/executor/evaluate/subquery.d.ts +5 -0
- package/dist/executor/evaluate/utils/cast.d.ts +7 -0
- package/dist/executor/evaluate/utils/compare.d.ts +8 -0
- package/dist/executor/evaluate/utils/like.d.ts +2 -0
- package/dist/executor/evaluate/utils/serialize.d.ts +3 -0
- package/dist/executor/execute/index.d.ts +4 -0
- package/dist/executor/execute/result.d.ts +5 -0
- package/dist/executor/execute/select.d.ts +8 -0
- package/dist/executor/executor.d.ts +5 -0
- package/dist/executor/index.d.ts +3 -0
- package/dist/executor/operators/aggregate.d.ts +22 -0
- package/dist/executor/operators/cte.d.ts +37 -0
- package/dist/executor/operators/filter.d.ts +13 -0
- package/dist/executor/operators/index-min-max.d.ts +18 -0
- package/dist/executor/operators/index-scan.d.ts +22 -0
- package/dist/executor/operators/index-union-scan.d.ts +22 -0
- package/dist/executor/operators/join.d.ts +36 -0
- package/dist/executor/operators/limit.d.ts +13 -0
- package/dist/executor/operators/projection.d.ts +14 -0
- package/dist/executor/operators/scan.d.ts +29 -0
- package/dist/executor/operators/set.d.ts +22 -0
- package/dist/executor/operators/sort.d.ts +18 -0
- package/dist/executor/operators/utils.d.ts +10 -0
- package/dist/executor/planner/index.d.ts +5 -0
- package/dist/executor/planner/plan-aggregate.d.ts +5 -0
- package/dist/executor/planner/plan-cte.d.ts +6 -0
- package/dist/executor/planner/plan-filter.d.ts +4 -0
- package/dist/executor/planner/plan-get.d.ts +6 -0
- package/dist/executor/planner/plan-join.d.ts +5 -0
- package/dist/executor/planner/plan-limit.d.ts +4 -0
- package/dist/executor/planner/plan-order-by.d.ts +4 -0
- package/dist/executor/planner/plan-projection.d.ts +4 -0
- package/dist/executor/planner/plan-set.d.ts +5 -0
- package/dist/executor/planner/types.d.ts +12 -0
- package/dist/executor/planner.d.ts +5 -0
- package/dist/executor/resolve.d.ts +3 -0
- package/dist/executor/tests/compile.test.d.ts +1 -0
- package/dist/executor/tests/ddl-dml.test.d.ts +1 -0
- package/dist/executor/tests/evaluate.test.d.ts +1 -0
- package/dist/executor/tests/executor.test.d.ts +1 -0
- package/dist/executor/tests/functions.test.d.ts +1 -0
- package/dist/executor/tests/helpers.d.ts +34 -0
- package/dist/executor/tests/index-min-max.test.d.ts +1 -0
- package/dist/executor/tests/index-scan.test.d.ts +1 -0
- package/dist/executor/tests/index-union-scan.test.d.ts +1 -0
- package/dist/executor/tests/operators.test.d.ts +1 -0
- package/dist/executor/tests/planner.test.d.ts +1 -0
- package/dist/executor/tests/scan.test.d.ts +1 -0
- package/dist/executor/types.d.ts +39 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/optimizer/build_probe_side.d.ts +2 -0
- package/dist/optimizer/decorrelate_exists.d.ts +2 -0
- package/dist/optimizer/expression_rewriter.d.ts +2 -0
- package/dist/optimizer/filter_combiner.d.ts +13 -0
- package/dist/optimizer/filter_pullup.d.ts +2 -0
- package/dist/optimizer/filter_pushdown.d.ts +2 -0
- package/dist/optimizer/in_clause_rewriter.d.ts +2 -0
- package/dist/optimizer/index.d.ts +15 -0
- package/dist/optimizer/index_selection.d.ts +3 -0
- package/dist/optimizer/join_order.d.ts +2 -0
- package/dist/optimizer/limit_pushdown.d.ts +2 -0
- package/dist/optimizer/remove_unused_columns.d.ts +2 -0
- package/dist/optimizer/reorder_filter.d.ts +4 -0
- package/dist/optimizer/tests/build_probe_side.test.d.ts +1 -0
- package/dist/optimizer/tests/decorrelate_exists.test.d.ts +1 -0
- package/dist/optimizer/tests/expression_rewriter.test.d.ts +1 -0
- package/dist/optimizer/tests/filter_combiner.test.d.ts +1 -0
- package/dist/optimizer/tests/filter_pullup.test.d.ts +1 -0
- package/dist/optimizer/tests/filter_pushdown.test.d.ts +1 -0
- package/dist/optimizer/tests/full_pipeline.test.d.ts +1 -0
- package/dist/optimizer/tests/in_clause_rewriter.test.d.ts +1 -0
- package/dist/optimizer/tests/index_selection.test.d.ts +1 -0
- package/dist/optimizer/tests/join_order.test.d.ts +1 -0
- package/dist/optimizer/tests/limit_pushdown.test.d.ts +1 -0
- package/dist/optimizer/tests/optimizer.test.d.ts +1 -0
- package/dist/optimizer/tests/remove_unused_columns.test.d.ts +1 -0
- package/dist/optimizer/tests/reorder_filter.test.d.ts +1 -0
- package/dist/optimizer/tests/test_helpers.d.ts +27 -0
- package/dist/optimizer/tests/utils.test.d.ts +1 -0
- package/dist/optimizer/utils/collect_column_refs.d.ts +2 -0
- package/dist/optimizer/utils/expression_key.d.ts +7 -0
- package/dist/optimizer/utils/expression_references_table.d.ts +2 -0
- package/dist/optimizer/utils/expressions_equal.d.ts +1 -0
- package/dist/optimizer/utils/flatten_conjunction.d.ts +2 -0
- package/dist/optimizer/utils/flip_comparison.d.ts +2 -0
- package/dist/optimizer/utils/get_expression_tables.d.ts +2 -0
- package/dist/optimizer/utils/get_operator_tables.d.ts +2 -0
- package/dist/optimizer/utils/index.d.ts +23 -0
- package/dist/optimizer/utils/is_column_ref.d.ts +2 -0
- package/dist/optimizer/utils/is_comparison.d.ts +2 -0
- package/dist/optimizer/utils/is_conjunction.d.ts +2 -0
- package/dist/optimizer/utils/is_constant.d.ts +2 -0
- package/dist/optimizer/utils/is_foldable.d.ts +2 -0
- package/dist/optimizer/utils/is_numeric_type.d.ts +2 -0
- package/dist/optimizer/utils/is_operator.d.ts +2 -0
- package/dist/optimizer/utils/is_parameter.d.ts +2 -0
- package/dist/optimizer/utils/make_bool_constant.d.ts +2 -0
- package/dist/optimizer/utils/make_conjunction.d.ts +2 -0
- package/dist/optimizer/utils/make_constant.d.ts +2 -0
- package/dist/optimizer/utils/make_null_constant.d.ts +2 -0
- package/dist/optimizer/utils/map_expression.d.ts +2 -0
- package/dist/optimizer/utils/map_operator_expressions.d.ts +2 -0
- package/dist/optimizer/utils/negate_comparison.d.ts +2 -0
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/lexer.d.ts +24 -0
- package/dist/parser/parser/base.d.ts +17 -0
- package/dist/parser/parser/ddl.d.ts +5 -0
- package/dist/parser/parser/dml.d.ts +5 -0
- package/dist/parser/parser/expressions.d.ts +5 -0
- package/dist/parser/parser/index.d.ts +7 -0
- package/dist/parser/parser/select.d.ts +3 -0
- package/dist/parser/parser/tcl.d.ts +3 -0
- package/dist/parser/parser/type-parser.d.ts +3 -0
- package/dist/parser/tests/lexer.test.d.ts +1 -0
- package/dist/parser/tests/parser.test.d.ts +1 -0
- package/dist/parser/types.d.ts +482 -0
- package/dist/store/backend/memory-storage.d.ts +16 -0
- package/dist/store/backend/node-storage.d.ts +33 -0
- package/dist/store/backend/opfs-storage.d.ts +39 -0
- package/dist/store/btree/btree.d.ts +48 -0
- package/dist/store/btree/compare.d.ts +13 -0
- package/dist/store/btree/search-bounds.d.ts +15 -0
- package/dist/store/btree/types.d.ts +33 -0
- package/dist/store/cache.d.ts +17 -0
- package/dist/store/catalog.d.ts +24 -0
- package/dist/store/errors.d.ts +5 -0
- package/dist/store/index-btree/compare.d.ts +3 -0
- package/dist/store/index-btree/index-btree.d.ts +53 -0
- package/dist/store/index-btree/search-bounds.d.ts +7 -0
- package/dist/store/index-btree/types.d.ts +27 -0
- package/dist/store/index-expression.d.ts +5 -0
- package/dist/store/index-manager.d.ts +23 -0
- package/dist/store/index.d.ts +10 -0
- package/dist/store/memory-storage.d.ts +13 -0
- package/dist/store/opfs/opfs-storage.d.ts +15 -0
- package/dist/store/opfs-storage.d.ts +44 -0
- package/dist/store/page-manager.d.ts +19 -0
- package/dist/store/row-manager.d.ts +15 -0
- package/dist/store/session-store.d.ts +20 -0
- package/dist/store/storage/memory-storage.d.ts +11 -0
- package/dist/store/storage/opfs-storage.d.ts +15 -0
- package/dist/store/storage.d.ts +28 -0
- package/dist/store/table-btree.d.ts +48 -0
- package/dist/store/table-manager.d.ts +17 -0
- package/dist/store/tests/btree.test.d.ts +1 -0
- package/dist/store/tests/catalog.test.d.ts +1 -0
- package/dist/store/tests/compare.test.d.ts +1 -0
- package/dist/store/tests/index-btree.test.d.ts +1 -0
- package/dist/store/tests/index-expression.test.d.ts +1 -0
- package/dist/store/tests/index-manager.test.d.ts +1 -0
- package/dist/store/tests/lru-cache.test.d.ts +1 -0
- package/dist/store/tests/memory-storage.d.ts +15 -0
- package/dist/store/tests/opfs-storage.test.d.ts +1 -0
- package/dist/store/tests/page-manager.test.d.ts +1 -0
- package/dist/store/tests/row-manager.test.d.ts +1 -0
- package/dist/store/tests/search-bounds.test.d.ts +1 -0
- package/dist/store/tests/storage.test.d.ts +1 -0
- package/dist/store/tests/table-btree.test.d.ts +1 -0
- package/dist/store/tests/vacuum.test.d.ts +1 -0
- package/dist/store/tests/wal-storage.test.d.ts +1 -0
- package/dist/store/types.d.ts +75 -0
- package/dist/store/vacuum.d.ts +12 -0
- package/dist/store/wal/crc32.d.ts +1 -0
- package/dist/store/wal/file-handle.d.ts +34 -0
- package/dist/store/wal/wal-storage.d.ts +50 -0
- package/dist/types.d.ts +87 -0
- package/dist/worker/client.d.ts +36 -0
- package/dist/worker/index.d.ts +1 -0
- package/dist/worker/protocol.d.ts +59 -0
- package/dist/worker/worker.d.ts +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from '../../binder/types.js';
|
|
2
|
+
import type { Value, Tuple } from '../types.js';
|
|
3
|
+
import type { Resolver } from '../resolve.js';
|
|
4
|
+
import type { SyncEvalContext as EvalContext } from './context.js';
|
|
5
|
+
export declare function evalColumnRef(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: EvalContext): Value;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from "../../binder/types.js";
|
|
2
|
+
import type { Resolver } from "../resolve.js";
|
|
3
|
+
import type { Tuple, Value } from "../types.js";
|
|
4
|
+
import type { SyncEvalContext } from "./context.js";
|
|
5
|
+
export declare function evalComparison(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BoundExpression, ComparisonType, TableFilter } from '../../binder/types.js';
|
|
2
|
+
import type { Resolver } from '../resolve.js';
|
|
3
|
+
import type { Tuple, Value } from '../types.js';
|
|
4
|
+
import type { SyncEvalContext } from './context.js';
|
|
5
|
+
export interface CompiledFilter {
|
|
6
|
+
getValue: (tuple: Tuple) => Value;
|
|
7
|
+
comparisonType: ComparisonType;
|
|
8
|
+
getConstant: (params?: readonly Value[]) => Value;
|
|
9
|
+
}
|
|
10
|
+
export declare function compileExpression(expr: BoundExpression, resolver: Resolver, ctx: SyncEvalContext): (tuple: Tuple) => Value;
|
|
11
|
+
export declare function compileFilter(filter: TableFilter, resolver: Resolver, ctx: SyncEvalContext): CompiledFilter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from '../../binder/types.js';
|
|
2
|
+
import type { Value, Tuple } from '../types.js';
|
|
3
|
+
import type { Resolver } from '../resolve.js';
|
|
4
|
+
import type { SyncEvalContext } from './context.js';
|
|
5
|
+
export declare function evalConjunction(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LogicalOperator } from '../../binder/types.js';
|
|
2
|
+
import type { Tuple, Value } from '../types.js';
|
|
3
|
+
import type { Resolver } from '../resolve.js';
|
|
4
|
+
export interface SyncEvalContext {
|
|
5
|
+
executeSubplan(plan: LogicalOperator, outerTuple?: Tuple, outerResolver?: Resolver, limit?: number): Tuple[];
|
|
6
|
+
outerTuple?: Tuple;
|
|
7
|
+
outerResolver?: Resolver;
|
|
8
|
+
params?: readonly Value[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from "../../binder/types.js";
|
|
2
|
+
import type { Resolver } from "../resolve.js";
|
|
3
|
+
import type { Tuple, Value } from "../types.js";
|
|
4
|
+
import type { SyncEvalContext } from "./context.js";
|
|
5
|
+
export declare function evalFunction(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function md5(input: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonValue } from '../../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively normalize a JSON value for canonical serialization:
|
|
4
|
+
* - Object keys are sorted lexicographically
|
|
5
|
+
* - Array order is preserved
|
|
6
|
+
* - Primitives pass through unchanged
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeJson(value: JsonValue): JsonValue;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComparisonType } from "../../binder/types.js";
|
|
2
|
+
import type { Value } from "../types.js";
|
|
3
|
+
/** SQL truthiness: only boolean true passes filters */
|
|
4
|
+
export declare function isTruthy(v: Value): boolean;
|
|
5
|
+
/** Compare two non-null values. Numbers compare numerically, else as strings. */
|
|
6
|
+
export declare function compareValues(a: Value, b: Value): number;
|
|
7
|
+
/** Apply comparison operator to two values with NULL propagation. */
|
|
8
|
+
export declare function applyComparison(left: Value, right: Value, comparisonType: ComparisonType): Value;
|
|
9
|
+
/** Convert SQL LIKE pattern to RegExp. */
|
|
10
|
+
export declare function likeToRegex(pattern: string): RegExp;
|
|
11
|
+
/** Serialize a value to a string for hashing (joins, distinct, group by). */
|
|
12
|
+
export declare function serializeValue(v: Value): string;
|
|
13
|
+
/** Cast a value to a target type. */
|
|
14
|
+
export declare function castValue(v: Value, targetType: string): Value;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BoundExpression } from "../../binder/types.js";
|
|
2
|
+
import type { Resolver } from "../resolve.js";
|
|
3
|
+
import type { Tuple, Value } from "../types.js";
|
|
4
|
+
import type { SyncEvalContext } from "./context.js";
|
|
5
|
+
export { type SyncEvalContext } from "./context.js";
|
|
6
|
+
export declare function evaluateExpression(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BoundExpression } from "../../binder/types.js";
|
|
2
|
+
import type { JsonPathSegment } from "../../types.js";
|
|
3
|
+
import type { Resolver } from "../resolve.js";
|
|
4
|
+
import type { Tuple, Value } from "../types.js";
|
|
5
|
+
import type { SyncEvalContext } from "./context.js";
|
|
6
|
+
export declare function evalJsonAccess(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
7
|
+
export declare function traverseJsonPath(obj: Value, path: JsonPathSegment[]): Value;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from '../../binder/types.js';
|
|
2
|
+
import type { Value, Tuple } from '../types.js';
|
|
3
|
+
import type { Resolver } from '../resolve.js';
|
|
4
|
+
import type { SyncEvalContext } from './context.js';
|
|
5
|
+
export declare function evalOperator(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundExpression } from "../../binder/types.js";
|
|
2
|
+
import type { Resolver } from "../resolve.js";
|
|
3
|
+
import type { Tuple, Value } from "../types.js";
|
|
4
|
+
import type { SyncEvalContext } from "./context.js";
|
|
5
|
+
export declare function evalSubquery(expr: BoundExpression, tuple: Tuple, resolver: Resolver, ctx: SyncEvalContext): Value;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Value } from "../../types.js";
|
|
2
|
+
/** Cast a value to a target type. */
|
|
3
|
+
export declare function castValue(v: Value, targetType: string): Value;
|
|
4
|
+
export declare function castText(v: Value): string;
|
|
5
|
+
export declare function castJson(v: Value): any;
|
|
6
|
+
export declare function blobToHex(buf: Uint8Array): string;
|
|
7
|
+
export declare function hexToBlob(hex: string): Uint8Array;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComparisonType } from "../../../binder/types.js";
|
|
2
|
+
import type { Value } from "../../types.js";
|
|
3
|
+
/** SQL truthiness: only boolean true passes filters */
|
|
4
|
+
export declare function isTruthy(v: Value): boolean;
|
|
5
|
+
/** Compare two non-null values. Numbers compare numerically, else as strings. */
|
|
6
|
+
export declare function compareValues(a: Value, b: Value): number;
|
|
7
|
+
/** Apply comparison operator to two values with NULL propagation. */
|
|
8
|
+
export declare function applyComparison(left: Value, right: Value, comparisonType: ComparisonType): Value;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import type { ICatalog, SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { ExecuteResult, Value } from "../types.js";
|
|
4
|
+
export declare function execute(plan: LogicalOperator, rowManager: SyncIRowManager, catalog: ICatalog, indexManager?: SyncIIndexManager, params?: readonly Value[]): ExecuteResult;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import type { Row } from "../../store/types.js";
|
|
3
|
+
import type { Tuple } from "../types.js";
|
|
4
|
+
export declare function extractColumnNames(plan: LogicalOperator): string[];
|
|
5
|
+
export declare function tuplesToRows(tuples: Tuple[], columnNames: string[]): Row[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import type { ICatalog, SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { Resolver } from "../resolve.js";
|
|
5
|
+
import type { ExecuteResult, Tuple, Value } from "../types.js";
|
|
6
|
+
export declare function createEvalContext(rowManager: SyncIRowManager, catalog: ICatalog, params?: readonly Value[], outerTuple?: Tuple, outerResolver?: Resolver): SyncEvalContext;
|
|
7
|
+
export declare function executeSelect(plan: LogicalOperator, rowManager: SyncIRowManager, ctx: SyncEvalContext, indexManager?: SyncIIndexManager): ExecuteResult;
|
|
8
|
+
export declare function executeSubplan(plan: LogicalOperator, rowManager: SyncIRowManager, catalog: ICatalog, outerTuple?: Tuple, outerResolver?: Resolver, limit?: number, params?: readonly Value[]): Tuple[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../binder/types.js";
|
|
2
|
+
import type { SyncIIndexManager, SyncIRowManager } from "../store/types.js";
|
|
3
|
+
import type { ICatalog } from "../store/types.js";
|
|
4
|
+
import type { ExecuteResult, Value } from "./types.js";
|
|
5
|
+
export declare function execute(plan: LogicalOperator, rowManager: SyncIRowManager, catalog: ICatalog, indexManager?: SyncIIndexManager, params?: readonly Value[]): ExecuteResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ColumnBinding, LogicalAggregate } from "../../binder/types.js";
|
|
2
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
3
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
4
|
+
export declare class PhysicalHashAggregate implements SyncPhysicalOperator {
|
|
5
|
+
private readonly child;
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly ctx;
|
|
8
|
+
private readonly layout;
|
|
9
|
+
private readonly childResolver;
|
|
10
|
+
private emitted;
|
|
11
|
+
constructor(child: SyncPhysicalOperator, op: LogicalAggregate, ctx: SyncEvalContext);
|
|
12
|
+
getLayout(): ColumnBinding[];
|
|
13
|
+
next(): Tuple[] | null;
|
|
14
|
+
reset(): void;
|
|
15
|
+
private buildGroups;
|
|
16
|
+
private computeGroupKey;
|
|
17
|
+
private newAggStates;
|
|
18
|
+
private updateAgg;
|
|
19
|
+
private finalize;
|
|
20
|
+
private finalizeAgg;
|
|
21
|
+
private applyHaving;
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LogicalCTERef, ColumnBinding } from '../../binder/types.js';
|
|
2
|
+
import type { SyncPhysicalOperator, Tuple, CTECacheEntry } from '../types.js';
|
|
3
|
+
export declare class PhysicalMaterialize implements SyncPhysicalOperator {
|
|
4
|
+
private readonly cteDefinition;
|
|
5
|
+
private readonly mainPlan;
|
|
6
|
+
private readonly cteIndex;
|
|
7
|
+
private readonly cteCache;
|
|
8
|
+
private materialized;
|
|
9
|
+
constructor(cteDefinition: SyncPhysicalOperator, mainPlan: SyncPhysicalOperator, cteIndex: number, cteCache: Map<number, CTECacheEntry>);
|
|
10
|
+
getLayout(): ColumnBinding[];
|
|
11
|
+
next(): Tuple[] | null;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class PhysicalCTEScan implements SyncPhysicalOperator {
|
|
15
|
+
private readonly op;
|
|
16
|
+
private readonly cteCache;
|
|
17
|
+
private offset;
|
|
18
|
+
private readonly layout;
|
|
19
|
+
constructor(op: LogicalCTERef, cteCache: Map<number, CTECacheEntry>);
|
|
20
|
+
getLayout(): ColumnBinding[];
|
|
21
|
+
next(): Tuple[] | null;
|
|
22
|
+
reset(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class PhysicalRecursiveCTE implements SyncPhysicalOperator {
|
|
25
|
+
private readonly anchor;
|
|
26
|
+
private readonly recursive;
|
|
27
|
+
private readonly cteIndex;
|
|
28
|
+
private readonly cteCache;
|
|
29
|
+
private readonly isUnionAll;
|
|
30
|
+
private result;
|
|
31
|
+
private offset;
|
|
32
|
+
constructor(anchor: SyncPhysicalOperator, recursive: SyncPhysicalOperator, cteIndex: number, cteCache: Map<number, CTECacheEntry>, isUnionAll: boolean);
|
|
33
|
+
getLayout(): ColumnBinding[];
|
|
34
|
+
next(): Tuple[] | null;
|
|
35
|
+
reset(): void;
|
|
36
|
+
private execute;
|
|
37
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BoundExpression, ColumnBinding } from "../../binder/types.js";
|
|
2
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
3
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
4
|
+
export declare class PhysicalFilter implements SyncPhysicalOperator {
|
|
5
|
+
private readonly child;
|
|
6
|
+
private readonly condition;
|
|
7
|
+
private readonly ctx;
|
|
8
|
+
private readonly resolver;
|
|
9
|
+
constructor(child: SyncPhysicalOperator, condition: BoundExpression, ctx: SyncEvalContext);
|
|
10
|
+
getLayout(): ColumnBinding[];
|
|
11
|
+
next(): Tuple[] | null;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ColumnBinding, LogicalAggregate } from "../../binder/types.js";
|
|
2
|
+
import type { IndexDef, SyncIIndexManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
4
|
+
export declare class PhysicalIndexMinMax implements SyncPhysicalOperator {
|
|
5
|
+
private readonly agg;
|
|
6
|
+
private readonly indexManager;
|
|
7
|
+
private readonly hint;
|
|
8
|
+
private emitted;
|
|
9
|
+
private readonly layout;
|
|
10
|
+
constructor(agg: LogicalAggregate, indexManager: SyncIIndexManager, hint: {
|
|
11
|
+
indexDef: IndexDef;
|
|
12
|
+
functionName: "MIN" | "MAX";
|
|
13
|
+
keyPosition: number;
|
|
14
|
+
});
|
|
15
|
+
getLayout(): ColumnBinding[];
|
|
16
|
+
next(): Tuple[] | null;
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ColumnBinding, IndexSearchPredicate, LogicalGet, TableFilter } from "../../binder/types.js";
|
|
2
|
+
import type { IndexDef, SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
5
|
+
export declare class PhysicalIndexScan implements SyncPhysicalOperator {
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly rowManager;
|
|
8
|
+
private readonly indexManager;
|
|
9
|
+
private readonly indexDef;
|
|
10
|
+
private readonly indexPredicates;
|
|
11
|
+
private readonly ctx;
|
|
12
|
+
private rowIds;
|
|
13
|
+
private cursor;
|
|
14
|
+
private done;
|
|
15
|
+
private readonly layout;
|
|
16
|
+
private readonly compiledResiduals;
|
|
17
|
+
constructor(op: LogicalGet, rowManager: SyncIRowManager, indexManager: SyncIIndexManager, indexDef: IndexDef, indexPredicates: IndexSearchPredicate[], residualFilters: TableFilter[], ctx: SyncEvalContext);
|
|
18
|
+
getLayout(): ColumnBinding[];
|
|
19
|
+
next(): Tuple[] | null;
|
|
20
|
+
reset(): void;
|
|
21
|
+
private fetchRowIds;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ColumnBinding, IndexUnionHint, LogicalGet } from "../../binder/types.js";
|
|
2
|
+
import type { SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
5
|
+
export declare class PhysicalIndexUnionScan implements SyncPhysicalOperator {
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly rowManager;
|
|
8
|
+
private readonly indexManager;
|
|
9
|
+
private readonly hint;
|
|
10
|
+
private readonly ctx;
|
|
11
|
+
private rowIds;
|
|
12
|
+
private cursor;
|
|
13
|
+
private done;
|
|
14
|
+
private readonly layout;
|
|
15
|
+
private readonly resolver;
|
|
16
|
+
private readonly residualExpr;
|
|
17
|
+
constructor(op: LogicalGet, rowManager: SyncIRowManager, indexManager: SyncIIndexManager, hint: IndexUnionHint, ctx: SyncEvalContext);
|
|
18
|
+
getLayout(): ColumnBinding[];
|
|
19
|
+
next(): Tuple[] | null;
|
|
20
|
+
reset(): void;
|
|
21
|
+
private fetchUnionRowIds;
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ColumnBinding, LogicalComparisonJoin } from "../../binder/types.js";
|
|
2
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
3
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
4
|
+
export declare class PhysicalHashJoin implements SyncPhysicalOperator {
|
|
5
|
+
private readonly probe;
|
|
6
|
+
private readonly build;
|
|
7
|
+
private readonly op;
|
|
8
|
+
private readonly ctx;
|
|
9
|
+
private readonly layout;
|
|
10
|
+
private readonly probeResolver;
|
|
11
|
+
private readonly buildResolver;
|
|
12
|
+
private readonly buildNullTuple;
|
|
13
|
+
private hashTable;
|
|
14
|
+
private emitter;
|
|
15
|
+
constructor(probe: SyncPhysicalOperator, build: SyncPhysicalOperator, op: LogicalComparisonJoin, ctx: SyncEvalContext);
|
|
16
|
+
getLayout(): ColumnBinding[];
|
|
17
|
+
next(): Tuple[] | null;
|
|
18
|
+
reset(): void;
|
|
19
|
+
private buildHashTable;
|
|
20
|
+
private emitMatches;
|
|
21
|
+
private emitSemiAnti;
|
|
22
|
+
private probeTuples;
|
|
23
|
+
private evalKey;
|
|
24
|
+
}
|
|
25
|
+
export declare class PhysicalNestedLoopJoin implements SyncPhysicalOperator {
|
|
26
|
+
private readonly left;
|
|
27
|
+
private readonly right;
|
|
28
|
+
private readonly layout;
|
|
29
|
+
private rightTuples;
|
|
30
|
+
private emitter;
|
|
31
|
+
constructor(left: SyncPhysicalOperator, right: SyncPhysicalOperator);
|
|
32
|
+
getLayout(): ColumnBinding[];
|
|
33
|
+
next(): Tuple[] | null;
|
|
34
|
+
reset(): void;
|
|
35
|
+
private emitCrossProduct;
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LogicalLimit, ColumnBinding } from '../../binder/types.js';
|
|
2
|
+
import type { SyncPhysicalOperator, Tuple } from '../types.js';
|
|
3
|
+
export declare class PhysicalLimit implements SyncPhysicalOperator {
|
|
4
|
+
private readonly child;
|
|
5
|
+
private readonly op;
|
|
6
|
+
private skipped;
|
|
7
|
+
private emitted;
|
|
8
|
+
private readonly maxRows;
|
|
9
|
+
constructor(child: SyncPhysicalOperator, op: LogicalLimit);
|
|
10
|
+
getLayout(): ColumnBinding[];
|
|
11
|
+
next(): Tuple[] | null;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LogicalProjection, ColumnBinding } from '../../binder/types.js';
|
|
2
|
+
import type { SyncPhysicalOperator, Tuple } from '../types.js';
|
|
3
|
+
import type { SyncEvalContext } from '../evaluate/context.js';
|
|
4
|
+
export declare class PhysicalProjection implements SyncPhysicalOperator {
|
|
5
|
+
private readonly child;
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly ctx;
|
|
8
|
+
private readonly resolver;
|
|
9
|
+
private readonly layout;
|
|
10
|
+
constructor(child: SyncPhysicalOperator, op: LogicalProjection, ctx: SyncEvalContext);
|
|
11
|
+
getLayout(): ColumnBinding[];
|
|
12
|
+
next(): Tuple[] | null;
|
|
13
|
+
reset(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ColumnBinding, LogicalGet } from "../../binder/types.js";
|
|
2
|
+
import type { SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { SyncPhysicalOperator, Tuple } from "../types.js";
|
|
5
|
+
export declare class PhysicalScan implements SyncPhysicalOperator {
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly rowManager;
|
|
8
|
+
private readonly ctx;
|
|
9
|
+
private iterator;
|
|
10
|
+
private done;
|
|
11
|
+
private readonly layout;
|
|
12
|
+
private readonly compiledFilters;
|
|
13
|
+
constructor(op: LogicalGet, rowManager: SyncIRowManager, ctx: SyncEvalContext);
|
|
14
|
+
getLayout(): ColumnBinding[];
|
|
15
|
+
next(): Tuple[] | null;
|
|
16
|
+
reset(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class PhysicalChildScan implements SyncPhysicalOperator {
|
|
19
|
+
private readonly op;
|
|
20
|
+
private readonly childOp;
|
|
21
|
+
private readonly ctx;
|
|
22
|
+
private done;
|
|
23
|
+
private readonly layout;
|
|
24
|
+
private readonly compiledFilters;
|
|
25
|
+
constructor(op: LogicalGet, childOp: SyncPhysicalOperator, ctx: SyncEvalContext);
|
|
26
|
+
getLayout(): ColumnBinding[];
|
|
27
|
+
next(): Tuple[] | null;
|
|
28
|
+
reset(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ColumnBinding } from '../../binder/types.js';
|
|
2
|
+
import type { SyncPhysicalOperator, Tuple } from '../types.js';
|
|
3
|
+
export declare class PhysicalDistinct implements SyncPhysicalOperator {
|
|
4
|
+
private readonly child;
|
|
5
|
+
private readonly seen;
|
|
6
|
+
constructor(child: SyncPhysicalOperator);
|
|
7
|
+
getLayout(): ColumnBinding[];
|
|
8
|
+
next(): Tuple[] | null;
|
|
9
|
+
reset(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class PhysicalUnion implements SyncPhysicalOperator {
|
|
12
|
+
private readonly left;
|
|
13
|
+
private readonly right;
|
|
14
|
+
private readonly all;
|
|
15
|
+
private leftDone;
|
|
16
|
+
private readonly seen;
|
|
17
|
+
constructor(left: SyncPhysicalOperator, right: SyncPhysicalOperator, all: boolean);
|
|
18
|
+
getLayout(): ColumnBinding[];
|
|
19
|
+
next(): Tuple[] | null;
|
|
20
|
+
reset(): void;
|
|
21
|
+
private dedup;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LogicalOrderBy, ColumnBinding } from '../../binder/types.js';
|
|
2
|
+
import type { SyncPhysicalOperator, Tuple } from '../types.js';
|
|
3
|
+
import type { SyncEvalContext } from '../evaluate/context.js';
|
|
4
|
+
export declare class PhysicalSort implements SyncPhysicalOperator {
|
|
5
|
+
private readonly child;
|
|
6
|
+
private readonly op;
|
|
7
|
+
private readonly ctx;
|
|
8
|
+
private sorted;
|
|
9
|
+
private offset;
|
|
10
|
+
constructor(child: SyncPhysicalOperator, op: LogicalOrderBy, ctx: SyncEvalContext);
|
|
11
|
+
getLayout(): ColumnBinding[];
|
|
12
|
+
next(): Tuple[] | null;
|
|
13
|
+
reset(): void;
|
|
14
|
+
private compare;
|
|
15
|
+
private computeKeys;
|
|
16
|
+
private sortAll;
|
|
17
|
+
private topKSort;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TableSchema, BoundConstantExpression, BoundParameterExpression } from '../../binder/types.js';
|
|
2
|
+
import type { CompiledFilter } from '../evaluate/compile.js';
|
|
3
|
+
import type { SyncPhysicalOperator, Tuple, Value } from '../types.js';
|
|
4
|
+
export declare const SCAN_BATCH = 500;
|
|
5
|
+
export declare const JOIN_BATCH = 2000;
|
|
6
|
+
export declare function resolveFilterValue(constant: BoundConstantExpression | BoundParameterExpression, params?: readonly Value[]): Value;
|
|
7
|
+
export declare function serializeKey(values: Value[]): string;
|
|
8
|
+
export declare function rowToTuple(row: Record<string, Value>, columnIds: number[], schema: TableSchema): Tuple;
|
|
9
|
+
export declare function passesCompiledFilters(tuple: Tuple, filters: CompiledFilter[], params?: readonly Value[]): boolean;
|
|
10
|
+
export declare function drainOperator(op: SyncPhysicalOperator): Tuple[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import type { SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { CTECacheEntry, SyncPhysicalOperator } from "../types.js";
|
|
5
|
+
export declare function createPhysicalPlan(node: LogicalOperator, rowManager: SyncIRowManager, cteCache: Map<number, CTECacheEntry>, ctx: SyncEvalContext, indexManager?: SyncIIndexManager): SyncPhysicalOperator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalHashAggregate } from "../operators/aggregate.js";
|
|
3
|
+
import { PhysicalIndexMinMax } from "../operators/index-min-max.js";
|
|
4
|
+
import type { PlannerContext } from "./types.js";
|
|
5
|
+
export declare function planAggregate(node: LogicalOperator, pc: PlannerContext): PhysicalHashAggregate | PhysicalIndexMinMax;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalCTEScan, PhysicalMaterialize, PhysicalRecursiveCTE } from "../operators/cte.js";
|
|
3
|
+
import type { PlannerContext } from "./types.js";
|
|
4
|
+
export declare function planMaterializedCTE(node: LogicalOperator, pc: PlannerContext): PhysicalMaterialize;
|
|
5
|
+
export declare function planRecursiveCTE(node: LogicalOperator, pc: PlannerContext): PhysicalRecursiveCTE;
|
|
6
|
+
export declare function planCTERef(node: LogicalOperator, pc: PlannerContext): PhysicalCTEScan;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalIndexScan } from "../operators/index-scan.js";
|
|
3
|
+
import { PhysicalIndexUnionScan } from "../operators/index-union-scan.js";
|
|
4
|
+
import { PhysicalChildScan, PhysicalScan } from "../operators/scan.js";
|
|
5
|
+
import type { PlannerContext } from "./types.js";
|
|
6
|
+
export declare function planGet(node: LogicalOperator, pc: PlannerContext): PhysicalIndexScan | PhysicalIndexUnionScan | PhysicalScan | PhysicalChildScan;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalHashJoin, PhysicalNestedLoopJoin } from "../operators/join.js";
|
|
3
|
+
import type { PlannerContext } from "./types.js";
|
|
4
|
+
export declare function planComparisonJoin(node: LogicalOperator, pc: PlannerContext): PhysicalHashJoin;
|
|
5
|
+
export declare function planCrossProduct(node: LogicalOperator, pc: PlannerContext): PhysicalNestedLoopJoin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalProjection } from "../operators/projection.js";
|
|
3
|
+
import type { PlannerContext } from "./types.js";
|
|
4
|
+
export declare function planProjection(node: LogicalOperator, pc: PlannerContext): PhysicalProjection;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import { PhysicalDistinct, PhysicalUnion } from "../operators/set.js";
|
|
3
|
+
import type { PlannerContext } from "./types.js";
|
|
4
|
+
export declare function planDistinct(node: LogicalOperator, pc: PlannerContext): PhysicalDistinct;
|
|
5
|
+
export declare function planUnion(node: LogicalOperator, pc: PlannerContext): PhysicalUnion;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../../binder/types.js";
|
|
2
|
+
import type { SyncIIndexManager, SyncIRowManager } from "../../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "../evaluate/context.js";
|
|
4
|
+
import type { CTECacheEntry, SyncPhysicalOperator } from "../types.js";
|
|
5
|
+
export interface PlannerContext {
|
|
6
|
+
rowManager: SyncIRowManager;
|
|
7
|
+
cteCache: Map<number, CTECacheEntry>;
|
|
8
|
+
ctx: SyncEvalContext;
|
|
9
|
+
indexManager?: SyncIIndexManager;
|
|
10
|
+
plan: (child: LogicalOperator) => SyncPhysicalOperator;
|
|
11
|
+
}
|
|
12
|
+
export type PlanHandler = (node: LogicalOperator, pc: PlannerContext) => SyncPhysicalOperator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogicalOperator } from "../binder/types.js";
|
|
2
|
+
import type { SyncIIndexManager, SyncIRowManager } from "../store/types.js";
|
|
3
|
+
import type { SyncEvalContext } from "./evaluate/context.js";
|
|
4
|
+
import type { CTECacheEntry, SyncPhysicalOperator } from "./types.js";
|
|
5
|
+
export declare function createPhysicalPlan(node: LogicalOperator, rowManager: SyncIRowManager, cteCache: Map<number, CTECacheEntry>, ctx: SyncEvalContext, indexManager?: SyncIIndexManager): SyncPhysicalOperator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|