MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / dispatch

Function dispatch

nodedb-sql/src/visitor/plan_visitor/dispatch.rs:6–520  ·  view source on GitHub ↗
(visitor: &mut V, plan: &SqlPlan)

Source from the content-addressed store, hash-verified

4use crate::types::SqlPlan;
5
6pub fn dispatch<V: PlanVisitor>(visitor: &mut V, plan: &SqlPlan) -> Result<V::Output, V::Error> {
7 match plan {
8 SqlPlan::ConstantResult { columns, values } => visitor.constant_result(columns, values),
9 SqlPlan::Scan {
10 collection,
11 alias,
12 engine,
13 filters,
14 projection,
15 sort_keys,
16 limit,
17 offset,
18 distinct,
19 window_functions,
20 temporal,
21 } => visitor.scan(
22 collection,
23 alias.as_deref(),
24 *engine,
25 filters,
26 projection,
27 sort_keys,
28 *limit,
29 *offset,
30 *distinct,
31 window_functions,
32 temporal,
33 ),
34 SqlPlan::PointGet {
35 collection,
36 alias,
37 engine,
38 key_column,
39 key_value,
40 } => visitor.point_get(collection, alias.as_deref(), *engine, key_column, key_value),
41 SqlPlan::DocumentIndexLookup {
42 collection,
43 alias,
44 engine,
45 field,
46 value,
47 filters,
48 projection,
49 sort_keys,
50 limit,
51 offset,
52 distinct,
53 window_functions,
54 case_insensitive,
55 temporal,
56 } => visitor.document_index_lookup(
57 collection,
58 alias.as_deref(),
59 *engine,
60 field,
61 value,
62 filters,
63 projection,

Callers

nothing calls this directly

Calls 15

range_scanMethod · 0.80
joinMethod · 0.80
aggregateMethod · 0.80
drop_arrayMethod · 0.80
delete_arrayMethod · 0.80
create_indexMethod · 0.80
drop_indexMethod · 0.80
scanMethod · 0.45
as_refMethod · 0.45
insertMethod · 0.45
upsertMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected