pub struct XDLDatabase { /* private fields */ }Expand description
Main database object for XDL
Implementations§
Source§impl XDLDatabase
impl XDLDatabase
Sourcepub async fn connect(&mut self, connection_string: &str) -> XdlResult<()>
pub async fn connect(&mut self, connection_string: &str) -> XdlResult<()>
Connect to a database using a connection string
Sourcepub async fn disconnect(&mut self) -> XdlResult<()>
pub async fn disconnect(&mut self) -> XdlResult<()>
Disconnect from the database
Sourcepub async fn execute_sql(&self, query: &str) -> XdlResult<Recordset>
pub async fn execute_sql(&self, query: &str) -> XdlResult<Recordset>
Execute a SQL query and return a recordset
Sourcepub async fn execute_command(&self, command: &str) -> XdlResult<u64>
pub async fn execute_command(&self, command: &str) -> XdlResult<u64>
Execute a SQL command (INSERT, UPDATE, DELETE) without returning data
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected
Sourcepub fn database_type(&self) -> Option<&DatabaseType>
pub fn database_type(&self) -> Option<&DatabaseType>
Get the database type
Sourcepub fn last_error(&self) -> Option<&str>
pub fn last_error(&self) -> Option<&str>
Get last error message
Trait Implementations§
Source§impl Debug for XDLDatabase
impl Debug for XDLDatabase
Auto Trait Implementations§
impl Freeze for XDLDatabase
impl !RefUnwindSafe for XDLDatabase
impl Send for XDLDatabase
impl Sync for XDLDatabase
impl Unpin for XDLDatabase
impl !UnwindSafe for XDLDatabase
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