pub struct DuckDBConnection { /* private fields */ }Expand description
DuckDB connection
Implementations§
Source§impl DuckDBConnection
impl DuckDBConnection
Sourcepub async fn connect(connection_string: &str) -> DatabaseResult<Self>
pub async fn connect(connection_string: &str) -> DatabaseResult<Self>
Connect to a DuckDB database
Sourcepub async fn execute(&self, query: &str) -> DatabaseResult<Recordset>
pub async fn execute(&self, query: &str) -> DatabaseResult<Recordset>
Execute a SELECT query
Sourcepub async fn execute_command(&self, command: &str) -> DatabaseResult<u64>
pub async fn execute_command(&self, command: &str) -> DatabaseResult<u64>
Execute a command
Sourcepub async fn close(&mut self) -> DatabaseResult<()>
pub async fn close(&mut self) -> DatabaseResult<()>
Close the connection
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connected
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DuckDBConnection
impl RefUnwindSafe for DuckDBConnection
impl Send for DuckDBConnection
impl Sync for DuckDBConnection
impl Unpin for DuckDBConnection
impl UnwindSafe for DuckDBConnection
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more