MCPcopy Create free account
hub / github.com/cosdata/cosdata / relationship_pattern

Function relationship_pattern

org/src/cosql.rs:318–342  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

316}
317
318fn relationship_pattern(input: &str) -> IResult<&str, Pattern> {
319 map(
320 tuple((
321 opt(tuple((ws(char('$')), ws(identifier)))),
322 delimited(
323 ws(char('(')),
324 separated_list1(ws(char(',')), role_assignment),
325 ws(char(')')),
326 ),
327 ws(tag("forms")),
328 ws(identifier),
329 opt(delimited(
330 ws(char('(')),
331 separated_list0(ws(char(',')), attribute_value),
332 ws(char(')')),
333 )),
334 )),
335 |(variable, roles, _, relationship_type, attributes)| Pattern::RelationshipPattern {
336 variable: variable.map(|(_, v)| v.to_string()),
337 roles,
338 relationship_type: relationship_type.to_string(),
339 attributes: attributes.unwrap_or_default(),
340 },
341 )(input)
342}
343
344#[derive(Debug, Clone)]
345struct Query {

Callers

nothing calls this directly

Calls 1

wsFunction · 0.70

Tested by

no test coverage detected