relational-query-HDBC 0.6.0.0 → 0.6.0.1
raw patch · 2 files changed
+13/−11 lines, 2 filesdep +th-data-compatPVP ok
version bump matches the API change (PVP)
Dependencies added: th-data-compat
API changes (from Hackage documentation)
Files
relational-query-HDBC.cabal view
@@ -1,5 +1,5 @@ name: relational-query-HDBC-version: 0.6.0.0+version: 0.6.0.1 synopsis: HDBC instance of relational-query and typed query interface for HDBC description: This package contains the HDBC instance of relational-query and the typed query interface for HDBC.@@ -11,7 +11,7 @@ license-file: LICENSE author: Kei Hibino, Shohei Murayama, Shohei Yasutake, Sho KURODA maintainer: ex8k.hibino@gmail.com, shohei.murayama@gmail.com, amutake.s@gmail.com, krdlab@gmail.com-copyright: Copyright (c) 2013 2014 Kei Hibino, Shohei Murayama, Shohei Yasutake, Sho KURODA+copyright: Copyright (c) 2013-2016 Kei Hibino, Shohei Murayama, Shohei Yasutake, Sho KURODA category: Database build-type: Simple cabal-version: >=1.10@@ -47,6 +47,7 @@ , convertible , template-haskell , dlist+ , th-data-compat , names-th , persistable-record >= 0.4
src/Database/HDBC/Record/InternalTH.hs view
@@ -3,7 +3,7 @@ -- | -- Module : Database.HDBC.Record.InternalTH--- Copyright : 2013 Kei Hibino+-- Copyright : 2013,2014,2016 Kei Hibino -- License : BSD3 -- -- Maintainer : ex8k.hibino@gmail.com@@ -21,8 +21,9 @@ import qualified Data.Set as Set import Language.Haskell.TH- (Q, Dec (InstanceD), Type(AppT, ConT),+ (Q, Dec, Type(AppT, ConT), Info (ClassI), reify)+import Language.Haskell.TH.Compat.Data (unInstanceD) import Data.Convertible (Convertible) import Database.HDBC (SqlValue) import Database.HDBC.SqlValueExtra ()@@ -67,8 +68,8 @@ cvInfo = reify ''Convertible unknownDeclaration = fail . ("convertibleSqlValues: Unknown declaration pattern: " ++)- d0 (ClassI _ is) = fmap catMaybes . mapM d1 $ is where- d1 (InstanceD _cxt (AppT (AppT (ConT _n) a) b) _ds)+ d0 (ClassI _ is) = fmap catMaybes $ mapM (d1 . unInstanceD) is where+ d1 (Just (_cxt, (AppT (AppT (ConT _n) a) b), _ds)) = do qvt <- sqlValueType return $ if qvt == a || qvt == b@@ -76,8 +77,8 @@ (ConT _, ConT _) -> Just (a, b) _ -> Nothing else Nothing- d1 decl- = unknownDeclaration $ show decl+ d1 _+ = unknownDeclaration $ show is d0 cls = unknownDeclaration $ show cls -- | Get types which are 'Convertible' with.@@ -95,9 +96,9 @@ cvInfo = reify ''PersistableWidth unknownDeclaration = fail . ("persistableWidthTypes: Unknown declaration pattern: " ++)- d0 (ClassI _ is) = fmap fromList . mapM d1 $ is where- d1 (InstanceD _cxt (AppT (ConT _n) a) _ds) = return a- d1 decl = unknownDeclaration $ show decl+ d0 (ClassI _ is) = fmap fromList $ mapM (d1 . unInstanceD) is where+ d1 (Just (_cxt, (AppT (ConT _n) a), _ds)) = return a+ d1 _ = unknownDeclaration $ show is d0 cls = unknownDeclaration $ show cls -- | Map instance declarations.