pub struct Alias {
pub this: Expression,
pub alias: Identifier,
pub column_aliases: Vec<Identifier>,
pub pre_alias_comments: Vec<String>,
pub trailing_comments: Vec<String>,
}Expand description
Represent an aliased expression (expr AS name).
Used for column aliases in select-lists, table aliases on subqueries,
and column alias lists on table-valued expressions (e.g. AS t(c1, c2)).
Fields§
§this: ExpressionThe expression being aliased.
alias: IdentifierThe alias name (required for simple aliases, optional when only column aliases provided)
column_aliases: Vec<Identifier>Optional column aliases for table-valued functions: AS t(col1, col2) or AS (col1, col2)
pre_alias_comments: Vec<String>Comments that appeared between the expression and AS keyword
trailing_comments: Vec<String>Trailing comments that appeared after the alias
Implementations§
Source§impl Alias
impl Alias
Sourcepub fn new(this: Expression, alias: Identifier) -> Self
pub fn new(this: Expression, alias: Identifier) -> Self
Create a simple alias
Sourcepub fn with_columns(this: Expression, column_aliases: Vec<Identifier>) -> Self
pub fn with_columns(this: Expression, column_aliases: Vec<Identifier>) -> Self
Create an alias with column aliases only (no table alias name)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Alias
impl<'de> Deserialize<'de> for Alias
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Alias
Auto Trait Implementations§
impl Freeze for Alias
impl RefUnwindSafe for Alias
impl Send for Alias
impl Sync for Alias
impl Unpin for Alias
impl UnwindSafe for Alias
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