pub struct ColumnModel {
pub name: String,
pub sql_type: String,
pub nullable: bool,
pub primary_key: bool,
pub rename_from: Option<String>,
pub default_sql: Option<String>,
pub comment: Option<String>,
}Expand description
字段(列)模型。
Fields§
§name: String数据库字段名
sql_type: StringPostgreSQL 类型,例如 bigint、varchar(64)、timestamptz、jsonb
nullable: bool是否可空(Option<T> 默认可空)
primary_key: bool是否主键字段(单列主键;联合主键请使用 TableModel::primary_key)
rename_from: Option<String>当前字段由旧字段名改名而来时填写旧字段名
default_sql: Option<String>数据库默认值表达式,例如 now()、‘{}’、gen_random_uuid()::text
comment: Option<String>COMMENT ON COLUMN 的内容;None 表示不设置注释。
Trait Implementations§
Source§impl Clone for ColumnModel
impl Clone for ColumnModel
Source§fn clone(&self) -> ColumnModel
fn clone(&self) -> ColumnModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnModel
impl Debug for ColumnModel
Source§impl<'de> Deserialize<'de> for ColumnModel
impl<'de> Deserialize<'de> for ColumnModel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ColumnModel
Source§impl PartialEq for ColumnModel
impl PartialEq for ColumnModel
Source§impl Serialize for ColumnModel
impl Serialize for ColumnModel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ColumnModel
Auto Trait Implementations§
impl Freeze for ColumnModel
impl RefUnwindSafe for ColumnModel
impl Send for ColumnModel
impl Sync for ColumnModel
impl Unpin for ColumnModel
impl UnsafeUnpin for ColumnModel
impl UnwindSafe for ColumnModel
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