| 154 | } |
| 155 | |
| 156 | fn relationship_definition(input: &str) -> IResult<&str, RelationshipDefinition> { |
| 157 | map( |
| 158 | tuple(( |
| 159 | ws(identifier), |
| 160 | ws(tag("as")), |
| 161 | delimited( |
| 162 | ws(char('(')), |
| 163 | separated_list1(ws(char(',')), role), |
| 164 | ws(char(')')), |
| 165 | ), |
| 166 | opt(preceded( |
| 167 | ws(char(',')), |
| 168 | separated_list0(ws(char(',')), attribute), |
| 169 | )), |
| 170 | ws(char(';')), |
| 171 | )), |
| 172 | |(name, _, roles, attributes, _)| RelationshipDefinition { |
| 173 | name: name.to_string(), |
| 174 | roles, |
| 175 | attributes: attributes.unwrap_or_default(), |
| 176 | }, |
| 177 | )(input) |
| 178 | } |
| 179 | |
| 180 | // DML Parsers |
| 181 | |