pub struct IndexDef {
pub name: String,
pub keys: Vec<IndexKey>,
pub unique: bool,
pub predicate_sql: Option<String>,
pub predicate_expr: Option<Expr>,
pub kind: IndexKind,
pub ann_filter_cols: Vec<u16>,
}Expand description
IndexKey::Column for CREATE INDEX ON t (email), IndexKey::Expr for LOWER(email).
Fields§
§name: String§keys: Vec<IndexKey>§unique: bool§predicate_sql: Option<String>§predicate_expr: Option<Expr>§kind: IndexKind§ann_filter_cols: Vec<u16>ANN-only: schema column indices pushed into the PRISM cell filter. Empty for every other index kind.
Implementations§
Source§impl IndexDef
impl IndexDef
Sourcepub fn from_column_lists(
name: String,
columns: Vec<u16>,
collations: Vec<Collation>,
unique: bool,
predicate_sql: Option<String>,
predicate_expr: Option<Expr>,
kind: IndexKind,
) -> Self
pub fn from_column_lists( name: String, columns: Vec<u16>, collations: Vec<Collation>, unique: bool, predicate_sql: Option<String>, predicate_expr: Option<Expr>, kind: IndexKind, ) -> Self
Used by FK/UNIQUE auto-indexes; expression-key indexes go through a different path.
Sourcepub fn columns_vec(&self) -> Vec<u16>
pub fn columns_vec(&self) -> Vec<u16>
Expression keys are skipped (positions only come from IndexKey::Column).
Sourcepub fn collations_vec(&self) -> Vec<Collation>
pub fn collations_vec(&self) -> Vec<Collation>
Expression keys default to Binary.
pub fn column_positions_iter(&self) -> impl Iterator<Item = u16> + '_
pub fn collation_at(&self, i: usize) -> Collation
pub fn is_pure_column_index(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexDef
impl RefUnwindSafe for IndexDef
impl Send for IndexDef
impl Sync for IndexDef
impl Unpin for IndexDef
impl UnsafeUnpin for IndexDef
impl UnwindSafe for IndexDef
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more