pub struct TableSchema {
pub name: String,
pub root_page: i32,
pub columns: Vec<ColumnInfo>,
pub indexes: Vec<IndexSchema>,
}Expand description
Minimal table schema needed by the code generator.
Fields§
§name: StringTable name.
root_page: i32Root page of the table’s B-tree.
columns: Vec<ColumnInfo>Column definitions in storage order.
indexes: Vec<IndexSchema>Available indexes.
Implementations§
Source§impl TableSchema
impl TableSchema
Sourcepub fn affinity_string(&self) -> String
pub fn affinity_string(&self) -> String
Build an affinity string for MakeRecord (one char per column).
Sourcepub fn column_index(&self, name: &str) -> Option<usize>
pub fn column_index(&self, name: &str) -> Option<usize>
Find a column’s 0-based index by name (case-insensitive).
Sourcepub fn index_for_column(&self, col_name: &str) -> Option<&IndexSchema>
pub fn index_for_column(&self, col_name: &str) -> Option<&IndexSchema>
Find an index by a column name (returns first index whose leftmost column matches).
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 (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 TableSchema
impl Debug for TableSchema
impl Eq for TableSchema
Source§impl PartialEq for TableSchema
impl PartialEq for TableSchema
Source§fn eq(&self, other: &TableSchema) -> bool
fn eq(&self, other: &TableSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.