| 249 | } |
| 250 | |
| 251 | fn relationship_insertion(input: &str) -> IResult<&str, RelationshipInsertion> { |
| 252 | map( |
| 253 | tuple(( |
| 254 | ws(char('$')), |
| 255 | ws(identifier), |
| 256 | delimited( |
| 257 | ws(char('(')), |
| 258 | separated_list1(ws(char(',')), role_assignment), |
| 259 | ws(char(')')), |
| 260 | ), |
| 261 | ws(tag("forms")), |
| 262 | ws(identifier), |
| 263 | opt(delimited( |
| 264 | ws(char('(')), |
| 265 | separated_list0(ws(char(',')), attribute_value), |
| 266 | ws(char(')')), |
| 267 | )), |
| 268 | ws(char(';')), |
| 269 | )), |
| 270 | |(_, variable, roles, _, relationship_type, attributes, _)| RelationshipInsertion { |
| 271 | variable: variable.to_string(), |
| 272 | roles, |
| 273 | relationship_type: relationship_type.to_string(), |
| 274 | attributes: attributes.unwrap_or_default(), |
| 275 | }, |
| 276 | )(input) |
| 277 | } |
| 278 | |
| 279 | // Query Parsers |
| 280 | |