sqruff_lib_core/dialects/
common.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use smol_str::SmolStr;

use crate::parser::segments::base::ErasedSegment;

/// Details about a table alias.
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub struct AliasInfo {
    /// Name given to the alias
    pub ref_str: SmolStr,
    /// Identifier segment containing the name
    pub segment: Option<ErasedSegment>,
    pub aliased: bool,
    pub from_expression_element: ErasedSegment,
    pub alias_expression: Option<ErasedSegment>,
    pub object_reference: Option<ErasedSegment>,
}

/// Details about a column alias.
#[derive(Clone, Debug)]
pub struct ColumnAliasInfo {
    pub alias_identifier_name: SmolStr,
    pub aliased_segment: ErasedSegment,
    pub column_reference_segments: Vec<ErasedSegment>,
}