[][src]Trait mysql::prelude::BatchQuery

pub trait BatchQuery {
    fn batch<'a, 'b, 'c: 'b, C>(self, conn: C) -> Result<()>
    where
        C: TryInto<ConnMut<'a, 'b, 'c>>,
        Error: From<<C as TryInto<ConnMut<'a, 'b, 'c>>>::Error>
; }

Helper trait for batch statement execution.

This trait covers the Queryable::exec_batch method. Please see the corresponding section of the crate level docs for details.

Example:

use mysql::*;
use mysql::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)?;

Required methods

fn batch<'a, 'b, 'c: 'b, C>(self, conn: C) -> Result<()> where
    C: TryInto<ConnMut<'a, 'b, 'c>>,
    Error: From<<C as TryInto<ConnMut<'a, 'b, 'c>>>::Error>, 

Loading content...

Implementors

impl<Q, I, P> BatchQuery for QueryWithParams<Q, I> where
    Q: AsStatement,
    I: IntoIterator<Item = P>,
    P: Into<Params>, 
[src]

fn batch<'a, 'b, 'c: 'b, C>(self, conn: C) -> Result<()> where
    C: TryInto<ConnMut<'a, 'b, 'c>>,
    Error: From<<C as TryInto<ConnMut<'a, 'b, 'c>>>::Error>, 
[src]

This methods corresponds to Queryable::exec_batch.

Loading content...