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

Method parse_grant_privilege

src/sql-parser/src/parser.rs:9557–9570  ·  view source on GitHub ↗

Parse a `GRANT PRIVILEGE` statement, assuming that the `GRANT` token and all privileges have already been consumed.

(
        &mut self,
        privileges: PrivilegeSpecification,
    )

Source from the content-addressed store, hash-verified

9555 /// Parse a `GRANT PRIVILEGE` statement, assuming that the `GRANT` token
9556 /// and all privileges have already been consumed.
9557 fn parse_grant_privilege(
9558 &mut self,
9559 privileges: PrivilegeSpecification,
9560 ) -> Result<Statement<Raw>, ParserError> {
9561 self.expect_keyword(ON)?;
9562 let target = self.expect_grant_target_specification("GRANT")?;
9563 self.expect_keyword(TO)?;
9564 let roles = self.parse_comma_separated(Parser::expect_role_specification)?;
9565 Ok(Statement::GrantPrivileges(GrantPrivilegesStatement {
9566 privileges,
9567 target,
9568 roles,
9569 }))
9570 }
9571
9572 /// Parse a `GRANT ROLE` statement, assuming that the `GRANT` token
9573 /// has already been consumed.

Callers 1

parse_grantMethod · 0.80

Calls 3

expect_keywordMethod · 0.80
parse_comma_separatedMethod · 0.80

Tested by

no test coverage detected