pub struct ColumnRef {
pub table: &'static str,
pub name: &'static str,
pub sql_type: &'static str,
pub flags: ColumnFlags,
pub dialect: ColumnDialect,
}Expand description
A column’s table, name, and schema metadata, generated by the table macros.
SQL rendering only reads table and name (through ColumnSqlRef).
Migrations read the rest.
Fields§
§table: &'static str§name: &'static str§sql_type: &'static str§flags: ColumnFlags§dialect: ColumnDialectImplementations§
Source§impl ColumnRef
impl ColumnRef
Sourcepub const fn sql(table: &'static str, name: &'static str) -> Self
pub const fn sql(table: &'static str, name: &'static str) -> Self
Creates a ColumnRef with just a table and column name, for SQL
rendering.
Metadata fields are empty. Use a struct literal when metadata matters.
Sourcepub const fn primary_key(&self) -> bool
pub const fn primary_key(&self) -> bool
Returns true if this column participates in the primary key.
Sourcepub const fn has_default(&self) -> bool
pub const fn has_default(&self) -> bool
Returns true if this column has a DEFAULT clause.
Trait Implementations§
impl Copy for ColumnRef
impl Eq for ColumnRef
Source§impl From<&ColumnRef> for ColumnSqlRef
impl From<&ColumnRef> for ColumnSqlRef
Source§impl From<ColumnRef> for ColumnSqlRef
impl From<ColumnRef> for ColumnSqlRef
impl StructuralPartialEq for ColumnRef
Auto Trait Implementations§
impl Freeze for ColumnRef
impl RefUnwindSafe for ColumnRef
impl Send for ColumnRef
impl Sync for ColumnRef
impl Unpin for ColumnRef
impl UnsafeUnpin for ColumnRef
impl UnwindSafe for ColumnRef
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