pub struct TableSchemaSnapshot {
pub version: u8,
pub name: String,
pub primary_key: String,
pub alignment: u32,
pub columns: Vec<ColumnSnapshot>,
pub indexes: Vec<IndexSnapshot>,
}Expand description
Frozen, comparable view of a TableSchema used for migration detection.
A snapshot captures the structural shape of a table at a point in time so that two versions can be diffed to derive the migration steps required to bring the on-disk representation up to date with the current schema definition.
Fields§
§version: u8Version tag of the snapshot binary layout, see [SCHEMA_SNAPSHOT_VERSION].
name: StringName of the table this snapshot was taken from.
primary_key: StringName of the column declared as primary key.
alignment: u32Record alignment, in bytes, used for on-disk layout.
columns: Vec<ColumnSnapshot>Snapshots of every column in declaration order.
indexes: Vec<IndexSnapshot>Snapshots of every secondary index defined on the table.
Implementations§
Source§impl TableSchemaSnapshot
impl TableSchemaSnapshot
Sourcepub fn latest_version() -> u8
pub fn latest_version() -> u8
Returns the latest version of the snapshot format.
Trait Implementations§
Source§impl Clone for TableSchemaSnapshot
impl Clone for TableSchemaSnapshot
Source§fn clone(&self) -> TableSchemaSnapshot
fn clone(&self) -> TableSchemaSnapshot
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 TableSchemaSnapshot
impl Debug for TableSchemaSnapshot
Source§impl<'de> Deserialize<'de> for TableSchemaSnapshot
impl<'de> Deserialize<'de> for TableSchemaSnapshot
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 TableSchemaSnapshot
impl Encode for TableSchemaSnapshot
Source§const ALIGNMENT: PageOffset = 32
const ALIGNMENT: PageOffset = 32
The alignment requirement in bytes for the data type. Read more
Source§impl PartialEq for TableSchemaSnapshot
impl PartialEq for TableSchemaSnapshot
Source§impl Serialize for TableSchemaSnapshot
impl Serialize for TableSchemaSnapshot
impl Eq for TableSchemaSnapshot
impl StructuralPartialEq for TableSchemaSnapshot
Auto Trait Implementations§
impl Freeze for TableSchemaSnapshot
impl RefUnwindSafe for TableSchemaSnapshot
impl Send for TableSchemaSnapshot
impl Sync for TableSchemaSnapshot
impl Unpin for TableSchemaSnapshot
impl UnsafeUnpin for TableSchemaSnapshot
impl UnwindSafe for TableSchemaSnapshot
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