mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-03 03:52:10 +03:00
Update default not null instances list.
This commit is contained in:
parent
d7e1c08ba2
commit
5e2c8d9927
@ -15,10 +15,14 @@
|
||||
module Database.Record.Instances () where
|
||||
|
||||
import Data.Int (Int16, Int32, Int64)
|
||||
import Database.Record.TH (deriveNotNullValue)
|
||||
import Database.Record.TH (deriveNotNullType)
|
||||
|
||||
$(deriveNotNullValue [t| String |])
|
||||
$(deriveNotNullValue [t| Int |])
|
||||
$(deriveNotNullValue [t| Int16 |])
|
||||
$(deriveNotNullValue [t| Int32 |])
|
||||
$(deriveNotNullValue [t| Int64 |])
|
||||
$(fmap concat $ mapM deriveNotNullType
|
||||
[ [t| Bool |]
|
||||
, [t| Char |]
|
||||
, [t| String |]
|
||||
, [t| Int |]
|
||||
, [t| Int16 |]
|
||||
, [t| Int32 |]
|
||||
, [t| Int64 |]
|
||||
])
|
||||
|
@ -29,7 +29,7 @@ module Database.Record.TH (
|
||||
defineRecord,
|
||||
defineRecordDefault,
|
||||
|
||||
deriveNotNullValue
|
||||
deriveNotNullType
|
||||
) where
|
||||
|
||||
|
||||
@ -269,8 +269,8 @@ defineRecordDefault sqlValueType table columns derives = do
|
||||
return $ typ : withSql
|
||||
|
||||
|
||||
deriveNotNullValue :: TypeQ -> Q [Dec]
|
||||
deriveNotNullValue typeCon =
|
||||
deriveNotNullType :: TypeQ -> Q [Dec]
|
||||
deriveNotNullType typeCon =
|
||||
[d| instance PersistableWidth $typeCon where
|
||||
persistableWidth = Persistable.valueWidth
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user