Struct mysql_async_support_rt::QueryRunner [−][src]
pub struct QueryRunner { pub sql_over_ssh: SqlOverSsh, pub ssh_concurrent_limit: usize, pub tunnels_per_ssh_connection: usize, }
Expand description
Runs queries for one or more query targets.
Fields
sql_over_ssh: SqlOverSsh
Runs SQL over an SSH connection.
ssh_concurrent_limit: usize
Maximum number of SSH connections to run concurrently.
tunnels_per_ssh_connection: usize
Maximum number of tunnels per SSH connection.
Implementations
Maximum number of tunnels per SSH connection.
Maximum number of tunnels per SSH connection.
Returns a new QueryRunner
with the given connection limits.
pub async fn query<T>(
&self,
jump_host_address: &HostAddress<'_>,
jump_host_auth_params: &JumpHostAuthParams<'_>,
query_target: &QueryTarget<'_>,
sql_text: &str
) -> Result<QueryResult<T>, Error> where
T: FromRow + Send + 'static,
pub async fn query<T>(
&self,
jump_host_address: &HostAddress<'_>,
jump_host_auth_params: &JumpHostAuthParams<'_>,
query_target: &QueryTarget<'_>,
sql_text: &str
) -> Result<QueryResult<T>, Error> where
T: FromRow + Send + 'static,
Queries a database over an SSH connection.
pub async fn query_multi<T>(
&self,
jump_host_address: &HostAddress<'_>,
jump_host_auth_params: &JumpHostAuthParams<'_>,
query_targets: &[QueryTarget<'_>],
sql_text: &str
) -> (Vec<QueryResult<T>>, Vec<QueryError>) where
T: FromRow + Send + 'static,
pub async fn query_multi<T>(
&self,
jump_host_address: &HostAddress<'_>,
jump_host_auth_params: &JumpHostAuthParams<'_>,
query_targets: &[QueryTarget<'_>],
sql_text: &str
) -> (Vec<QueryResult<T>>, Vec<QueryError>) where
T: FromRow + Send + 'static,
Queries multiple query targets with the same query.
pub async fn exec_multi<'f, Queries>(
&'f self,
jump_host_address: HostAddress<'f>,
jump_host_auth_params: JumpHostAuthParams<'f>,
query_targets: &'f [QueryTarget<'f>],
queries: Queries
) -> (Vec<(&'f QueryTarget<'f>, <Queries as FnWithPool<'f>>::Output)>, Vec<(&'f QueryTarget<'f>, <Queries as FnWithPool<'f>>::Error)>) where
Queries: FnWithPool<'f> + Copy,
<Queries as FnWithPool<'f>>::Error: From<Error>,
pub async fn exec_multi<'f, Queries>(
&'f self,
jump_host_address: HostAddress<'f>,
jump_host_auth_params: JumpHostAuthParams<'f>,
query_targets: &'f [QueryTarget<'f>],
queries: Queries
) -> (Vec<(&'f QueryTarget<'f>, <Queries as FnWithPool<'f>>::Output)>, Vec<(&'f QueryTarget<'f>, <Queries as FnWithPool<'f>>::Error)>) where
Queries: FnWithPool<'f> + Copy,
<Queries as FnWithPool<'f>>::Error: From<Error>,
Queries multiple query targets with the same query.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QueryRunner
impl Send for QueryRunner
impl Sync for QueryRunner
impl Unpin for QueryRunner
impl UnwindSafe for QueryRunner
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V