packages feed

mysql-simple 0.4.2.0 → 0.4.3

raw patch · 4 files changed

+10/−8 lines, 4 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.4.3++* Use Data.Time.Format to parse TimeOfDay results properly (missing in https://github.com/paul-rouse/mysql-simple/pull/37).+ ## 0.4.2.0  * Handle fractional seconds in parameter substitution (without affecting cases where only whole seconds are used).  https://github.com/paul-rouse/mysql-simple/pull/40
Database/MySQL/Simple/Result.hs view
@@ -181,12 +181,9 @@                                    <*> decimal  instance Result TimeOfDay where-    convert f = flip (atto ok) f $ do-                hours <- decimal <* char ':'-                mins <- decimal <* char ':'-                secs <- decimal :: Parser Int-                case makeTimeOfDayValid hours mins (fromIntegral secs) of-                  Just t -> return t+    convert f = doConvert f ok $ \bs ->+                case parseTime defaultTimeLocale "%T%Q" (B8.unpack bs) of+                  Just t -> t                   _      -> conversionFailed f "TimeOfDay" "could not parse"         where ok = mkCompats [Time] 
mysql-simple.cabal view
@@ -1,5 +1,5 @@ name:           mysql-simple-version:        0.4.2.0+version:        0.4.3 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.
test/main.hs view
@@ -11,7 +11,8 @@ testConn = defaultConnectInfo {                connectHost     = "127.0.0.1",                connectUser     = "test",-               connectDatabase = "test"+               connectDatabase = "test",+               connectPassword = "test"            }  -- Only the most cursory test is done at the moment, simply showing that