pub struct TableSchema {
pub name: String,
pub root_page: i32,
pub columns: Vec<ColumnInfo>,
pub indexes: Vec<IndexSchema>,
pub strict: bool,
pub without_rowid: bool,
pub primary_key_constraints: Vec<Vec<String>>,
pub foreign_keys: Vec<FkDef>,
pub check_constraints: Vec<CheckConstraint>,
}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.
strict: boolWhether this table uses SQLite STRICT typing rules.
without_rowid: boolWhether this table is declared WITHOUT ROWID.
primary_key_constraints: Vec<Vec<String>>PRIMARY KEY constraints expressed as ordered column-name groups.
INTEGER PRIMARY KEY rowid aliases continue to use ColumnInfo::is_ipk;
this field preserves non-rowid and composite PRIMARY KEY shape for SQL
re-rendering during ALTER TABLE / persistence round-trips.
foreign_keys: Vec<FkDef>Foreign key constraints declared on this table (child side).
check_constraints: Vec<CheckConstraint>CHECK constraints with durable column-vs-table ownership.
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).
IPK columns are marked with ‘X’ so MakeRecord writes a NULL placeholder
while the real key continues to come from the rowid.
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).
Sourcepub fn single_column_index_for_column_with_collation(
&self,
col_name: &str,
comparison_collation: Option<&str>,
) -> Option<&IndexSchema>
pub fn single_column_index_for_column_with_collation( &self, col_name: &str, comparison_collation: Option<&str>, ) -> Option<&IndexSchema>
Find a single-column direct-lookup index for col_name whose
comparison collation matches the join predicate.
Sourcepub fn unique_single_column_index_for_column(
&self,
col_name: &str,
comparison_collation: Option<&str>,
) -> Option<&IndexSchema>
pub fn unique_single_column_index_for_column( &self, col_name: &str, comparison_collation: Option<&str>, ) -> Option<&IndexSchema>
Find a direct-lookup UNIQUE index that guarantees at most one row for
an equality probe on col_name and whose comparison collation matches
the join predicate.
Sourcepub fn strict_type_pattern(&self) -> Option<String>
pub fn strict_type_pattern(&self) -> Option<String>
STRICT type-check pattern for Opcode::TypeCheck (I,R,T,L,A).
Trait Implementations§
Source§impl Clone for TableSchema
impl Clone for TableSchema
Source§fn clone(&self) -> TableSchema
fn clone(&self) -> TableSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableSchema
impl Debug for TableSchema
impl Eq for TableSchema
Source§impl PartialEq for TableSchema
impl PartialEq for TableSchema
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.