@@ -16,6 +16,7 @@ Squeal queries.
1616 , LambdaCase
1717 , OverloadedStrings
1818 , StandaloneDeriving
19+ , TypeFamilies
1920 , TypeInType
2021 , TypeOperators
2122#-}
@@ -23,6 +24,7 @@ Squeal queries.
2324module Squeal.PostgreSQL.Query
2425 ( -- * Queries
2526 Query (UnsafeQuery, renderQuery)
27+ , Query'
2628 , union
2729 , unionAll
2830 , intersect
@@ -283,6 +285,9 @@ newtype Query
283285 deriving (GHC.Generic,Show,Eq,Ord,NFData)
284286instance RenderSQL (Query schema params columns) where renderSQL = renderQuery
285287
288+type family Query' schema x y where
289+ Query' schema x y = Query schema (ParamsFrom x) (ResultFrom y)
290+
286291-- | The results of two queries can be combined using the set operation
287292-- `union`. Duplicate rows are eliminated.
288293union