Struct sqlx_exasol::ExaConnection
source · pub struct ExaConnection { /* private fields */ }Expand description
A connection to the Exasol database.
Implementations§
source§impl ExaConnection
impl ExaConnection
sourcepub fn socket_addr(&self) -> SocketAddr
pub fn socket_addr(&self) -> SocketAddr
Returns the socket address that we’re connected to.
sourcepub fn attributes(&self) -> &ExaAttributes
pub fn attributes(&self) -> &ExaAttributes
Returns a reference of the ExaAttributes used in this connection.
sourcepub fn attributes_mut(&mut self) -> &mut ExaAttributes
pub fn attributes_mut(&mut self) -> &mut ExaAttributes
Allows setting connection attributes through the driver.
Note that attributes will only reach Exasol after a statement is
executed or after explicitly calling the flush_attributes() method.
sourcepub async fn flush_attributes(&mut self) -> Result<(), SqlxError>
pub async fn flush_attributes(&mut self) -> Result<(), SqlxError>
Flushes the current ExaAttributes to Exasol.
Errors
Will return an error if sending the attributes fails.
sourcepub fn session_info(&self) -> &SessionInfo
pub fn session_info(&self) -> &SessionInfo
Returns a reference to the SessionInfo related to this connection.
Trait Implementations§
source§impl<'c> Acquire<'c> for &'c mut ExaConnection
impl<'c> Acquire<'c> for &'c mut ExaConnection
source§impl Connection for ExaConnection
impl Connection for ExaConnection
type Database = Exasol
type Options = ExaConnectOptions
source§fn close(self) -> BoxFuture<'static, Result<(), SqlxError>>
fn close(self) -> BoxFuture<'static, Result<(), SqlxError>>
Explicitly close this database connection. Read more
source§fn ping(&mut self) -> BoxFuture<'_, Result<(), SqlxError>>
fn ping(&mut self) -> BoxFuture<'_, Result<(), SqlxError>>
Checks if a connection to the database is still valid.
source§fn begin(
&mut self
) -> BoxFuture<'_, Result<Transaction<'_, Self::Database>, SqlxError>>where
Self: Sized,
fn begin( &mut self ) -> BoxFuture<'_, Result<Transaction<'_, Self::Database>, SqlxError>>where Self: Sized,
Begin a new transaction or establish a savepoint within the active transaction. Read more
source§fn shrink_buffers(&mut self)
fn shrink_buffers(&mut self)
Restore any buffers in the connection to their default capacity, if possible. Read more
source§fn cached_statements_size(&self) -> usizewhere
Self::Database: HasStatementCache,
fn cached_statements_size(&self) -> usizewhere Self::Database: HasStatementCache,
The number of statements currently cached in the connection.
source§fn clear_cached_statements(&mut self) -> BoxFuture<'_, Result<(), SqlxError>>where
Self::Database: HasStatementCache,
fn clear_cached_statements(&mut self) -> BoxFuture<'_, Result<(), SqlxError>>where Self::Database: HasStatementCache,
Removes all statements from the cache, closing them on the server if
needed.
source§fn transaction<'a, F, R, E>(
&'a mut self,
callback: F
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'a>>where
F: for<'c> FnOnce(&'c mut Transaction<'_, Self::Database>) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'c>> + 'a + for<'c> Send + for<'c> Sync,
Self: Sized,
R: Send,
E: From<Error> + Send,
fn transaction<'a, F, R, E>( &'a mut self, callback: F ) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'a>>where F: for<'c> FnOnce(&'c mut Transaction<'_, Self::Database>) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'c>> + 'a + for<'c> Send + for<'c> Sync, Self: Sized, R: Send, E: From<Error> + Send,
Execute the function inside a transaction. Read more
source§impl Debug for ExaConnection
impl Debug for ExaConnection
source§impl<'c> Executor<'c> for &'c mut ExaConnection
impl<'c> Executor<'c> for &'c mut ExaConnection
type Database = Exasol
source§fn fetch_many<'e, 'q: 'e, E>(
self,
query: E
) -> BoxStream<'e, Result<Either<<Self::Database as Database>::QueryResult, <Self::Database as Database>::Row>, SqlxError>>where
E: Execute<'q, Self::Database> + 'q,
'c: 'e,
fn fetch_many<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<Either<<Self::Database as Database>::QueryResult, <Self::Database as Database>::Row>, SqlxError>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,
Execute multiple queries and return the generated results as a stream
from each query, in a stream.
source§fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E
) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>, SqlxError>>where
E: Execute<'q, Self::Database> + 'q,
'c: 'e,
fn fetch_optional<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>, SqlxError>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,
Execute the query and returns at most one row.
source§fn prepare_with<'e, 'q: 'e>(
self,
sql: &'q str,
_parameters: &'e [<Self::Database as Database>::TypeInfo]
) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, SqlxError>>where
'c: 'e,
fn prepare_with<'e, 'q: 'e>( self, sql: &'q str, _parameters: &'e [<Self::Database as Database>::TypeInfo] ) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, SqlxError>>where 'c: 'e,
Prepare the SQL query, with parameter type information, to inspect the
type information about its parameters and results. Read more
source§fn execute<'e, 'q, E>(
self,
query: E
) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn execute<'e, 'q, E>( self, query: E ) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where 'q: 'e, 'c: 'e, E: 'q + Execute<'q, Self::Database>,
Execute the query and return the total number of rows affected.
source§fn execute_many<'e, 'q, E>(
self,
query: E
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn execute_many<'e, 'q, E>( self, query: E ) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where 'q: 'e, 'c: 'e, E: 'q + Execute<'q, Self::Database>,
Execute multiple queries and return the rows affected from each query, in a stream.
source§fn fetch<'e, 'q, E>(
self,
query: E
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn fetch<'e, 'q, E>( self, query: E ) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>where 'q: 'e, 'c: 'e, E: 'q + Execute<'q, Self::Database>,
Execute the query and return the generated results as a stream.
source§fn fetch_all<'e, 'q, E>(
self,
query: E
) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn fetch_all<'e, 'q, E>( self, query: E ) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>where 'q: 'e, 'c: 'e, E: 'q + Execute<'q, Self::Database>,
Execute the query and return all the generated results, collected into a
Vec.Auto Trait Implementations§
impl !RefUnwindSafe for ExaConnection
impl Send for ExaConnection
impl Sync for ExaConnection
impl Unpin for ExaConnection
impl !UnwindSafe for ExaConnection
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