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
| 66 | /// Callers propagate this up so the pgwire layer can retry |
| 67 | /// the whole statement. |
| 68 | pub 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; |
no outgoing calls
no test coverage detected