pub struct AegisClient { /* private fields */ }Expand description
The main client for interacting with Aegis databases.
Implementations§
Source§impl AegisClient
impl AegisClient
Sourcepub async fn new(config: ClientConfig) -> Result<Self, ClientError>
pub async fn new(config: ClientConfig) -> Result<Self, ClientError>
Create a new client with the given configuration.
Sourcepub async fn connect(url: &str) -> Result<Self, ClientError>
pub async fn connect(url: &str) -> Result<Self, ClientError>
Connect to a database with default configuration.
Sourcepub async fn query(&self, sql: &str) -> Result<QueryResult, ClientError>
pub async fn query(&self, sql: &str) -> Result<QueryResult, ClientError>
Execute a query and return results.
Sourcepub async fn query_with_params(
&self,
sql: &str,
params: Vec<Value>,
) -> Result<QueryResult, ClientError>
pub async fn query_with_params( &self, sql: &str, params: Vec<Value>, ) -> Result<QueryResult, ClientError>
Execute a query with parameters.
Sourcepub async fn execute(&self, sql: &str) -> Result<u64, ClientError>
pub async fn execute(&self, sql: &str) -> Result<u64, ClientError>
Execute a statement (INSERT, UPDATE, DELETE).
Sourcepub async fn execute_with_params(
&self,
sql: &str,
params: Vec<Value>,
) -> Result<u64, ClientError>
pub async fn execute_with_params( &self, sql: &str, params: Vec<Value>, ) -> Result<u64, ClientError>
Execute a statement with parameters.
Sourcepub async fn begin(&self) -> Result<Transaction, ClientError>
pub async fn begin(&self) -> Result<Transaction, ClientError>
Start a new transaction.
Sourcepub fn query_builder(&self) -> QueryBuilder
pub fn query_builder(&self) -> QueryBuilder
Create a query builder.
Sourcepub fn pool_stats(&self) -> PoolStats
pub fn pool_stats(&self) -> PoolStats
Get connection pool statistics.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if the client is connected.
Auto Trait Implementations§
impl !Freeze for AegisClient
impl !RefUnwindSafe for AegisClient
impl Send for AegisClient
impl Sync for AegisClient
impl Unpin for AegisClient
impl UnsafeUnpin for AegisClient
impl !UnwindSafe for AegisClient
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