pub struct AsyncConnection { /* private fields */ }Expand description
Async version of Connection following vertica-sql-go patterns
Implementations§
Source§impl AsyncConnection
impl AsyncConnection
Sourcepub async fn new(config: ConnectionConfig) -> Result<Self>
pub async fn new(config: ConnectionConfig) -> Result<Self>
Create a new async connection
Sourcepub async fn new_from_url(url: &str) -> Result<Self>
pub async fn new_from_url(url: &str) -> Result<Self>
Create a new async connection from URL
Sourcepub async fn simple_query(&mut self, query: &str) -> Result<QueryResult>
pub async fn simple_query(&mut self, query: &str) -> Result<QueryResult>
Async simple query
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
Get connection state
Sourcepub fn parameters(&self) -> &HashMap<String, String>
pub fn parameters(&self) -> &HashMap<String, String>
Get server parameters
Sourcepub async fn prepare(&mut self, stmt_id: &str, query: &str) -> Result<()>
pub async fn prepare(&mut self, stmt_id: &str, query: &str) -> Result<()>
Prepare a SQL statement - 修复实现,更健壮地处理非标准响应
Sourcepub async fn execute_prepared(
&mut self,
statement_id: &str,
params: &[Value],
) -> Result<QueryResult>
pub async fn execute_prepared( &mut self, statement_id: &str, params: &[Value], ) -> Result<QueryResult>
Execute prepared statement
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncConnection
impl RefUnwindSafe for AsyncConnection
impl Send for AsyncConnection
impl Sync for AsyncConnection
impl Unpin for AsyncConnection
impl UnwindSafe for AsyncConnection
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