Copyright | 2013 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module defines effect statements like update and delete.
- data Restriction p r
- type RestrictionContext p r = RestrictedStatement r (PlaceHolders p)
- restriction :: RestrictedStatement r () -> Restriction () r
- restriction' :: RestrictedStatement r (PlaceHolders p) -> Restriction p r
- data UpdateTarget p r
- type UpdateTargetContext p r = AssignStatement r (PlaceHolders p)
- updateTarget :: AssignStatement r () -> UpdateTarget () r
- updateTarget' :: AssignStatement r (PlaceHolders p) -> UpdateTarget p r
- liftTargetAllColumn :: PersistableWidth r => Restriction () r -> UpdateTarget r r
- liftTargetAllColumn' :: PersistableWidth r => Restriction p r -> UpdateTarget (r, p) r
- updateTargetAllColumn :: PersistableWidth r => RestrictedStatement r () -> UpdateTarget r r
- updateTargetAllColumn' :: PersistableWidth r => RestrictedStatement r (PlaceHolders p) -> UpdateTarget (r, p) r
- sqlWhereFromRestriction :: Config -> Table r -> Restriction p r -> StringSQL
- sqlFromUpdateTarget :: Config -> Table r -> UpdateTarget p r -> StringSQL
Object to express simple restriction.
data Restriction p r Source
Restriction type with place-holder parameter p
and projection record type r
.
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
.
TableDerivable r => Show (UpdateTarget p r) |
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