pub struct TableSnapshot {
pub name: String,
pub renamed_from: Option<String>,
pub columns: Vec<ColumnSnapshot>,
pub primary_key_name: Option<String>,
pub primary_key_columns: Vec<String>,
pub indexes: Vec<IndexSnapshot>,
pub foreign_keys: Vec<ForeignKeySnapshot>,
}Expand description
Snapshot of a SQL Server table with the minimum structural information needed for the first migration diff passes.
Fields§
§name: String§renamed_from: Option<String>§columns: Vec<ColumnSnapshot>§primary_key_name: Option<String>§primary_key_columns: Vec<String>§indexes: Vec<IndexSnapshot>§foreign_keys: Vec<ForeignKeySnapshot>Implementations§
Source§impl TableSnapshot
impl TableSnapshot
pub fn new( name: impl Into<String>, columns: Vec<ColumnSnapshot>, primary_key_name: Option<String>, primary_key_columns: Vec<String>, indexes: Vec<IndexSnapshot>, foreign_keys: Vec<ForeignKeySnapshot>, ) -> Self
pub fn column(&self, name: &str) -> Option<&ColumnSnapshot>
pub fn with_renamed_from(self, renamed_from: impl Into<String>) -> Self
pub fn index(&self, name: &str) -> Option<&IndexSnapshot>
pub fn foreign_key(&self, name: &str) -> Option<&ForeignKeySnapshot>
Trait Implementations§
Source§impl Clone for TableSnapshot
impl Clone for TableSnapshot
Source§fn clone(&self) -> TableSnapshot
fn clone(&self) -> TableSnapshot
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 TableSnapshot
impl Debug for TableSnapshot
Source§impl Default for TableSnapshot
impl Default for TableSnapshot
Source§fn default() -> TableSnapshot
fn default() -> TableSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TableSnapshot
impl<'de> Deserialize<'de> for TableSnapshot
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 From<&EntityMetadata> for TableSnapshot
impl From<&EntityMetadata> for TableSnapshot
Source§fn from(entity: &EntityMetadata) -> Self
fn from(entity: &EntityMetadata) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TableSnapshot
impl PartialEq for TableSnapshot
Source§fn eq(&self, other: &TableSnapshot) -> bool
fn eq(&self, other: &TableSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TableSnapshot
impl Serialize for TableSnapshot
impl Eq for TableSnapshot
impl StructuralPartialEq for TableSnapshot
Auto Trait Implementations§
impl Freeze for TableSnapshot
impl RefUnwindSafe for TableSnapshot
impl Send for TableSnapshot
impl Sync for TableSnapshot
impl Unpin for TableSnapshot
impl UnsafeUnpin for TableSnapshot
impl UnwindSafe for TableSnapshot
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