relational-query-0.5.0.0: Typeful, Modular, Relational, algebraic query engine

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Query.Effect

Contents

Description

This module defines effect statements like update and delete.

Synopsis

Object to express simple restriction.

data Restriction p r Source

Restriction type with place-holder parameter p and projection record type r.

Instances

TableDerivable r => Show (Restriction p r)

Show where clause.

type RestrictionContext p r = RestrictedStatement r (PlaceHolders p) Source

Not finalized Restrict monad type.

restriction :: RestrictedStatement r () -> Restriction () r Source

Finalize Restrict monad and generate Restriction.

restriction' :: RestrictedStatement r (PlaceHolders p) -> Restriction p r Source

Finalize Restrict monad and generate Restriction with place-holder parameter p

Object to express update target columns and restriction.

data UpdateTarget p r Source

UpdateTarget type with place-holder parameter p and projection record type r.

Instances

type UpdateTargetContext p r = AssignStatement r (PlaceHolders p) Source

Not finalized Target monad type.

updateTarget :: AssignStatement r () -> UpdateTarget () r Source

Finalize Target monad and generate UpdateTarget.

updateTarget' :: AssignStatement r (PlaceHolders p) -> UpdateTarget p r Source

Finalize Target monad and generate UpdateTarget with place-holder parameter p.

liftTargetAllColumn :: PersistableWidth r => Restriction () r -> UpdateTarget r r Source

Lift Restriction to UpdateTarget. Update target columns are all.

liftTargetAllColumn' :: PersistableWidth r => Restriction p r -> UpdateTarget (r, p) r Source

Lift Restriction to UpdateTarget. Update target columns are all. With placefolder type p.

updateTargetAllColumn :: PersistableWidth r => RestrictedStatement r () -> UpdateTarget r r Source

Finalize Restrict monad and generate UpdateTarget. Update target columns are all.

updateTargetAllColumn' :: PersistableWidth r => RestrictedStatement r (PlaceHolders p) -> UpdateTarget (r, p) r Source

Finalize Restrict monad and generate UpdateTarget. Update target columns are all. With placefolder type p.

Generate SQL from restriction.

sqlWhereFromRestriction :: Config -> Table r -> Restriction p r -> StringSQL Source

SQL WHERE clause StringSQL string from Restriction.

sqlFromUpdateTarget :: Config -> Table r -> UpdateTarget p r -> StringSQL Source

SQL SET clause and WHERE clause StringSQL string from UpdateTarget