MCPcopy Create free account
hub / github.com/PRQL/prql / new_database

Method new_database

prqlc/prqlc/src/semantic/module.rs:43–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 pub fn new_database() -> Module {
44 let names = HashMap::from([
45 (
46 NS_INFER.to_string(),
47 Decl::from(DeclKind::Infer(Box::new(DeclKind::TableDecl(TableDecl {
48 ty: Some(Ty::relation(vec![TyTupleField::Wildcard(None)])),
49 expr: TableExpr::LocalTable,
50 })))),
51 ),
52 (
53 NS_INFER_MODULE.to_string(),
54 Decl::from(DeclKind::Infer(Box::new(DeclKind::Module(Module {
55 names: HashMap::new(),
56 redirects: vec![],
57 shadowed: None,
58 })))),
59 ),
60 ]);
61 Module {
62 names,
63 shadowed: None,
64 redirects: vec![],
65 }
66 }
67
68 pub fn insert(&mut self, fq_ident: Ident, decl: Decl) -> Result<Option<Decl>, Error> {
69 if fq_ident.path.is_empty() {

Callers

nothing calls this directly

Calls 2

ModuleClass · 0.85
TableDeclClass · 0.50

Tested by

no test coverage detected