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

Function unresolved_item_name

src/sql/src/normalize.rs:52–67  ·  view source on GitHub ↗

Normalizes an unresolved object name.

(mut name: UnresolvedItemName)

Source from the content-addressed store, hash-verified

50
51/// Normalizes an unresolved object name.
52pub fn unresolved_item_name(mut name: UnresolvedItemName) -> Result<PartialItemName, PlanError> {
53 if name.0.len() < 1 || name.0.len() > 3 {
54 return Err(PlanError::MisqualifiedName(name.to_string()));
55 }
56 let out = PartialItemName {
57 item: ident(
58 name.0
59 .pop()
60 .expect("name checked to have at least one component"),
61 ),
62 schema: name.0.pop().map(ident),
63 database: name.0.pop().map(ident),
64 };
65 assert!(name.0.is_empty());
66 Ok(out)
67}
68
69/// Normalizes an unresolved schema name.
70pub fn unresolved_schema_name(

Callers 15

source_export_name_genFunction · 0.85
purify_create_sourceFunction · 0.85
create_statementFunction · 0.85
resolve_data_typeMethod · 0.85
resolve_itemMethod · 0.85
resolve_functionMethod · 0.85
expand_select_itemFunction · 0.85
plan_identifierFunction · 0.85
plan_create_tableFunction · 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