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

Function unresolved_schema_name

src/sql/src/normalize.rs:70–86  ·  view source on GitHub ↗

Normalizes an unresolved schema name.

(
    mut name: UnresolvedSchemaName,
)

Source from the content-addressed store, hash-verified

68
69/// Normalizes an unresolved schema name.
70pub fn unresolved_schema_name(
71 mut name: UnresolvedSchemaName,
72) -> Result<PartialSchemaName, PlanError> {
73 if name.0.len() < 1 || name.0.len() > 2 {
74 return Err(PlanError::MisqualifiedName(name.to_string()));
75 }
76 let out = PartialSchemaName {
77 schema: ident(
78 name.0
79 .pop()
80 .expect("name checked to have at least one component"),
81 ),
82 database: name.0.pop().map(ident),
83 };
84 assert!(name.0.is_empty());
85 Ok(out)
86}
87
88/// Normalizes an operator reference.
89///

Callers 6

fold_schema_nameMethod · 0.85
resolve_schemaMethod · 0.85
plan_alter_schema_ownerFunction · 0.85
plan_drop_schemaFunction · 0.85
plan_alter_schema_renameFunction · 0.85
plan_alter_schema_swapFunction · 0.85

Calls 6

identFunction · 0.85
expectMethod · 0.80
lenMethod · 0.45
to_stringMethod · 0.45
popMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected