{-# language FlexibleContexts #-}
module Rel8.Query.Rebind
( rebind
)
where
import Prelude
import Control.Arrow ((<<<))
import qualified Opaleye.Internal.Rebind as Opaleye
import Rel8.Expr ( Expr )
import Rel8.Query ( Query )
import Rel8.Table ( Table )
import Rel8.Table.Opaleye ( unpackspec )
import Rel8.Query.Opaleye (fromOpaleye)
rebind :: Table Expr a => String -> a -> Query a
rebind :: forall a. Table Expr a => String -> a -> Query a
rebind String
prefix a
a = forall a. Select a -> Query a
fromOpaleye (forall a b. String -> Unpackspec a b -> SelectArr a b
Opaleye.rebindExplicitPrefix String
prefix forall a. Table Expr a => Unpackspec a a
unpackspec forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
<<< forall (f :: * -> *) a. Applicative f => a -> f a
pure a
a)