on fadfc3e help sign in
rel8/src/Rel8/Query/Each.hs
29 lines 594 B history raw
1{-# language FlexibleContexts #-}
3module Rel8.Query.Each
4 ( each
5 )
6where
8-- base
9import Prelude
11-- opaleye
12import qualified Opaleye.Table as Opaleye
14-- rel8
15import Rel8.Query ( Query )
16import Rel8.Query.Opaleye ( fromOpaleye )
17import Rel8.Schema.Table ( TableSchema )
18import Rel8.Table ( fromColumns, toColumns )
19import Rel8.Table.Opaleye ( table, unpackspec )
20import Rel8.Table.Recontextualize ( Selects )
23each :: Selects names exprs => TableSchema names -> Query exprs
24each =
25 fmap fromColumns .
26 fromOpaleye .
27 Opaleye.selectTableExplicit unpackspec .
28 table .
29 fmap toColumns