pub struct ClientContext { /* private fields */ }Expand description
RAII wrapper for a duckdb_client_context.
Provides access to the connection’s catalog, configuration, and file system. Automatically destroyed when dropped.
Implementations§
Source§impl ClientContext
impl ClientContext
Sourcepub unsafe fn from_connection(
con: duckdb_connection,
) -> Result<Self, ExtensionError>
pub unsafe fn from_connection( con: duckdb_connection, ) -> Result<Self, ExtensionError>
Sourcepub const unsafe fn from_raw(ctx: duckdb_client_context) -> Self
pub const unsafe fn from_raw(ctx: duckdb_client_context) -> Self
Wrap a raw duckdb_client_context handle.
§Safety
ctx must be a valid, non-null duckdb_client_context.
Sourcepub const fn as_raw(&self) -> duckdb_client_context
pub const fn as_raw(&self) -> duckdb_client_context
Returns the raw handle.
Sourcepub unsafe fn catalog(&self, name: &CStr) -> Option<Catalog>
pub unsafe fn catalog(&self, name: &CStr) -> Option<Catalog>
Retrieves a database catalog by name.
Pass an empty string to get the default catalog. This function can only be called from within an active transaction (e.g. during a registered function callback).
§Safety
Must be called from within an active transaction context.
Sourcepub fn config_option(&self, name: &CStr) -> Option<String>
pub fn config_option(&self, name: &CStr) -> Option<String>
Retrieves a configuration option value by name.
Returns the value as a string, or None if the option does not exist.
Sourcepub fn connection_id(&self) -> u64
pub fn connection_id(&self) -> u64
Returns the connection ID associated with this client context.
Trait Implementations§
Source§impl Drop for ClientContext
impl Drop for ClientContext
Auto Trait Implementations§
impl Freeze for ClientContext
impl RefUnwindSafe for ClientContext
impl !Send for ClientContext
impl !Sync for ClientContext
impl Unpin for ClientContext
impl UnsafeUnpin for ClientContext
impl UnwindSafe for ClientContext
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