pub struct CreateIndex<X: Extension = NoExt> {
pub unique: bool,
pub concurrently: bool,
pub if_not_exists: bool,
pub name: Option<Ident>,
pub table: ObjectName,
pub using: Option<Ident>,
pub columns: ThinVec<IndexColumn<X>>,
pub with_params: ThinVec<TableStorageParameter<X>>,
pub predicate: Option<Box<Expr<X>>>,
pub meta: Meta,
}Expand description
CREATE [UNIQUE] INDEX [CONCURRENTLY] [IF NOT EXISTS] [<name>] ON <table> [USING <method>] (<column> [, ...]) [WHERE <predicate>].
UNIQUE is portable; CONCURRENTLY, the USING <method> access-method clause,
and the trailing WHERE partial-index predicate are PostgreSQL extensions gated
by schema_change_syntax.index_extensions dialect data. The index
name is optional — PostgreSQL derives one from the table and columns when it is
omitted (CREATE INDEX ON t (a)). COLLATE / operator-class / INCLUDE column
decorations are a deliberate follow-up.
Fields§
§unique: boolWhether the unique form was present in the source.
concurrently: boolWhether the concurrently form was present in the source.
if_not_exists: boolWhether the if not exists form was present in the source.
name: Option<Ident>Name referenced by this syntax.
table: ObjectNameTable referenced by this syntax.
using: Option<Ident>Optional using for this syntax.
columns: ThinVec<IndexColumn<X>>Columns in source order.
with_params: ThinVec<TableStorageParameter<X>>WITH (<name> = <value>, …) index storage parameters.
predicate: Option<Box<Expr<X>>>Predicate that controls this clause.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for CreateIndex<X>
impl<X: Clone + Extension> Clone for CreateIndex<X>
Source§fn clone(&self) -> CreateIndex<X>
fn clone(&self) -> CreateIndex<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for CreateIndex<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for CreateIndex<X>where
X: Deserialize<'de> + Extension,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<X: Eq + Extension> Eq for CreateIndex<X>
Source§impl<X: Extension + Render> Render for CreateIndex<X>
impl<X: Extension + Render> Render for CreateIndex<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for CreateIndex<X>
impl<X> Serialize for CreateIndex<X>
Source§impl<X: Extension> Spanned for CreateIndex<X>
impl<X: Extension> Spanned for CreateIndex<X>
impl<X: PartialEq + Extension> StructuralPartialEq for CreateIndex<X>
Auto Trait Implementations§
impl<X> Freeze for CreateIndex<X>
impl<X> RefUnwindSafe for CreateIndex<X>where
X: RefUnwindSafe,
impl<X> Send for CreateIndex<X>where
X: Send,
impl<X> Sync for CreateIndex<X>where
X: Sync,
impl<X> Unpin for CreateIndex<X>where
X: Unpin,
impl<X> UnsafeUnpin for CreateIndex<X>
impl<X> UnwindSafe for CreateIndex<X>where
X: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.