Copyright  20132017 Kei Hibino 

License  BSD3 
Maintainer  ex8k.hibino@gmail.com 
Stability  experimental 
Portability  unknown 
Safe Haskell  None 
Language  Haskell2010 
This module defines typed SQLs derived from type informations.
 specifiedKey :: PersistableWidth p => Pi a p > Relation () a > Relation p a
 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
 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 > Projection c k > UniqueRelation () c r
Query derivation
:: PersistableWidth p  
=> Pi a p  Unique key proof object which record type is 
> Relation () a 

> Relation p a  Result restricted 
Query restricted with specified key.
:: 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.
:: PersistableWidth p  
=> Key Primary a p  Primary key proof object which record type is 
> Relation () a 

> Relation p a  Result restricted 
Query restricted with specified primary key.
:: HasConstraintKey Primary a p  
=> Relation () a 

> Relation p a  Result restricted 
Query restricted with inferred primary key.
Update derivation
updateByConstraintKey Source #
:: Table r 

> Key c r p  Key with constraint 
> KeyUpdate p r  Result typed 
Typed KeyUpdate
using specified constraint key.
:: 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 #
:: TableDerivable r  
=> Key Unique r k  Unique key proof object which record type is 
> Projection c k  Unique key value to specify. 
> UniqueRelation () c r  Result restricted 
UniqueRelation
inferred from table.