Copyright | 2013-2017 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
- restriction :: RestrictedStatement r () -> Restriction () r
- restriction' :: RestrictedStatement r (PlaceHolders p) -> Restriction p r
- data UpdateTarget p r
- 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
- data InsertTarget p r
- insertTarget :: Register r () -> InsertTarget () r
- insertTarget' :: Register r (PlaceHolders p) -> InsertTarget p r
- sqlWhereFromRestriction :: Config -> Table r -> Restriction p r -> StringSQL
- sqlFromUpdateTarget :: Config -> Table r -> UpdateTarget p r -> StringSQL
- sqlFromInsertTarget :: Config -> Table r -> InsertTarget 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) Source # | Show where clause. |
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) Source # | |
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
.
Object to express insert terget.
data InsertTarget p r Source #
InsertTarget type with place-holder parameter p
and projection record type r
.
insertTarget :: Register r () -> InsertTarget () r Source #
Finalize Register
monad and generate InsertTarget
.
insertTarget' :: Register r (PlaceHolders p) -> InsertTarget p r Source #
Finalize Target
monad and generate UpdateTarget
with place-holder parameter 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
sqlFromInsertTarget :: Config -> Table r -> InsertTarget p r -> StringSQL Source #
SQL INSERT statement StringSQL
string from InsertTarget