pub enum NormalizationStrategy {
Lowercase,
Uppercase,
CaseInsensitive,
CaseSensitive,
}Expand description
Normalization strategy for identifier handling.
SQL dialects differ in how they handle identifier case. This enum represents the different strategies used for normalizing identifiers during analysis.
Variants§
Lowercase
Fold to lowercase (Postgres, Redshift)
Uppercase
Fold to uppercase (Snowflake, Oracle)
CaseInsensitive
Case-insensitive comparison without folding
CaseSensitive
Case-sensitive, preserve exactly
Implementations§
Source§impl NormalizationStrategy
impl NormalizationStrategy
Sourcepub fn apply<'a>(&self, s: &'a str) -> Cow<'a, str>
pub fn apply<'a>(&self, s: &'a str) -> Cow<'a, str>
Applies this normalization strategy to a string.
Returns a Cow<str> to avoid allocation when no transformation is needed
(i.e., for CaseSensitive strategy or when the string is already in the
correct case).
For CaseInsensitive, lowercase folding is used as the canonical form.
§Example
use std::borrow::Cow;
use flowscope_core::generated::NormalizationStrategy;
let strategy = NormalizationStrategy::Lowercase;
assert_eq!(strategy.apply("MyTable"), "mytable");
// CaseSensitive returns a borrowed reference (no allocation)
let strategy = NormalizationStrategy::CaseSensitive;
assert!(matches!(strategy.apply("MyTable"), Cow::Borrowed(_)));Trait Implementations§
Source§impl Clone for NormalizationStrategy
impl Clone for NormalizationStrategy
Source§fn clone(&self) -> NormalizationStrategy
fn clone(&self) -> NormalizationStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NormalizationStrategy
impl Debug for NormalizationStrategy
Source§impl PartialEq for NormalizationStrategy
impl PartialEq for NormalizationStrategy
impl Copy for NormalizationStrategy
impl Eq for NormalizationStrategy
impl StructuralPartialEq for NormalizationStrategy
Auto Trait Implementations§
impl Freeze for NormalizationStrategy
impl RefUnwindSafe for NormalizationStrategy
impl Send for NormalizationStrategy
impl Sync for NormalizationStrategy
impl Unpin for NormalizationStrategy
impl UnwindSafe for NormalizationStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.