preql-0.5: safe PostgreSQL queries using Quasiquoters
Safe HaskellNone
LanguageHaskell2010

Preql.Effect.Internal

Description

We use IO in the representation of Transaction, but we don't want to allow arbitrary IO, only SQL queries. So keep it private.

Synopsis

Documentation

newtype Transaction a Source #

A Transaction can only contain SQL queries (and pure functions).

Instances

Instances details
Monad Transaction Source # 
Instance details

Defined in Preql.Effect.Internal

Methods

(>>=) :: Transaction a -> (a -> Transaction b) -> Transaction b #

(>>) :: Transaction a -> Transaction b -> Transaction b #

return :: a -> Transaction a #

Functor Transaction Source # 
Instance details

Defined in Preql.Effect.Internal

Methods

fmap :: (a -> b) -> Transaction a -> Transaction b #

(<$) :: a -> Transaction b -> Transaction a #

Applicative Transaction Source # 
Instance details

Defined in Preql.Effect.Internal

Methods

pure :: a -> Transaction a #

(<*>) :: Transaction (a -> b) -> Transaction a -> Transaction b #

liftA2 :: (a -> b -> c) -> Transaction a -> Transaction b -> Transaction c #

(*>) :: Transaction a -> Transaction b -> Transaction b #

(<*) :: Transaction a -> Transaction b -> Transaction a #

SqlQuery Transaction Source # 
Instance details

Defined in Preql.Effect

Methods

query :: (ToSql p, FromSql r, KnownNat (Width r)) => (Query (Width r), p) -> Transaction (Vector r) Source #

query_ :: ToSql p => (Query 0, p) -> Transaction () Source #