@@ -63,6 +63,7 @@ module Squeal.PostgreSQL.Definition
6363 , dropView
6464 , dropType
6565 , dropIndex
66+ , dropFunction
6667 -- ** Alter
6768 , alterTable
6869 , alterTableRename
@@ -1124,6 +1125,14 @@ createFunction fun arg ret fundef = UnsafeDefinition $
11241125 "CREATE" <+> "FUNCTION" <+> renderSQL fun <+> parenthesized (renderSQL arg)
11251126 <+> "RETURNS" <+> renderSQL ret <+> renderSQL fundef <> ";"
11261127
1128+dropFunction
1129+ :: (Has sch schemas schema, Has fun schema ('Function arg ret))
1130+ => QualifiedAlias sch fun
1131+ -- ^ name of the user defined function
1132+ -> Definition schemas (Alter sch (Drop ix schema) schemas)
1133+dropFunction fun = UnsafeDefinition $
1134+ "DROP" <+> "Function" <+> renderSQL fun <> ";"
1135+
11271136newtype FunctionDefinition schemas arg ret = UnsafeFunctionDefinition
11281137 { renderFunctionDefinition :: ByteString }
11291138 deriving (Eq,Show,GHC.Generic,NFData)
@@ -1136,7 +1145,7 @@ instance RenderSQL (FunctionDefinition schemas arg ret) where
11361145dropIndex
11371146 :: (Has sch schemas schema, Has ix schema 'Index)
11381147 => QualifiedAlias sch ix
1139− -- ^ name of the user defined type
1148+ -- ^ name of the user defined index
11401149 -> Definition schemas (Alter sch (Drop ix schema) schemas)
11411150dropIndex ix = UnsafeDefinition $ "DROP" <+> "INDEX" <+> renderSQL ix <> ";"
11421151