MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_privilege_specification

Method parse_privilege_specification

src/sql-parser/src/parser.rs:10095–10114  ·  view source on GitHub ↗

Parse one or more privileges separated by a ','.

(&mut self)

Source from the content-addressed store, hash-verified

10093
10094 /// Parse one or more privileges separated by a ','.
10095 fn parse_privilege_specification(&mut self) -> Option<PrivilegeSpecification> {
10096 if self.parse_keyword(ALL) {
10097 let _ = self.parse_keyword(PRIVILEGES);
10098 return Some(PrivilegeSpecification::All);
10099 }
10100
10101 let mut privileges = Vec::new();
10102 while let Some(privilege) = self.parse_privilege() {
10103 privileges.push(privilege);
10104 if !self.consume_token(&Token::Comma) {
10105 break;
10106 }
10107 }
10108
10109 if privileges.is_empty() {
10110 None
10111 } else {
10112 Some(PrivilegeSpecification::Privileges(privileges))
10113 }
10114 }
10115
10116 /// Bail out if the current token is not a role specification, or consume and return it if it is.
10117 fn expect_role_specification(&mut self) -> Result<Ident, ParserError> {

Callers 3

parse_grantMethod · 0.80
parse_revokeMethod · 0.80

Calls 6

PrivilegesClass · 0.85
parse_keywordMethod · 0.80
parse_privilegeMethod · 0.80
consume_tokenMethod · 0.80
pushMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected