pub struct Index {
pub table: Cow<'static, str>,
pub name: Cow<'static, str>,
pub columns: Vec<IndexColumn>,
pub is_unique: bool,
pub where_clause: Option<Cow<'static, str>>,
pub origin: IndexOrigin,
}Expand description
An index, as stored in migration snapshots.
Fields§
§table: Cow<'static, str>Parent table name
name: Cow<'static, str>Index name
columns: Vec<IndexColumn>Columns included in the index
is_unique: boolIs this a unique index?
where_clause: Option<Cow<'static, str>>WHERE condition of a partial index, as SQL (serialized as where)
origin: IndexOriginHow the index was created
Implementations§
Source§impl Index
impl Index
Source§impl Index
impl Index
Sourcepub fn create_index_sql(&self) -> String
pub fn create_index_sql(&self) -> String
Renders CREATE [UNIQUE] INDEX ... ON table(...), with the partial
index WHERE clause if set.
Sourcepub fn drop_index_sql(&self) -> String
pub fn drop_index_sql(&self) -> String
Renders DROP INDEX ...;.
Trait Implementations§
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
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