mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-11-29 06:37:03 +03:00
relational-query: simplified.
This commit is contained in:
parent
a90d319eae
commit
6786d95ae8
@ -112,12 +112,10 @@ defineHasConstraintKeyInstance :: TypeQ -- ^ Constraint type
|
|||||||
-> TypeQ -- ^ Key type
|
-> TypeQ -- ^ Key type
|
||||||
-> [Int] -- ^ Indexes specifies key
|
-> [Int] -- ^ Indexes specifies key
|
||||||
-> Q [Dec] -- ^ Result 'HasConstraintKey' declaration
|
-> Q [Dec] -- ^ Result 'HasConstraintKey' declaration
|
||||||
defineHasConstraintKeyInstance constraint recType colType indexes = do
|
defineHasConstraintKeyInstance constraint recType colType indexes =
|
||||||
-- kc <- defineHasColumnConstraintInstance constraint recType index
|
[d| instance HasConstraintKey $constraint $recType $colType where
|
||||||
ck <- [d| instance HasConstraintKey $constraint $recType $colType where
|
constraintKey = unsafeDefineConstraintKey $(listE [integralE ix | ix <- indexes])
|
||||||
constraintKey = unsafeDefineConstraintKey $(listE [integralE ix | ix <- indexes])
|
|]
|
||||||
|]
|
|
||||||
return ck
|
|
||||||
|
|
||||||
-- | Rule template to infer primary key.
|
-- | Rule template to infer primary key.
|
||||||
defineHasPrimaryKeyInstance :: TypeQ -- ^ Record type
|
defineHasPrimaryKeyInstance :: TypeQ -- ^ Record type
|
||||||
|
Loading…
Reference in New Issue
Block a user