pub struct Client { /* private fields */ }
Expand description
Client represents a single duckdb connection that can be used from async contexts.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn conn<F, T>(&self, func: F) -> Result<T, Error>
pub async fn conn<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a duckdb::Connection
.
Sourcepub async fn conn_mut<F, T>(&self, func: F) -> Result<T, Error>
pub async fn conn_mut<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a mutable duckdb::Connection
.
Sourcepub async fn close(&self) -> Result<(), Error>
pub async fn close(&self) -> Result<(), Error>
Closes the underlying duckdb connection.
After this method returns, all calls to self::conn()
or
self::conn_mut()
will return an Error::Closed
error.
Sourcepub fn conn_blocking<F, T>(&self, func: F) -> Result<T, Error>
pub fn conn_blocking<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a duckdb::Connection
, blocking
the current thread until completion.
Sourcepub fn conn_mut_blocking<F, T>(&self, func: F) -> Result<T, Error>
pub fn conn_mut_blocking<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a mutable duckdb::Connection
,
blocking the current thread until completion.
Sourcepub fn close_blocking(&self) -> Result<(), Error>
pub fn close_blocking(&self) -> Result<(), Error>
Closes the underlying duckdb connection, blocking the current thread until complete.
After this method returns, all calls to self::conn_blocking()
or
self::conn_mut_blocking()
will return an Error::Closed
error.