sqlload 0.20.0

SQL data loading tooling. Pre-release, under development.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Run schema changes on a destination, one table at a time.

use crate::adapters::dispatch::main::session::ddl_guard::ddl_guard;
use crate::adapters::dispatch::main::session::execute::execute;
use crate::adapters::dispatch::models::Destination;
use crate::loader::errors::LoaderError;

/// Run schema changes with the destination's other loading tables' schema changes held off, so parallel tables never conflict in its catalog.
pub async fn execute_ddl(
    destination: &Destination,
    statements: Vec<String>,
) -> Result<(), LoaderError> {
    let _held = ddl_guard(destination).await;
    execute(destination, statements).await
}