Loading crates/query-engine/src/enforce.rs +6 −52 Original line number Diff line number Diff line Loading @@ -175,7 +175,6 @@ mod tests { fn test_input() -> Input { Input { query_type: QueryType::Traversal, nodes: vec![ InputNode { id: "u".to_string(), Loading @@ -190,15 +189,7 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() } } Loading Loading @@ -324,20 +315,11 @@ mod tests { #[test] fn skips_nodes_without_entity() { let input = Input { query_type: QueryType::Traversal, nodes: vec![InputNode { id: "n".to_string(), ..Default::default() }], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -405,7 +387,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![InputAggregation { function: AggFunction::Count, target: Some("n".to_string()), Loading @@ -413,13 +394,8 @@ mod tests { property: None, alias: Some("note_count".to_string()), }], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -493,7 +469,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![InputAggregation { function: AggFunction::Count, target: Some("mr".to_string()), Loading @@ -501,13 +476,7 @@ mod tests { property: None, alias: Some("mr_count".to_string()), }], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -546,7 +515,6 @@ mod tests { })); let input = Input { query_type: QueryType::Traversal, nodes: vec![ InputNode { id: "d".to_string(), Loading @@ -562,15 +530,8 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let ctx = enforce_return(&mut node, &input).unwrap(); Loading Loading @@ -621,8 +582,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: Some(InputPath { path_type: crate::input::PathType::Shortest, from: "start".to_string(), Loading @@ -630,12 +589,7 @@ mod tests { max_depth: 3, rel_types: vec![], }), neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; // Path finding generates a Query with unrolled CTEs Loading crates/query-engine/src/input.rs +18 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,24 @@ pub struct Input { pub entity_auth: HashMap<String, EntityAuthConfig>, } impl Default for Input { fn default() -> Self { Self { query_type: QueryType::Traversal, nodes: vec![], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: default_limit(), range: None, order_by: None, aggregation_sort: None, entity_auth: HashMap::new(), } } } fn deserialize_nodes_or_node<'de, D>(deserializer: D) -> Result<Vec<InputNode>, D::Error> where D: Deserializer<'de>, Loading crates/query-engine/src/lower.rs +1 −7 Original line number Diff line number Diff line Loading @@ -1461,19 +1461,13 @@ mod tests { node_ids: vec![123], ..Default::default() }], relationships: vec![], aggregations: vec![], path: None, neighbors: Some(InputNeighbors { node: "u".to_string(), direction: Direction::Outgoing, rel_types: vec![], }), limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let Node::Query(q) = lower(&input).unwrap() else { Loading Loading
crates/query-engine/src/enforce.rs +6 −52 Original line number Diff line number Diff line Loading @@ -175,7 +175,6 @@ mod tests { fn test_input() -> Input { Input { query_type: QueryType::Traversal, nodes: vec![ InputNode { id: "u".to_string(), Loading @@ -190,15 +189,7 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() } } Loading Loading @@ -324,20 +315,11 @@ mod tests { #[test] fn skips_nodes_without_entity() { let input = Input { query_type: QueryType::Traversal, nodes: vec![InputNode { id: "n".to_string(), ..Default::default() }], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -405,7 +387,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![InputAggregation { function: AggFunction::Count, target: Some("n".to_string()), Loading @@ -413,13 +394,8 @@ mod tests { property: None, alias: Some("note_count".to_string()), }], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -493,7 +469,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![InputAggregation { function: AggFunction::Count, target: Some("mr".to_string()), Loading @@ -501,13 +476,7 @@ mod tests { property: None, alias: Some("mr_count".to_string()), }], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let query = Query { Loading Loading @@ -546,7 +515,6 @@ mod tests { })); let input = Input { query_type: QueryType::Traversal, nodes: vec![ InputNode { id: "d".to_string(), Loading @@ -562,15 +530,8 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let ctx = enforce_return(&mut node, &input).unwrap(); Loading Loading @@ -621,8 +582,6 @@ mod tests { ..Default::default() }, ], relationships: vec![], aggregations: vec![], path: Some(InputPath { path_type: crate::input::PathType::Shortest, from: "start".to_string(), Loading @@ -630,12 +589,7 @@ mod tests { max_depth: 3, rel_types: vec![], }), neighbors: None, limit: 30, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; // Path finding generates a Query with unrolled CTEs Loading
crates/query-engine/src/input.rs +18 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,24 @@ pub struct Input { pub entity_auth: HashMap<String, EntityAuthConfig>, } impl Default for Input { fn default() -> Self { Self { query_type: QueryType::Traversal, nodes: vec![], relationships: vec![], aggregations: vec![], path: None, neighbors: None, limit: default_limit(), range: None, order_by: None, aggregation_sort: None, entity_auth: HashMap::new(), } } } fn deserialize_nodes_or_node<'de, D>(deserializer: D) -> Result<Vec<InputNode>, D::Error> where D: Deserializer<'de>, Loading
crates/query-engine/src/lower.rs +1 −7 Original line number Diff line number Diff line Loading @@ -1461,19 +1461,13 @@ mod tests { node_ids: vec![123], ..Default::default() }], relationships: vec![], aggregations: vec![], path: None, neighbors: Some(InputNeighbors { node: "u".to_string(), direction: Direction::Outgoing, rel_types: vec![], }), limit: 10, range: None, order_by: None, aggregation_sort: None, entity_auth: Default::default(), ..Input::default() }; let Node::Query(q) = lower(&input).unwrap() else { Loading