MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / SqlCatalog

Interface SqlCatalog

nodedb-sql/src/catalog.rs:68–88  ·  view source on GitHub ↗

Trait for looking up collection metadata during planning. Both Origin (via CredentialStore) and Lite (via the embedded redb catalog) implement this trait. The return type is `Result , _>` with a three-way semantics: - `Ok(Some(info))` — the collection exists and is usable. An Origin implementation will have acquired a descriptor lease at the current version before returnin

Source from the content-addressed store, hash-verified

66/// Callers propagate this up so the pgwire layer can retry
67/// the whole statement.
68pub trait SqlCatalog {
69 fn get_collection(
70 &self,
71 database_id: DatabaseId,
72 name: &str,
73 ) -> Result<Option<CollectionInfo>, SqlCatalogError>;
74
75 /// Look up an array by name. Returns `None` if no array with that
76 /// name is registered. The default implementation returns `None` so
77 /// that catalog adapters predating array support compile without
78 /// change — the array DML planner falls back to "array not found"
79 /// in that case.
80 fn lookup_array(&self, _name: &str) -> Option<ArrayCatalogView> {
81 None
82 }
83
84 /// Cheap existence check; the default delegates to `lookup_array`.
85 fn array_exists(&self, name: &str) -> bool {
86 self.lookup_array(name).is_some()
87 }
88}
89
90/// View of a registered array, surfaced to the SQL planner. Decoded by
91/// the runtime catalog adapter from its persisted msgpack schema blob;

Callers 2

array_existsMethod · 0.45
require_array_nameFunction · 0.45

Implementers 8

array_dml.rsnodedb-sql/src/planner/array_dml.rs
tests.rsnodedb-sql/src/planner/array_fn/tests.
entry_ann.rsnodedb-sql/src/planner/select/entry_an
tests.rsnodedb-sql/src/planner/select/tests.rs
entry.rsnodedb-sql/src/planner/select/entry.rs
schema_qualified_rejection.rsnodedb-sql/tests/schema_qualified_reje
catalog_adapter.rsnodedb/src/control/planner/catalog_ada
test_group_by_alias.rsnodedb/tests/executor_tests/test_group

Calls

no outgoing calls

Tested by

no test coverage detected