pub struct TableSchema {
pub name: String,
pub columns: Vec<ColumnDef>,
pub primary_key_columns: Vec<u16>,
pub indices: Vec<IndexDef>,
}Expand description
Table schema stored in the _schema table.
Fields§
§name: String§columns: Vec<ColumnDef>§primary_key_columns: Vec<u16>§indices: Vec<IndexDef>Implementations§
Source§impl TableSchema
impl TableSchema
pub fn serialize(&self) -> Vec<u8> ⓘ
pub fn deserialize(data: &[u8]) -> Result<Self>
Sourcepub fn column_index(&self, name: &str) -> Option<usize>
pub fn column_index(&self, name: &str) -> Option<usize>
Get column index by name (case-insensitive).
Sourcepub fn non_pk_indices(&self) -> Vec<usize>
pub fn non_pk_indices(&self) -> Vec<usize>
Get indices of non-PK columns (columns stored in the B+ tree value).
Sourcepub fn pk_indices(&self) -> Vec<usize>
pub fn pk_indices(&self) -> Vec<usize>
Get the PK column indices as usize.
Sourcepub fn index_by_name(&self, name: &str) -> Option<&IndexDef>
pub fn index_by_name(&self, name: &str) -> Option<&IndexDef>
Get index definition by name (case-insensitive).
Trait Implementations§
Source§impl Clone for TableSchema
impl Clone for TableSchema
Source§fn clone(&self) -> TableSchema
fn clone(&self) -> TableSchema
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 moreAuto 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