seakale-0.1.0.0: Pure SQL layer on top of other libraries

Safe HaskellNone
LanguageHaskell2010

Database.Seakale.Request.Internal

Documentation

data RequestF backend a Source #

Constructors

Query ByteString (([ColumnInfo backend], [Row backend]) -> a) 
Execute ByteString (Integer -> a) 
GetBackend (backend -> a) 
ThrowError SeakaleError 
CatchError a (SeakaleError -> a) 

Instances

Monad m => MonadSeakaleBase backend (FreeT (RequestF backend) m) Source # 

Methods

getBackend :: FreeT (RequestF backend) m backend Source #

throwSeakaleError :: SeakaleError -> FreeT (RequestF backend) m a Source #

catchSeakaleError :: FreeT (RequestF backend) m a -> (SeakaleError -> FreeT (RequestF backend) m a) -> FreeT (RequestF backend) m a Source #

Monad m => MonadRequest backend (FreeT (RequestF backend) m) Source # 

Methods

query :: ByteString -> FreeT (RequestF backend) m ([ColumnInfo backend], [Row backend]) Source #

execute :: ByteString -> FreeT (RequestF backend) m Integer Source #

Monad m => MonadStore backend (RequestT backend m) Source # 

Methods

insert :: (Storable backend k l b, ToRow backend l b, FromRow backend k (EntityID b)) => [b] -> RequestT backend m [EntityID b] Source #

update :: Storable backend k l a => UpdateSetter backend a -> Condition backend a -> RequestT backend m Integer Source #

delete :: Storable backend k l a => Condition backend a -> RequestT backend m Integer Source #

Monad m => MonadSelect backend (RequestT backend m) Source # 

Methods

select :: (Storable backend k l a, FromRow backend (k :+ l) (Entity a)) => Relation backend k l a -> Condition backend a -> SelectClauses backend a -> RequestT backend m [Entity a] Source #

count :: Storable backend k l a => Relation backend k l a -> Condition backend a -> RequestT backend m Integer Source #

Functor (RequestF backend) Source # 

Methods

fmap :: (a -> b) -> RequestF backend a -> RequestF backend b #

(<$) :: a -> RequestF backend b -> RequestF backend a #

type RequestT backend = FreeT (RequestF backend) Source #

type Request backend = RequestT backend Identity Source #

class MonadSeakaleBase backend m => MonadRequest backend m where Source #

Minimal complete definition

query, execute

Methods

query :: ByteString -> m ([ColumnInfo backend], [Row backend]) Source #

execute :: ByteString -> m Integer Source #

Instances

(MonadRequest backend m, MonadTrans t, MonadSeakaleBase backend (t m)) => MonadRequest backend (t m) Source # 

Methods

query :: ByteString -> t m ([ColumnInfo backend], [Row backend]) Source #

execute :: ByteString -> t m Integer Source #

Monad m => MonadRequest backend (FreeT (RequestF backend) m) Source # 

Methods

query :: ByteString -> FreeT (RequestF backend) m ([ColumnInfo backend], [Row backend]) Source #

execute :: ByteString -> FreeT (RequestF backend) m Integer Source #

runRequestT :: (Backend backend, MonadBackend backend m, Monad m) => backend -> RequestT backend m a -> m (Either SeakaleError a) Source #

runRequest :: (Backend backend, MonadBackend backend m, Monad m) => backend -> Request backend a -> m (Either SeakaleError a) Source #