use crate::adapters::dispatch::models::Destination;
#[cfg(feature = "duckdb")]
use crate::adapters::duckdb::main::_own_connection::own_connection;
use crate::loader::errors::LoaderError;
pub fn table_destination(destination: &Destination) -> Result<Destination, LoaderError> {
match destination {
#[cfg(feature = "duckdb")]
Destination::DuckDb(duckdb) => Ok(Destination::DuckDb(own_connection(duckdb)?)),
Destination::BigQuery(bigquery) => {
let mut own = (**bigquery).clone();
own.api.channel = std::sync::Arc::default();
Ok(Destination::BigQuery(Box::new(own)))
}
other => Ok(other.clone()),
}
}