sqlload 0.68.0

SQL data loading tooling.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! The process a destination runs beside SQLLoad's own.

use crate::adapters::dispatch::models::Destination;
#[cfg(feature = "duckdb")]
use crate::adapters::duckdb::models::DuckDbConnection;

/// The id of the process `destination` runs its SQL in besides SQLLoad's own: a MotherDuck database's bridge; `None` for the others.
pub fn helper_process(destination: &Destination) -> Option<u32> {
    match destination {
        #[cfg(feature = "duckdb")]
        Destination::DuckDb(duckdb) => match &duckdb.connection {
            DuckDbConnection::Bridge(bridge) => Some(bridge.cursor.process.pid),
            DuckDbConnection::Local(_) => None,
        },
        _ => None,
    }
}