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

Method fold_role_name

src/sql/src/names.rs:2056–2073  ·  view source on GitHub ↗
(&mut self, name: <Raw as AstInfo>::RoleName)

Source from the content-addressed store, hash-verified

2054 }
2055
2056 fn fold_role_name(&mut self, name: <Raw as AstInfo>::RoleName) -> <Aug as AstInfo>::RoleName {
2057 match self.catalog.resolve_role(name.as_str()) {
2058 Ok(role) => ResolvedRoleName {
2059 id: role.id(),
2060 name: role.name().to_string(),
2061 },
2062 Err(e) => {
2063 if self.status.is_ok() {
2064 self.status = Err(e.into());
2065 }
2066 // garbage value that will be ignored since there's an error.
2067 ResolvedRoleName {
2068 id: RoleId::User(0),
2069 name: "".to_string(),
2070 }
2071 }
2072 }
2073 }
2074
2075 fn fold_network_policy_name(
2076 &mut self,

Callers 1

fold_object_nameMethod · 0.80

Calls 6

UserClass · 0.50
resolve_roleMethod · 0.45
as_strMethod · 0.45
idMethod · 0.45
to_stringMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected