Trait 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§

Source

fn unique(self) -> Self

Creates a unique index.

Null values are considered different from all other null values.

Source

fn if_not_exists(self) -> Self

Creates the index only if it doesn’t exist yet.

Source

fn add_column(self, column: &'until_build str) -> Self

Adds a column to the index.

Parameter:

  • column: String representing the column to index.
Source

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
Source

fn build(self) -> Result<String, Error>

This method is used to build the create index operation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'until_build> CreateIndex<'until_build> for CreateIndexImpl<'until_build>