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

Method parse_privilege

src/sql-parser/src/parser.rs:10065–10092  ·  view source on GitHub ↗

Look for a privilege and return it if it matches.

(&mut self)

Source from the content-addressed store, hash-verified

10063
10064 /// Look for a privilege and return it if it matches.
10065 fn parse_privilege(&mut self) -> Option<Privilege> {
10066 Some(
10067 match self.parse_one_of_keywords(&[
10068 INSERT,
10069 SELECT,
10070 UPDATE,
10071 DELETE,
10072 USAGE,
10073 CREATE,
10074 CREATEROLE,
10075 CREATEDB,
10076 CREATECLUSTER,
10077 CREATENETWORKPOLICY,
10078 ])? {
10079 INSERT => Privilege::INSERT,
10080 SELECT => Privilege::SELECT,
10081 UPDATE => Privilege::UPDATE,
10082 DELETE => Privilege::DELETE,
10083 USAGE => Privilege::USAGE,
10084 CREATE => Privilege::CREATE,
10085 CREATEROLE => Privilege::CREATEROLE,
10086 CREATEDB => Privilege::CREATEDB,
10087 CREATECLUSTER => Privilege::CREATECLUSTER,
10088 CREATENETWORKPOLICY => Privilege::CREATENETWORKPOLICY,
10089 _ => unreachable!(),
10090 },
10091 )
10092 }
10093
10094 /// Parse one or more privileges separated by a ','.
10095 fn parse_privilege_specification(&mut self) -> Option<PrivilegeSpecification> {

Callers 1

Calls 1

parse_one_of_keywordsMethod · 0.80

Tested by

no test coverage detected