Structure
SQLCreateIndex
An expression representing a
CREATE INDEX query. Used to add indexes over columns to an existing table.struct SQLCreateIndex
Overview
CREATE INDEX "name" ON "table" ("column1", "column2") WHERE "column1"=$0;
Not all dialects support index predicates, nor does this expression attempt to support all of the numerous additional indexing options available with different drivers.
Note
Because support for an IF NOT EXISTS clause on CREATE IDNEX queries varies in unusual ways between dialects, it is not currently supported by this expression.
Topics
Initializers
init(name:)Create a index creation query.
Instance Properties
columnsThe list of columns covered by the index.modifierIf notnil, must be set toSQLColumnConstraintAlgorithm.unique.nameThe name of the index.predicateIf notnil, a predicate identifying which rows of the table are included in the index.tableThe table containing the data to be indexed.
Instance Methods
serialize(to:)Invoked when a request is made to serialize the expression to raw SQL.
Relationships
Conforms To
SQLExpressionSwift.SendableSwift.SendableMetatype
See Also
Query Expressions
SQLAlterEnumAn expression representing anALTER TYPEquery. Used to add new cases to enumeration types.SQLAlterTableAn expression representing anALTER TABLEquery. Used to modify the structure of existing tables.SQLCreateEnumAn expression representing aCREATE TYPEquery. Used to create enumeration types.SQLCreateTableAn expression representing aCREATE TABLEquery. Used to create new tables.SQLCreateTriggerAn expression representing aCREATE TRIGGERquery. Used to create new triggers for actions on a table.SQLDeleteAn expression representing aCREATE TRIGGERquery. Used to remove rows from a table.SQLDropEnumAn expression representing aDROP TYPEquery. Used to delete enumeration types.SQLDropIndexAn expression representing aDROP INDEXquery. Used to delete indexes from tables.SQLDropTableAn expression representing aDROP TABLEquery. Used to delete entire tables.SQLDropTriggerAn expression representing aDROP TRIGGERquery. Used to delete triggers.SQLInsertAn expression representing anINSERTquery. Used to add new rows to a table.SQLSelectAn expression representing aSELECTquery. Used to retrieve rows and expression results from a database.SQLUnionAn expression representing two or moreSELECTqueries joined byUNIONclauses. Used to merge the results of multiple queries into a single result set.SQLUpdateAn expression representing anUPDATEquery. Used to modify existing rows in a single table.