@@ -31,6 +31,7 @@ module Squeal.PostgreSQL.Definition
3131 ( -- * Definition
3232 Definition (..)
3333 , (>>>)
34+ , manipDefinition
3435 -- * Tables
3536 -- ** Create
3637 , createSchema
@@ -103,6 +104,7 @@ import Squeal.PostgreSQL.Expression.Type
103104import Squeal.PostgreSQL.List
104105import Squeal.PostgreSQL.PG
105106import Squeal.PostgreSQL.Query
107+import Squeal.PostgreSQL.Manipulation
106108import Squeal.PostgreSQL.Render
107109import Squeal.PostgreSQL.Schema
108110
@@ -130,6 +132,14 @@ instance Category Definition where
130132 ddl1 . ddl0 = UnsafeDefinition $
131133 renderSQL ddl0 <> "\n" <> renderSQL ddl1
132134
135+-- | A `Manipulation` without input or output can be run as a statement
136+-- along with other `Definition`s, by embedding it using `manipDefinition`.
137+manipDefinition
138+ :: Manipulation '[] schemas '[] '[]
139+ -- ^ no input or output
140+ -> Definition schemas schemas
141+manipDefinition = UnsafeDefinition . (<> ";") . renderSQL
142+
133143{-----------------------------------------
134144CREATE statements
135145-----------------------------------------}