sqlload 0.56.0

SQL data loading tooling.
1
2
3
4
5
6
7
8
9
10
11
12
//! The name a source's table or column loads under.

use crate::load_naming::main::_dlt_path::dlt_path;
use crate::load_naming::models::Naming;

/// `name`, a source's table or column name, as it loads under `naming`: in dlt's snake_case, shortened past `max_length`, or as the source spells it.
pub fn loaded_name(naming: Naming, name: &str, max_length: Option<usize>) -> String {
    match naming {
        Naming::SnakeCase => dlt_path(name, max_length),
        Naming::Source => name.to_owned(),
    }
}