Skip to main content

SQLTableInfo

Trait SQLTableInfo 

Source
pub trait SQLTableInfo:
    Any
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn columns(&self) -> &'static [&'static dyn SQLColumnInfo];
    fn dependencies(&self) -> &'static [&'static dyn SQLTableInfo];

    // Provided methods
    fn schema(&self) -> Option<&str> { ... }
    fn qualified_name(&self) -> Cow<'static, str> { ... }
    fn column_named(&self, name: &str) -> Option<&'static dyn SQLColumnInfo> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Unqualified table name.

Source

fn columns(&self) -> &'static [&'static dyn SQLColumnInfo]

Source

fn dependencies(&self) -> &'static [&'static dyn SQLTableInfo]

Provided Methods§

Source

fn schema(&self) -> Option<&str>

Optional schema/catalog namespace for this table.

Source

fn qualified_name(&self) -> Cow<'static, str>

Fully-qualified table name when schema is present.

Source

fn column_named(&self, name: &str) -> Option<&'static dyn SQLColumnInfo>

Lookup a column by name.

Trait Implementations§

Source§

impl Debug for dyn SQLTableInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, V: SQLParam> From<&'static dyn SQLTableInfo> for SQLChunk<'a, V>

Source§

fn from(value: &'static dyn SQLTableInfo) -> Self

Converts to this type from the input type.
Source§

impl<'a, V: SQLParam + 'a> ToSQL<'a, V> for &'static dyn SQLTableInfo

Source§

fn to_sql(&self) -> SQL<'a, V>

Source§

fn into_sql(self) -> SQL<'a, V>
where Self: Sized,

Consume self and return SQL without cloning. Default delegates to to_sql() (which clones). Types that own their SQL (like SQL and SQLExpr) override this to avoid the clone.
Source§

fn alias(&self, alias: &'static str) -> SQL<'a, V>

Implementations on Foreign Types§

Source§

impl<T: SQLTableInfo> SQLTableInfo for &'static T

Source§

fn name(&self) -> &str

Source§

fn schema(&self) -> Option<&str>

Source§

fn qualified_name(&self) -> Cow<'static, str>

Source§

fn columns(&self) -> &'static [&'static dyn SQLColumnInfo]

Source§

fn dependencies(&self) -> &'static [&'static dyn SQLTableInfo]

Implementors§