Add experimental Update and Insert type.

This commit is contained in:
Kei Hibino 2013-05-11 03:30:36 +09:00
parent 2816a2fd5e
commit 71558e4918

View File

@ -1,6 +1,9 @@
module Database.Relational.Query.Type (
Query (untypeQuery), unsafeTypedQuery, fromRelation
Query (untypeQuery), unsafeTypedQuery, fromRelation,
Update(untypeUpdate), unsafeTypedUpdate,
Insert(untypeInsert), unsafeTypedInsert
) where
import Database.Relational.Query.Relation (PrimeRelation)
@ -14,6 +17,16 @@ unsafeTypedQuery = Query
instance Show (Query p a) where
show = untypeQuery
fromRelation :: PrimeRelation p r -> Query p r
fromRelation = unsafeTypedQuery . Relation.toSQL
newtype Update p a = Update { untypeUpdate :: String }
unsafeTypedUpdate :: String -> Update p a
unsafeTypedUpdate = Update
newtype Insert a = Insert { untypeInsert :: String }
unsafeTypedInsert :: String -> Insert a
unsafeTypedInsert = Insert