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

Method build_get

src/expr-test-util/src/lib.rs:470–495  ·  view source on GitHub ↗
(&self, token: Option<TokenTree>)

Source from the content-addressed store, hash-verified

468 }
469
470 fn build_get(&self, token: Option<TokenTree>) -> Result<MirRelationExpr, String> {
471 match token {
472 Some(TokenTree::Ident(ident)) => {
473 let name = ident.to_string();
474 match self.scope.get(&name) {
475 Some((id, typ)) => Ok(MirRelationExpr::Get {
476 id,
477 typ,
478 access_strategy: AccessStrategy::UnknownOrLocal,
479 }),
480 None => match self.catalog.get(&name) {
481 None => Err(format!("no catalog object named {}", name)),
482 Some((id, typ)) => Ok(MirRelationExpr::Get {
483 id: Id::Global(*id),
484 typ: ReprRelationType::from(typ),
485 access_strategy: AccessStrategy::UnknownOrLocal,
486 }),
487 },
488 }
489 }
490 invalid_token => Err(format!(
491 "Invalid get specification {:?}",
492 invalid_token.map(|token_tree| format!("`{}`", token_tree))
493 )),
494 }
495 }
496
497 fn build_let<I>(&mut self, stream_iter: &mut I) -> Result<MirRelationExpr, String>
498 where

Callers 1

Calls 2

to_stringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected