1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! MeshDB SDK surface — federated query plane above the
//! substrate's chains.
//!
//! Pulls the consumer-relevant types up to
//! `net_sdk::meshdb::*` so tenant tooling (and a future Deck
//! MeshDB Console) doesn't have to reach into
//! `net::adapter::net::behavior::meshdb::*` directly.
//!
//! # Scope
//!
//! Three layers are re-exported:
//!
//! - **AST + helpers** (`MeshQuery`, `QueryV1`, `ChainRef`,
//! `SeqNum`, plus the supporting expression / aggregate /
//! ordering / window / join types). Consumers build queries
//! by composing AST nodes; the executor walks them.
//! - **Executor surface** (`MeshQueryExecutor` async trait,
//! `LocalMeshQueryExecutor` implementation, `ChainReader`
//! trait, `RunningQuery` / `ResultStream` / `QueryHandle`).
//! Consumers wire their own `ChainReader` over a RedEX
//! handle (or in-memory fixture) and pass plans through the
//! executor.
//! - **Error + result-row types** (`MeshError`, `BudgetMetric`,
//! `ResultRow`, the typed result-payload enums).
//!
//! # Not re-exported
//!
//! - **Federated transport.** `FederatedMeshQueryExecutor` +
//! `MeshDbTransport` are substrate-internal — the wire
//! protocol is opaque to consumers; cross-node fan-out is
//! the executor's job, not the consumer's. Tenant tools
//! that need direct transport access depend on `net` with
//! the `meshdb` feature.
//! - **Wire protocol.** `MeshDbRequest` / `MeshDbResponse` /
//! `MeshDbFrame` / `SUBPROTOCOL_MESHDB` are substrate-
//! internal. The executor handles framing on the consumer's
//! behalf.
//! - **Planner internals.** `MeshQueryPlanner`, `ExecutionPlan`
//! internals, `OperatorPlan`, etc. Consumers call
//! `executor.execute(plan)`; the planner is exposed only
//! far enough to construct a plan from a `MeshQuery`.
//! - **Cache primitives.** `LruResultCache` + `CachePolicy`
//! are re-exported because consumers tuning caching matters,
//! but the cache trait machinery stays substrate-internal.
//!
//! # Activation
//!
//! Gated behind `--features meshdb` on the SDK. Composes
//! against `net/meshdb` (which itself gates the substrate-side
//! Phase A skeleton). MeshDB is documented as needing a
//! consumer to drive its semantics (`MESHDB_PLAN.md` § Status);
//! exposing the SDK surface lets tenant tooling start building
//! against the types ahead of the Deck consumer slice.
pub use ;