Skip to main content

AliasExt

Trait AliasExt 

Source
pub trait AliasExt<T>: Expressive<T> + Sized {
    // Provided method
    fn as_alias(self, alias: impl Into<String>) -> Expression<T>
       where Identifier: Expressive<T> { ... }
}
Expand description

Extension trait that adds .as_alias() to any Expressive<T> type.

Wraps the expression as expr AS <quoted_alias>, using Identifier for backend-aware quoting.

use vantage_sql::primitives::alias::AliasExt;

Fx::new("count", [mysql_expr!("*")]).as_alias("cnt")
// → COUNT(*) AS `cnt`   (MySQL)
// → COUNT(*) AS "cnt"   (PostgreSQL)

Provided Methods§

Source

fn as_alias(self, alias: impl Into<String>) -> Expression<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, E: Expressive<T> + Sized> AliasExt<T> for E