@@ -27,9 +27,6 @@ Squeal queries.
27module Squeal.PostgreSQL.Query
27module Squeal.PostgreSQL.Query
28 ( -- * Queries
28 ( -- * Queries
29 Query (UnsafeQuery, renderQuery)
29 Query (UnsafeQuery, renderQuery)
34 , unionAll
31 , unionAll
35 , intersect
32 , intersect
@@ -79,9 +76,7 @@ module Squeal.PostgreSQL.Query
80import Control.DeepSeq
77import Control.DeepSeq
81import Data.ByteString (ByteString)
78import Data.ByteString (ByteString)
83import Data.Monoid hiding (All)
79import Data.Monoid hiding (All)
84−import Data.Profunctor
85import Data.String
80import Data.String
86import Data.Word
81import Data.Word
87import Generics.SOP hiding (from)
82import Generics.SOP hiding (from)
@@ -89,7 +84,6 @@ import GHC.TypeLits
90import qualified GHC.Generics as GHC
85import qualified GHC.Generics as GHC
92−import Squeal.PostgreSQL.Binary
93import Squeal.PostgreSQL.Expression
87import Squeal.PostgreSQL.Expression
94import Squeal.PostgreSQL.Render
88import Squeal.PostgreSQL.Render
95import Squeal.PostgreSQL.Schema
89import Squeal.PostgreSQL.Schema
@@ -293,28 +287,6 @@ newtype Query
293 deriving (GHC.Generic,Show,Eq,Ord,NFData)
287 deriving (GHC.Generic,Show,Eq,Ord,NFData)
294instance RenderSQL (Query schema params columns) where renderSQL = renderQuery
288instance RenderSQL (Query schema params columns) where renderSQL = renderQuery
297− (schema :: SchemaType)
302− :: (x -> NP (K (Maybe ByteString)) params)
303− -> Query schema params result
304− -> (NP (K (Maybe ByteString)) result -> y)
305− -> QueryFrom schema x y
306−instance Profunctor (QueryFrom schema) where
307− dimap f g (QueryFrom params q result) = QueryFrom (params.f) q (g.result)
310− :: (ToParams x (ParamsFrom x), FromRow (ResultFrom y) y)
311− => Query schema (ParamsFrom x) (ResultFrom y)
312− -> QueryFrom schema x y
313−queryFrom q = QueryFrom toParams q fromRow
315−type family Query' schema x y where
316− Query' schema x y = Query schema (ParamsFrom x) (ResultFrom y)
318-- | The results of two queries can be combined using the set operation
290-- | The results of two queries can be combined using the set operation
319-- `union`. Duplicate rows are eliminated.
291-- `union`. Duplicate rows are eliminated.