Trait mysql_async::prelude::BatchQuery
source · pub trait BatchQuery {
// Required method
fn batch<'a, 't: 'a, C>(self, conn: C) -> BoxFuture<'a, Result<()>>
where Self: 'a,
C: ToConnection<'a, 't> + 'a;
}
Expand description
Helper trait for batch statement execution.
This trait covers the Queryable::exec_batch
method.
Example:
use mysql_async::*;
use mysql_async::prelude::*;
let pool = Pool::new(get_opts());
// This will prepare `DO ?` and execute `DO 0`, `DO 1`, `DO 2` and so on.
"DO ?"
.with((0..10).map(|x| (x,)))
.batch(&pool)
.await?;
Required Methods§
fn batch<'a, 't: 'a, C>(self, conn: C) -> BoxFuture<'a, Result<()>>where Self: 'a, C: ToConnection<'a, 't> + 'a,
Object Safety§
This trait is not object safe.