pub struct Column {Show 13 fields
pub name: String,
pub column: Option<String>,
pub col_type: Option<String>,
pub typ: SqlType,
pub ignore: bool,
pub pk: bool,
pub autoincr: bool,
pub comment: Option<String>,
pub nullable: bool,
pub default: Option<String>,
pub from: Option<String>,
pub replace: bool,
pub field_operator: FieldOperator,
}
Fields§
§name: String
结构体字段名称
column: Option<String>
数据库字段名称
col_type: Option<String>
数据库字段的数据类型,用于没有合适的类型时,可以自定义
typ: SqlType
数据库数据类型
ignore: bool
[控制字段] 是否忽略该字段, 在解析定义时,如果是 true 则不向列表中添加该列
pk: bool
主键 pk
autoincr: bool
自增类型 autoincr
comment: Option<String>
说明信息
nullable: bool
是否可为空 null | not-null
default: Option<String>
§from: Option<String>
[控制字段] 从另外一个字段重命名, 执行重命名的前提条件:1 该字段不存在,2 from 指定的字段必须存在 重命名后如果字段属性不一致,则执行修改操作
replace: bool
[控制字段] 如果字段更新失败, replace 为 true 时,则删除旧字段并添加新字段 注意:删除旧字段会连带字段中的数据一起删除,并且不能恢复
field_operator: FieldOperator
生成对 sql 字段操作 如 max min …
Implementations§
Trait Implementations§
Source§impl ToTokens for Column
impl ToTokens for Column
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.