on dev help sign in
drop index
commit4149bd15807013d8bd92032d3ddf9ec6537b3744 authorEitan Chatav <eitan@EEM109LMBP-1.local> dateFri 30 Aug 2019, 14:18 (7 years ago) parent53523c5
1 file changed+11
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+11
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+11
@@ -61,6 +61,7 @@ module Squeal.PostgreSQL.Definition
6161 , dropTable
6262 , dropView
6363 , dropType
64+ , dropIndex
6465 -- ** Alter
6566 , alterTable
6667 , alterTableRename
@@ -1111,6 +1112,16 @@ instance RenderSQL IndexMethod where
11111112 Gin -> "gin"
11121113 Brin -> "brin"
11131114
1115+-- |
1116+-- >>> printSQL (dropIndex #ix :: Definition (Public '["ix" ::: 'Index]) (Public '[]))
1117+-- DROP INDEX "ix";
1118+dropIndex
1119+ :: (Has sch schemas schema, Has ix schema 'Index)
1120+ => QualifiedAlias sch ix
1121+ -- ^ name of the user defined type
1122+ -> Definition schemas (Alter sch (Drop ix schema) schemas)
1123+dropIndex ix = UnsafeDefinition $ "DROP" <+> "INDEX" <+> renderSQL ix <> ";"
1124+
11141125-- | Lift `PGTyped` to a field
11151126class FieldTyped schemas ty where
11161127 fieldtype :: Aliased (TypeExpression schemas) ty