sqlload 0.90.0

SQL data loading tooling.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Run one statement on the caller's session.

use crate::adapters::session::_helpers::blocking::on_session;
use crate::adapters::session::models::SessionDestination;
use crate::loader::errors::LoaderError;

/// Run `statement` on the destination's session, in autocommit.
pub(in crate::adapters) async fn execute_statement(
    destination: &SessionDestination,
    statement: String,
) -> Result<(), LoaderError> {
    tracing::debug!(%statement, "running on the caller's session");
    on_session(destination, move |session| session.execute(&statement)).await
}