pub struct SQLColumnDef {
pub name: String,
pub ty: SQLType,
pub nullable: bool,
pub primary_key: bool,
pub unique: bool,
pub default_value: Option<String>,
pub references: Option<(String, String)>,
pub auto_increment: bool,
}Fields§
§name: String§ty: SQLType§nullable: bool§primary_key: bool§unique: bool§default_value: Option<String>§references: Option<(String, String)>§auto_increment: boolImplementations§
Source§impl SQLColumnDef
impl SQLColumnDef
pub fn new(name: impl Into<String>, ty: SQLType) -> Self
pub fn not_null(self) -> Self
pub fn primary_key(self) -> Self
pub fn unique(self) -> Self
pub fn default(self, val: impl Into<String>) -> Self
pub fn auto_increment(self) -> Self
pub fn references( self, table: impl Into<String>, col: impl Into<String>, ) -> Self
pub fn emit(&self, _dialect: &SQLDialect) -> String
Trait Implementations§
Source§impl Clone for SQLColumnDef
impl Clone for SQLColumnDef
Source§fn clone(&self) -> SQLColumnDef
fn clone(&self) -> SQLColumnDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SQLColumnDef
impl RefUnwindSafe for SQLColumnDef
impl Send for SQLColumnDef
impl Sync for SQLColumnDef
impl Unpin for SQLColumnDef
impl UnsafeUnpin for SQLColumnDef
impl UnwindSafe for SQLColumnDef
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