Trait rorm_sql::create_index::CreateIndex
source · pub trait CreateIndex<'until_build> {
// Required methods
fn unique(self) -> Self;
fn if_not_exists(self) -> Self;
fn add_column(self, column: &'until_build str) -> Self;
fn set_condition(self, condition: String) -> Self;
fn build(self) -> Result<String, Error>;
}
Expand description
Representation of a CREATE INDEX builder.
Required Methods§
sourcefn unique(self) -> Self
fn unique(self) -> Self
Creates a unique index.
Null values are considered different from all other null values.
sourcefn if_not_exists(self) -> Self
fn if_not_exists(self) -> Self
Creates the index only if it doesn’t exist yet.
sourcefn add_column(self, column: &'until_build str) -> Self
fn add_column(self, column: &'until_build str) -> Self
Adds a column to the index.
Parameter:
column
: String representing the column to index.
sourcefn set_condition(self, condition: String) -> Self
fn set_condition(self, condition: String) -> Self
Sets the condition to apply. This will build a partial index.
Parameter:
condition
: String representing condition to apply the index to