hdbc-aeson 0.1.2.0 → 0.1.3.0
raw patch · 2 files changed
+5/−5 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Database.HDBC.Aeson: queryJ :: FromJSON a => Statement -> [SqlValue] -> IO a
+ Database.HDBC.Aeson: executeJ :: FromJSON a => Statement -> [SqlValue] -> IO a
Files
- Database/HDBC/Aeson.hs +4/−4
- hdbc-aeson.cabal +1/−1
Database/HDBC/Aeson.hs view
@@ -8,11 +8,11 @@ -- | Run a SQL query and return a value that can be cast via -- a FromJSON instance.-queryJ :: FromJSON a+executeJ :: FromJSON a => Statement -> [SqlValue] -> IO a-queryJ stmt vs = do+executeJ stmt vs = do _ <- execute stmt vs rows <- fetchAllRowsMap' stmt let result = fromJSON . toJSON $ rows@@ -28,8 +28,7 @@ -> IO b quickQueryJ conn query xs = do stmt <- prepare conn query- queryJ stmt xs-+ executeJ stmt xs instance ToJSON SqlValue where toJSON (SqlByteString x) = String . T.decodeUtf8 $ x@@ -39,6 +38,7 @@ toJSON (SqlDouble x) = Number $ realToFrac x toJSON (SqlBool x) = Bool x toJSON (SqlLocalTime x) = String . T.pack . show $ x+ toJSON (SqlZonedTime x) = String . T.pack . show $ x toJSON SqlNull = Null toJSON x = error $ "Please implement ToJSON instance for SqlValue: " ++ show x
hdbc-aeson.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: hdbc-aeson-version: 0.1.2.0+version: 0.1.3.0 synopsis: Deserialize from HDBC rows to FromJSON instances description: Deserialize from HDBC rows to FromJSON instances homepage: https://github.com/danchoi/hdbc-aeson