Update default not null instances list.

This commit is contained in:
Kei Hibino 2013-05-16 14:46:54 +09:00
parent d7e1c08ba2
commit 5e2c8d9927
2 changed files with 13 additions and 9 deletions

View File

@ -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 |]
])

View File

@ -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