nodedb_lite/query/query_ops/joins/
spec.rs1use nodedb_physical::physical_plan::query::JoinProjection;
5
6pub struct CollectionSide<'a> {
8 pub collection: &'a str,
9 pub alias: Option<&'a str>,
10}
11
12pub struct JoinSpec<'a> {
14 pub on: &'a [(String, String)],
16 pub join_type: &'a str,
17 pub limit: usize,
19 pub projection: &'a [JoinProjection],
20 pub post_filters: &'a [u8],
22}
23
24impl JoinSpec<'_> {
25 pub(super) fn split_keys(&self) -> (Vec<String>, Vec<String>) {
27 let left = self.on.iter().map(|(l, _)| l.clone()).collect();
28 let right = self.on.iter().map(|(_, r)| r.clone()).collect();
29 (left, right)
30 }
31
32 pub(super) fn effective_limit(&self) -> usize {
34 if self.limit == 0 {
35 usize::MAX
36 } else {
37 self.limit
38 }
39 }
40}