@@ -61,6 +61,7 @@ module Squeal.PostgreSQL.Definition
61 , dropTable
61 , dropTable
62 , dropView
62 , dropView
63 , dropType
63 , dropType
64 -- ** Alter
65 -- ** Alter
65 , alterTable
66 , alterTable
66 , alterTableRename
67 , alterTableRename
@@ -1111,6 +1112,16 @@ instance RenderSQL IndexMethod where
1111 Gin -> "gin"
1112 Gin -> "gin"
1112 Brin -> "brin"
1113 Brin -> "brin"
1116+-- >>> printSQL (dropIndex #ix :: Definition (Public '["ix" ::: 'Index]) (Public '[]))
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 <> ";"
1114-- | Lift `PGTyped` to a field
1125-- | Lift `PGTyped` to a field
1115class FieldTyped schemas ty where
1126class FieldTyped schemas ty where
1116 fieldtype :: Aliased (TypeExpression schemas) ty
1127 fieldtype :: Aliased (TypeExpression schemas) ty