mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-01 13:52:12 +03:00
Adjust int-type width of MySQL driver type-mapping.
This commit is contained in:
parent
6c027c111b
commit
e4201620f4
@ -8,7 +8,7 @@ module Database.Relational.Schema.MySQL
|
||||
)
|
||||
where
|
||||
|
||||
import Data.Int (Int32, Int64)
|
||||
import Data.Int (Int8, Int16, Int32, Int64)
|
||||
import Data.Char (toLower, toUpper)
|
||||
import Data.Map (Map, fromList)
|
||||
import qualified Data.Map as Map
|
||||
@ -38,6 +38,8 @@ import qualified Database.Relational.Schema.MySQLInfo.TableConstraints as Tabco
|
||||
import Database.Relational.Schema.MySQLInfo.KeyColumnUsage (keyColumnUsage)
|
||||
import qualified Database.Relational.Schema.MySQLInfo.KeyColumnUsage as Keycoluse
|
||||
|
||||
-- TODO: Need to check unsigned int types to avoid wrong mapping
|
||||
|
||||
mapFromSqlDefault :: Map String TypeQ
|
||||
mapFromSqlDefault = fromList
|
||||
[ ("CHAR", [t| String |])
|
||||
@ -54,8 +56,8 @@ mapFromSqlDefault = fromList
|
||||
, ("DATETIME", [t| LocalTime |])
|
||||
, ("TIME", [t| TimeOfDay |])
|
||||
, ("TIMESTAMP", [t| POSIXTime |])
|
||||
, ("TINYINT", [t| Int32 |])
|
||||
, ("SMALLINT", [t| Int32 |])
|
||||
, ("TINYINT", [t| Int8 |])
|
||||
, ("SMALLINT", [t| Int16 |])
|
||||
, ("MEDIUMINT", [t| Int32 |])
|
||||
, ("INT", [t| Int32 |])
|
||||
, ("INTEGER", [t| Int32 |])
|
||||
|
Loading…
Reference in New Issue
Block a user