pub struct Catalog { /* private fields */ }Expand description
RAII wrapper for a duckdb_catalog.
Automatically destroyed when dropped.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub const fn as_raw(&self) -> duckdb_catalog
pub const fn as_raw(&self) -> duckdb_catalog
Returns the raw handle for use with CatalogEntry::lookup.
Sourcepub fn type_name(&self) -> Option<&str>
pub fn type_name(&self) -> Option<&str>
Returns the type name of this catalog: "duckdb" for every catalog
DuckDB provides itself (the database’s, temp and system), or a
storage extension’s name like "sqlite".
Returns None if the name is not valid UTF-8.
Sourcepub unsafe fn get_entry(
&self,
context: duckdb_client_context,
schema: &CStr,
name: &CStr,
entry_type: CatalogEntryType,
) -> Result<Option<CatalogEntry>, ExtensionError>
pub unsafe fn get_entry( &self, context: duckdb_client_context, schema: &CStr, name: &CStr, entry_type: CatalogEntryType, ) -> Result<Option<CatalogEntry>, ExtensionError>
Look up a catalog entry by type, schema, and name.
Returns Ok(None) if no such entry exists.
§Errors
Returns an error, without calling DuckDB, for a lookup that would
abort the process; see CatalogEntry::lookup.
§Safety
contextmust be a validduckdb_client_context.- Must be called from within an active transaction context.
- The database this catalog belongs to must still be attached, and the
transaction in which
ClientContext::catalogreturned it must still be active. Aduckdb_catalogis a plain reference toDuckDB’sCatalog(CCatalogWrapper,catalog-c.cpp): after aDETACH, a lookup through it read freed memory and crashed in testing.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Catalog
impl !Sync for Catalog
impl Freeze for Catalog
impl RefUnwindSafe for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
impl UnwindSafe for Catalog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more