sqlload 0.72.1

SQL data loading tooling.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The SQL dialect a warehouse source reads in.

use crate::bigquery_source::constants::BIGQUERY_SOURCE;
use crate::column_types::models::Warehouse;
use crate::databricks_source::constants::DATABRICKS_SOURCE;
use crate::duckdb_source::constants::{DUCKDB_SOURCE, MOTHERDUCK_SOURCE};
use crate::loader::constants::SNOWFLAKE_SOURCE;

/// The warehouse whose SQL a warehouse source of `system` (its kind as written) filters in; `None` for a system without one.
pub fn source_dialect(system: &str) -> Option<Warehouse> {
    match system {
        SNOWFLAKE_SOURCE => Some(Warehouse::Snowflake),
        BIGQUERY_SOURCE => Some(Warehouse::BigQuery),
        DATABRICKS_SOURCE => Some(Warehouse::Databricks),
        DUCKDB_SOURCE | MOTHERDUCK_SOURCE => Some(Warehouse::DuckDb),
        _ => None,
    }
}