pub struct IndexSchema {
pub name: String,
pub root_page: i32,
pub columns: Vec<String>,
pub key_expressions: Vec<String>,
pub key_sort_directions: Vec<SortDirection>,
pub where_clause: Option<String>,
pub is_unique: bool,
pub key_collations: Vec<Option<String>>,
pub conflict_action: Option<ConflictAction>,
}Expand description
Index metadata needed for codegen (index-scan SELECT).
Fields§
§name: StringIndex name.
root_page: i32Root page number.
columns: Vec<String>Indexed column names (leftmost first).
This is populated only when every key term is a plain column
reference. Expression indexes keep their executable term SQL in
key_expressions and leave columns empty so planner fast paths do
not accidentally treat them as simple column-lookup indexes.
key_expressions: Vec<String>Executable SQL for each key term in storage order.
key_sort_directions: Vec<SortDirection>Sort direction for each logical key term.
Empty means “all ASC” for legacy callers/tests that do not yet populate per-term ordering metadata.
where_clause: Option<String>Optional partial-index predicate as SQL text.
is_unique: boolWhether this index enforces a UNIQUE constraint.
key_collations: Vec<Option<String>>Per-key-term collation sequences (e.g. NOCASE, RTRIM).
None means “use the default (BINARY) collation” for that position.
Empty vec means “all BINARY” for legacy callers/tests.
conflict_action: Option<ConflictAction>Conflict-resolution algorithm declared on the UNIQUE / PRIMARY KEY
constraint backing this index via ON CONFLICT <algo>. None means the
default (ABORT) unless overridden by a statement-level INSERT OR <algo>.
Implementations§
Source§impl IndexSchema
impl IndexSchema
Sourcepub fn key_term_count(&self) -> usize
pub fn key_term_count(&self) -> usize
Number of logical key terms before the trailing rowid suffix.
Sourcepub fn key_term_sql(&self, key_pos: usize) -> Option<&str>
pub fn key_term_sql(&self, key_pos: usize) -> Option<&str>
Return the SQL fragment for the key_posth key term.
Sourcepub fn key_term_descending(&self, key_pos: usize) -> bool
pub fn key_term_descending(&self, key_pos: usize) -> bool
Whether the key_posth logical key term sorts descending.
Sourcepub fn key_term_collation(&self, key_pos: usize) -> Option<&str>
pub fn key_term_collation(&self, key_pos: usize) -> Option<&str>
Return the collation sequence for the key_posth key term, if any.
Sourcepub fn supports_direct_column_lookup(&self) -> bool
pub fn supports_direct_column_lookup(&self) -> bool
Whether planner / lookup fast paths may safely treat this as a simple non-partial column index.
Sourcepub fn supports_replace_cleanup_meta(&self) -> bool
pub fn supports_replace_cleanup_meta(&self) -> bool
Whether REPLACE cleanup metadata can reconstruct the key from raw row payload columns alone.
Trait Implementations§
Source§impl Clone for IndexSchema
impl Clone for IndexSchema
Source§fn clone(&self) -> IndexSchema
fn clone(&self) -> IndexSchema
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 IndexSchema
impl Debug for IndexSchema
impl Eq for IndexSchema
Source§impl PartialEq for IndexSchema
impl PartialEq for IndexSchema
impl StructuralPartialEq for IndexSchema
Auto Trait Implementations§
impl Freeze for IndexSchema
impl RefUnwindSafe for IndexSchema
impl Send for IndexSchema
impl Sync for IndexSchema
impl Unpin for IndexSchema
impl UnsafeUnpin for IndexSchema
impl UnwindSafe for IndexSchema
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.