pub struct TableSchema {
pub name: String,
pub columns: Vec<ColumnDef>,
pub primary_key_columns: Vec<u16>,
pub indices: Vec<IndexDef>,
pub check_constraints: Vec<TableCheckDef>,
pub foreign_keys: Vec<ForeignKeySchemaEntry>,
pub flags: u8,
/* private fields */
}Fields§
§name: String§columns: Vec<ColumnDef>§primary_key_columns: Vec<u16>§indices: Vec<IndexDef>§check_constraints: Vec<TableCheckDef>§foreign_keys: Vec<ForeignKeySchemaEntry>§flags: u8Implementations§
Source§impl TableSchema
impl TableSchema
pub fn new( name: String, columns: Vec<ColumnDef>, primary_key_columns: Vec<u16>, indices: Vec<IndexDef>, check_constraints: Vec<TableCheckDef>, foreign_keys: Vec<ForeignKeySchemaEntry>, ) -> Self
pub fn with_drops( name: String, columns: Vec<ColumnDef>, primary_key_columns: Vec<u16>, indices: Vec<IndexDef>, check_constraints: Vec<TableCheckDef>, foreign_keys: Vec<ForeignKeySchemaEntry>, dropped_non_pk_slots: Vec<u16>, ) -> Self
pub fn column_map(&self) -> &ColumnMap
pub fn is_strict(&self) -> bool
pub fn has_virtual_columns(&self) -> bool
Sourcepub fn rebuild(self) -> Self
pub fn rebuild(self) -> Self
Rebuild caches (preserving dropped slots). Use after mutating fields in place.
pub fn has_checks(&self) -> bool
Sourcepub fn decode_col_mapping(&self) -> &[usize]
pub fn decode_col_mapping(&self) -> &[usize]
Physical position -> logical column index. usize::MAX for dropped slots.
Sourcepub fn encoding_positions(&self) -> &[u16]
pub fn encoding_positions(&self) -> &[u16]
Logical non-PK order -> physical encoding position.
Sourcepub fn physical_non_pk_count(&self) -> usize
pub fn physical_non_pk_count(&self) -> usize
Total physical non-PK column count (live + dropped slots).
pub fn dropped_non_pk_slots(&self) -> &[u16]
pub fn without_column(&self, drop_pos: usize) -> Self
Source§impl TableSchema
impl TableSchema
pub fn serialize(&self) -> Vec<u8> ⓘ
pub fn deserialize(data: &[u8]) -> Result<Self>
pub fn column_index(&self, name: &str) -> Option<usize>
pub fn non_pk_indices(&self) -> &[usize]
pub fn pk_indices(&self) -> &[usize]
pub fn index_by_name(&self, name: &str) -> Option<&IndexDef>
pub fn index_table_name(table_name: &str, index_name: &str) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for TableSchema
impl Clone for TableSchema
Auto Trait Implementations§
impl !Freeze for TableSchema
impl RefUnwindSafe for TableSchema
impl Send for TableSchema
impl Sync for TableSchema
impl Unpin for TableSchema
impl UnsafeUnpin for TableSchema
impl UnwindSafe for TableSchema
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