mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-15 14:53:28 +03:00
Update definition order.
This commit is contained in:
parent
343d9720c3
commit
af772cf52c
@ -62,17 +62,17 @@ import Database.Record.Persistable
|
||||
import qualified Database.Record.Persistable as Persistable
|
||||
|
||||
|
||||
defineHasKeyConstraintInstance :: TypeQ -> TypeQ -> Int -> Q [Dec]
|
||||
defineHasKeyConstraintInstance constraint typeCon index =
|
||||
[d| instance HasKeyConstraint $constraint $typeCon where
|
||||
keyConstraint = specifyKeyConstraint $(integralE index) |]
|
||||
|
||||
recordTypeNameDefault :: String -> ConName
|
||||
recordTypeNameDefault = conCamelcaseName
|
||||
|
||||
recordTypeDefault :: String -> TypeQ
|
||||
recordTypeDefault = toTypeCon . recordTypeNameDefault
|
||||
|
||||
defineHasKeyConstraintInstance :: TypeQ -> TypeQ -> Int -> Q [Dec]
|
||||
defineHasKeyConstraintInstance constraint typeCon index =
|
||||
[d| instance HasKeyConstraint $constraint $typeCon where
|
||||
keyConstraint = specifyKeyConstraint $(integralE index) |]
|
||||
|
||||
defineHasNotNullKeyInstance :: TypeQ -> Int -> Q [Dec]
|
||||
defineHasNotNullKeyInstance =
|
||||
defineHasKeyConstraintInstance [t| NotNull |]
|
||||
|
Loading…
Reference in New Issue
Block a user