freer-extras-1.2.0.0: Useful extensions to simple-freer
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Freer.Extras.Beam.Effects

Documentation

type Synt dbt = Sql92ExpressionValueSyntax (Sql92SelectTableExpressionSyntax (Sql92SelectSelectTableSyntax (Sql92SelectSyntax (BeamSqlBackendSyntax dbt)))) Source #

data BeamEffect dbt r where Source #

Constructors

AddRowsInBatches :: BeamableDb dbt table => Int -> DatabaseEntity dbt db (TableEntity table) -> [table Identity] -> BeamEffect dbt () 
AddRows :: BeamableDb dbt table => SqlInsert dbt table -> BeamEffect dbt () 
UpdateRows :: Beamable table => SqlUpdate dbt table -> BeamEffect dbt () 
DeleteRows :: Beamable table => SqlDelete dbt table -> BeamEffect dbt () 
SelectList :: FromBackendRow dbt a => SqlSelect dbt a -> BeamEffect dbt [a] 
SelectPage :: (FromBackendRow dbt a, HasSqlValueSyntax (Synt dbt) a, HasQBuilder dbt) => PageQuery a -> Q dbt db BeamThreadingArg (QExpr dbt BeamThreadingArg a) -> BeamEffect dbt (Page a)

Select using Seek Pagination.

SelectOne :: FromBackendRow dbt a => SqlSelect dbt a -> BeamEffect dbt (Maybe a) 
Combined :: [BeamEffect dbt ()] -> BeamEffect dbt () 

Instances

Instances details
Semigroup (BeamEffect dbt ()) Source # 
Instance details

Defined in Control.Monad.Freer.Extras.Beam.Effects

Methods

(<>) :: BeamEffect dbt () -> BeamEffect dbt () -> BeamEffect dbt () Source #

sconcat :: NonEmpty (BeamEffect dbt ()) -> BeamEffect dbt () Source #

stimes :: Integral b => b -> BeamEffect dbt () -> BeamEffect dbt () Source #

Monoid (BeamEffect dbt ()) Source # 
Instance details

Defined in Control.Monad.Freer.Extras.Beam.Effects

Methods

mempty :: BeamEffect dbt () Source #

mappend :: BeamEffect dbt () -> BeamEffect dbt () -> BeamEffect dbt () Source #

mconcat :: [BeamEffect dbt ()] -> BeamEffect dbt () Source #

addRowsInBatches :: forall dbt table db effs. (BeamableDb dbt table, Member (BeamEffect dbt) effs) => Int -> DatabaseEntity dbt db (TableEntity table) -> [table Identity] -> Eff effs () Source #

addRows :: forall dbt table effs. (BeamableDb dbt table, Member (BeamEffect dbt) effs) => SqlInsert dbt table -> Eff effs () Source #

updateRows :: forall dbt table effs. (Beamable table, Member (BeamEffect dbt) effs) => SqlUpdate dbt table -> Eff effs () Source #

deleteRows :: forall dbt table effs. (Beamable table, Member (BeamEffect dbt) effs) => SqlDelete dbt table -> Eff effs () Source #

selectList :: forall dbt a effs. (FromBackendRow dbt a, Member (BeamEffect dbt) effs) => SqlSelect dbt a -> Eff effs [a] Source #

selectPage :: forall dbt a db effs. (FromBackendRow dbt a, HasSqlValueSyntax (Synt dbt) a, Member (BeamEffect dbt) effs, HasQBuilder dbt) => PageQuery a -> Q dbt db BeamThreadingArg (QExpr dbt BeamThreadingArg a) -> Eff effs (Page a) Source #

selectOne :: forall dbt a effs. (FromBackendRow dbt a, Member (BeamEffect dbt) effs) => SqlSelect dbt a -> Eff effs (Maybe a) Source #

combined :: forall dbt effs. Member (BeamEffect dbt) effs => [BeamEffect dbt ()] -> Eff effs () Source #

handleBeam :: forall dbt (dbM :: Type -> Type) effs. (BeamSqlBackend dbt, MonadBeam dbt dbM, BeamHasInsertOnConflict dbt) => (Trace IO BeamLog -> dbM ~> Eff effs) -> Trace IO BeamLog -> BeamEffect dbt ~> Eff effs Source #