mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-12 12:09:08 +03:00
Add experimental Update and Insert type.
This commit is contained in:
parent
2816a2fd5e
commit
71558e4918
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user