mysql-simple 0.4.7 → 0.4.7.1
raw patch · 4 files changed
+23/−5 lines, 4 filesdep ~time
Dependency ranges changed: time
Files
- ChangeLog.md +4/−0
- Database/MySQL/Simple/Result.hs +3/−3
- Database/MySQL/Simple/Types.hs +14/−0
- mysql-simple.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.4.7.1++* Use parseTimeM from Data.Time.Format instead of parseTime (https://github.com/paul-rouse/mysql-simple/pull/53)+ ## 0.4.7 * Allow JSON fields to be read in as ByteStrings (https://github.com/paul-rouse/mysql-simple/pull/52)
Database/MySQL/Simple/Result.hs view
@@ -39,7 +39,7 @@ import Data.Ratio (Ratio) import Data.Time.Calendar (Day, fromGregorian) import Data.Time.Clock (UTCTime(..))-import Data.Time.Format (parseTime)+import Data.Time.Format (parseTimeM) import Data.Time.LocalTime (TimeOfDay, makeTimeOfDayValid) import Data.Typeable (TypeRep, Typeable, typeOf) import Data.Word (Word, Word8, Word16, Word32, Word64)@@ -162,7 +162,7 @@ instance Result UTCTime where convert f = doConvert f ok $ \bs ->- case parseTime defaultTimeLocale "%F %T%Q" (B8.unpack bs) of+ case parseTimeM True defaultTimeLocale "%F %T%Q" (B8.unpack bs) of Just t -> t Nothing | SB.isPrefixOf "0000-00-00" bs ->@@ -182,7 +182,7 @@ instance Result TimeOfDay where convert f = doConvert f ok $ \bs ->- case parseTime defaultTimeLocale "%T%Q" (B8.unpack bs) of+ case parseTimeM True defaultTimeLocale "%T%Q" (B8.unpack bs) of Just t -> t _ -> conversionFailed f "TimeOfDay" "could not parse" where ok = mkCompats [Time]
Database/MySQL/Simple/Types.hs view
@@ -31,12 +31,26 @@ import qualified Data.ByteString as B -- | A placeholder for the SQL @NULL@ value.+--+-- Prior to @mysql-simple-0.5@, an 'Eq' instance was provided for 'Null'.+-- In an attempt to mirror SQL semantics, it unconditionally produced+-- 'False' for both '==' and '/='. However, this is not correct SQL semantics,+-- and in any case it is unclear why those semantics in Haskell would be+-- caried over to a Haskell program manipulating a database. A proposal has+-- been accepted to remove '/=' from the 'Eq' class, so this non-law-abiding+-- instance will become impossible. Therefore, the 'Eq' instance will simply+-- be removed.+--+-- Currently a WARNING is produced for uses of the 'Null' type since it is+-- not possible to attach a DEPRECATED pragma to an instance.+-- data Null = Null deriving (Read, Show, Typeable) instance Eq Null where _ == _ = False _ /= _ = False+{-# WARNING Null "The Eq instance of Null is deprecated: see the documentation for Null in Database.MySQL.Simple.Types" #-} -- | A query string. This type is intended to make it difficult to -- construct a SQL query by concatenating string fragments, as that is
mysql-simple.cabal view
@@ -1,5 +1,5 @@ name: mysql-simple-version: 0.4.7+version: 0.4.7.1 homepage: https://github.com/paul-rouse/mysql-simple bug-reports: https://github.com/paul-rouse/mysql-simple/issues synopsis: A mid-level MySQL client library.@@ -54,7 +54,7 @@ pcre-light, old-locale, text >= 0.11.0.2,- time+ time >= 1.5 if !impl(ghc >= 8.0) build-depends: semigroups >= 0.11 && < 0.19