| Copyright | 2013-2017 Kei Hibino | 
|---|---|
| License | BSD3 | 
| Maintainer | ex8k.hibino@gmail.com | 
| Stability | experimental | 
| Portability | unknown | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Database.Relational.Derives
Description
This module defines typed SQLs derived from type informations.
Synopsis
- specifiedKey :: PersistableWidth p => Pi a p -> Relation () a -> Relation p a
- uniqueSelect :: PersistableWidth p => Key Unique a p -> Relation () a -> Relation p a
- primarySelect :: HasConstraintKey Primary a p => Relation () a -> Relation p a
- updateByConstraintKey :: Table r -> Key c r p -> KeyUpdate p r
- primaryUpdate :: HasConstraintKey Primary r p => Table r -> KeyUpdate p r
- updateValuesWithKey :: ToSql q r => Pi r p -> r -> [q]
- derivedUniqueRelation :: TableDerivable r => Key Unique r k -> Record c k -> UniqueRelation () c r
- unique :: PersistableWidth p => Key Unique a p -> Relation () a -> Relation p a
- primary' :: PersistableWidth p => Key Primary a p -> Relation () a -> Relation p a
- primary :: HasConstraintKey Primary a p => Relation () a -> Relation p a
Query derivation
Arguments
| :: PersistableWidth p | |
| => Pi a p | Projection path | 
| -> Relation () a | 
 | 
| -> Relation p a | Result restricted  | 
Query restricted with specified key.
Arguments
| :: PersistableWidth p | |
| => Key Unique a p | Unique key proof object which record type is  | 
| -> Relation () a | 
 | 
| -> Relation p a | Result restricted  | 
Query restricted with specified unique key.
Arguments
| :: HasConstraintKey Primary a p | |
| => Relation () a | 
 | 
| -> Relation p a | Result restricted  | 
Query restricted with inferred primary key.
Update derivation
updateByConstraintKey Source #
Arguments
| :: Table r | 
 | 
| -> Key c r p | Key with constraint  | 
| -> KeyUpdate p r | Result typed  | 
Typed KeyUpdate using specified constraint key.
Arguments
| :: HasConstraintKey Primary r p | |
| => Table r | 
 | 
| -> KeyUpdate p r | Result typed  | 
Typed KeyUpdate using inferred primary key.
updateValuesWithKey :: ToSql q r => Pi r p -> r -> [q] Source #
Convert from Haskell type r into SQL value q list expected by update form like
UPDATE table SET c0 = ?, c1 = ?, ..., cn = ? WHERE key0 = ? AND key1 = ? AND key2 = ? ...
using derived RecordToSql proof object.
Derived objects from table
derivedUniqueRelation Source #
Arguments
| :: TableDerivable r | |
| => Key Unique r k | Unique key proof object which record type is  | 
| -> Record c k | Unique key value to specify. | 
| -> UniqueRelation () c r | Result restricted  | 
UniqueRelation inferred from table.
Deprecated
unique :: PersistableWidth p => Key Unique a p -> Relation () a -> Relation p a Source #
Deprecated: use uniqueSelect instead of this.
Deprecated.
Arguments
| :: PersistableWidth p | |
| => Key Primary a p | Primary key proof object which record type is  | 
| -> Relation () a | 
 | 
| -> Relation p a | Result restricted  | 
Deprecated: use primarySelect instead of this.
Deprecated.
primary :: HasConstraintKey Primary a p => Relation () a -> Relation p a Source #
Deprecated: use primarySelect instead of this.
Deprecated.