SQLColumnInfo

Trait SQLColumnInfo 

Source
pub trait SQLColumnInfo:
    Any
    + Send
    + Sync {
    // Required methods
    fn is_not_null(&self) -> bool;
    fn is_primary_key(&self) -> bool;
    fn is_unique(&self) -> bool;
    fn name(&self) -> &str;
    fn type(&self) -> &str;
    fn has_default(&self) -> bool;
    fn table(&self) -> &dyn SQLTableInfo;

    // Provided methods
    fn foreign_key(&self) -> Option<&'static dyn SQLColumnInfo> { ... }
    fn foreign_key_table(&self) -> Option<&'static dyn SQLTableInfo> { ... }
    fn as_column(&self) -> &dyn SQLColumnInfo
       where Self: Sized { ... }
}

Required Methods§

Source

fn is_not_null(&self) -> bool

Source

fn is_primary_key(&self) -> bool

Source

fn is_unique(&self) -> bool

Source

fn name(&self) -> &str

Source

fn type(&self) -> &str

Source

fn has_default(&self) -> bool

Source

fn table(&self) -> &dyn SQLTableInfo

Provided Methods§

Source

fn foreign_key(&self) -> Option<&'static dyn SQLColumnInfo>

Returns the foreign key reference if this column has one.

Source

fn foreign_key_table(&self) -> Option<&'static dyn SQLTableInfo>

Returns the foreign key table if this column references one.

Source

fn as_column(&self) -> &dyn SQLColumnInfo
where Self: Sized,

Trait Implementations§

Source§

impl Debug for dyn SQLColumnInfo

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 SQLColumnInfo> for SQLChunk<'a, V>

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

Source§

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

Implementations on Foreign Types§

Source§

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

Source§

fn is_not_null(&self) -> bool

Source§

fn is_primary_key(&self) -> bool

Source§

fn is_unique(&self) -> bool

Source§

fn name(&self) -> &str

Source§

fn type(&self) -> &str

Source§

fn has_default(&self) -> bool

Source§

fn table(&self) -> &dyn SQLTableInfo

Source§

fn foreign_key(&self) -> Option<&'static dyn SQLColumnInfo>

Implementors§