pub struct ColumnInfo {
pub name: &'static str,
pub sql_type: &'static str,
pub is_primary_key: bool,
pub is_nullable: bool,
pub create_time: bool,
pub update_time: bool,
pub unique: bool,
pub index: bool,
pub foreign_table: Option<&'static str>,
pub foreign_key: Option<&'static str>,
}Expand description
Metadata information about a database column.
This structure is used internally to generate table schemas and map Rust types to SQL types.
It is usually populated automatically by the #[derive(Model)] macro.
Fields§
§name: &'static strThe column name in the database.
sql_type: &'static strThe SQL type of the column (e.g., “TEXT”, “INTEGER”, “TIMESTAMPTZ”).
is_primary_key: boolWhether this column is a Primary Key.
is_nullable: boolWhether this column allows NULL values.
create_time: boolWhether this column should be automatically populated with the creation timestamp.
update_time: boolWhether this column should be automatically updated on modification (feature in progress).
unique: boolWhether this column has a UNIQUE constraint.
index: boolWhether an index should be created for this column.
foreign_table: Option<&'static str>The name of the foreign table, if this is a Foreign Key.
foreign_key: Option<&'static str>The name of the foreign column, if this is a Foreign Key.
Auto Trait Implementations§
impl Freeze for ColumnInfo
impl RefUnwindSafe for ColumnInfo
impl Send for ColumnInfo
impl Sync for ColumnInfo
impl Unpin for ColumnInfo
impl UnwindSafe for ColumnInfo
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
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>
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>
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 more