pub struct TableBuilder { /* private fields */ }Expand description
表构建器
Implementations§
Source§impl TableBuilder
impl TableBuilder
Sourcepub fn integer_not_null(self, name: &str) -> Self
pub fn integer_not_null(self, name: &str) -> Self
添加非空整数列
Sourcepub fn integer_default(self, name: &str, default: i64) -> Self
pub fn integer_default(self, name: &str, default: i64) -> Self
添加带默认值的整数列
Sourcepub fn text_not_null(self, name: &str) -> Self
pub fn text_not_null(self, name: &str) -> Self
添加非空文本列
Sourcepub fn text_default(self, name: &str, default: &str) -> Self
pub fn text_default(self, name: &str, default: &str) -> Self
添加带默认值的文本列
Sourcepub fn real_not_null(self, name: &str) -> Self
pub fn real_not_null(self, name: &str) -> Self
添加非空实数列
Sourcepub fn boolean_default(self, name: &str, default: bool) -> Self
pub fn boolean_default(self, name: &str, default: bool) -> Self
添加布尔列带默认值
Sourcepub fn created_at(self) -> Self
pub fn created_at(self) -> Self
添加 created_at 时间戳列
Sourcepub fn updated_at(self) -> Self
pub fn updated_at(self) -> Self
添加 updated_at 时间戳列
Sourcepub fn timestamps(self) -> Self
pub fn timestamps(self) -> Self
添加时间戳列(created_at + updated_at)
Sourcepub fn foreign_key(
self,
column: &str,
ref_table: &str,
ref_column: &str,
) -> Self
pub fn foreign_key( self, column: &str, ref_table: &str, ref_column: &str, ) -> Self
添加外键
Auto Trait Implementations§
impl Freeze for TableBuilder
impl RefUnwindSafe for TableBuilder
impl Send for TableBuilder
impl Sync for TableBuilder
impl Unpin for TableBuilder
impl UnwindSafe for TableBuilder
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