pub struct IndexMeta {
pub name: Option<Cow<'static, str>>,
pub columns: Vec<IndexColumn>,
pub is_unique: bool,
pub filter: Option<BoolExpr>,
pub include: Vec<Cow<'static, str>>,
}Expand description
A declarative (possibly composite, partial, or expression) index.
Produced by crate::model_builder::EntityTypeBuilder::has_index and
consumed by the migration engine. A filter turns the index into a partial
index on PostgreSQL/SQLite; on MySQL a filtered unique index is emulated
with a functional (CASE WHEN) unique index because MySQL has no partial
indexes. Filtered non-unique indexes are skipped on MySQL.
Fields§
§name: Option<Cow<'static, str>>Explicit index name. None → derived from table + key parts.
columns: Vec<IndexColumn>Index key parts, in order.
is_unique: boolWhether this is a UNIQUE index.
filter: Option<BoolExpr>Optional partial-index predicate (WHERE <expr>).
include: Vec<Cow<'static, str>>Included (non-key) columns (INCLUDE (...)); PostgreSQL only.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for IndexMeta
impl Freeze for IndexMeta
impl Move for IndexMeta
impl RefUnwindSafe for IndexMeta
impl Send for IndexMeta
impl Sync for IndexMeta
impl Unpin for IndexMeta
impl UnsafeUnpin for IndexMeta
impl UnwindSafe for IndexMeta
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