pub struct ColumnSnapshot {
pub name: String,
pub data_type: DataTypeSnapshot,
pub nullable: bool,
pub auto_increment: bool,
pub unique: bool,
pub primary_key: bool,
pub foreign_key: Option<ForeignKeySnapshot>,
pub default: Option<Value>,
}Expand description
Snapshot of a single column definition.
Mirrors the subset of column metadata that is meaningful for migration detection; transient or derivable fields are omitted on purpose.
Fields§
§name: StringColumn name.
data_type: DataTypeSnapshotStable encoding of the column data type.
nullable: boolWhether the column accepts NULL.
auto_increment: boolWhether the column is auto-incremented on insert.
unique: boolWhether the column carries a UNIQUE constraint.
primary_key: boolWhether the column is part of the primary key.
foreign_key: Option<ForeignKeySnapshot>Foreign key reference, if the column is a foreign key.
default: Option<Value>Default value applied when no value is supplied on insert.
Trait Implementations§
Source§impl Clone for ColumnSnapshot
impl Clone for ColumnSnapshot
Source§fn clone(&self) -> ColumnSnapshot
fn clone(&self) -> ColumnSnapshot
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 moreSource§impl Debug for ColumnSnapshot
impl Debug for ColumnSnapshot
Source§impl<'de> Deserialize<'de> for ColumnSnapshot
impl<'de> Deserialize<'de> for ColumnSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode for ColumnSnapshot
impl Encode for ColumnSnapshot
Source§const ALIGNMENT: PageOffset = 32
const ALIGNMENT: PageOffset = 32
The alignment requirement in bytes for the data type. Read more
Source§impl PartialEq for ColumnSnapshot
impl PartialEq for ColumnSnapshot
Source§impl Serialize for ColumnSnapshot
impl Serialize for ColumnSnapshot
impl Eq for ColumnSnapshot
impl StructuralPartialEq for ColumnSnapshot
Auto Trait Implementations§
impl Freeze for ColumnSnapshot
impl RefUnwindSafe for ColumnSnapshot
impl Send for ColumnSnapshot
impl Sync for ColumnSnapshot
impl Unpin for ColumnSnapshot
impl UnsafeUnpin for ColumnSnapshot
impl UnwindSafe for ColumnSnapshot
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