Structure
SQLDropIndex
An expression representing a
DROP INDEX query. Used to delete indexes from tables.struct SQLDropIndex
Overview
DROP INDEX IF EXISTS ON `table` CASCADE;
Not all dialects require or allow specifying the owning table of an index when dropping it, while others enforce doing so. There is no dialect functionality enabling a check for this at this time, so users must track for themselves whether or not to specify the table. At the time of this writing, the table must be specified for MySQL and must not be specified for other drivers.
See SQLDropIndexBuilder.
Topics
Initializers
init(name:)Create a new index deletion query.
Instance Properties
behaviorA drop behavior.ifExistsIftrue, requests idempotent behavior (e.g. that no error be raised if the named index does not exist).nameThe name of the index to drop.owningObjectThe object (usually a table) on which the index exists.
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.SQLCreateIndexAn expression representing aCREATE INDEXquery. Used to add indexes over columns to an existing table.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.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.