groundhog-mysql 0.8.0.1 → 0.9.0
raw patch · 3 files changed
+22/−6 lines, 3 filesdep ~groundhogPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: groundhog
API changes (from Hackage documentation)
- Database.Groundhog.MySQL: data ConnectInfo :: *
+ Database.Groundhog.MySQL: data ConnectInfo
- Database.Groundhog.MySQL: data SSLInfo :: *
+ Database.Groundhog.MySQL: data SSLInfo
Files
- Database/Groundhog/MySQL.hs +17/−4
- changelog +3/−0
- groundhog-mysql.cabal +2/−2
Database/Groundhog/MySQL.hs view
@@ -47,9 +47,13 @@ import Data.IORef (newIORef, readIORef, writeIORef) import Data.List (groupBy, intercalate, intersect, isInfixOf, partition, stripPrefix) import Data.Maybe (fromJust, fromMaybe, isJust)-import Data.Monoid+import Data.Monoid hiding ((<>)) import Data.Pool +-- work around for no Semigroup instance of MySQL.Query prior to+-- mysql-simple 0.4.5+import qualified Data.ByteString as B+ newtype MySQL = MySQL MySQL.Connection instance DbDescriptor MySQL where@@ -137,12 +141,21 @@ -> m a withMySQLConn s = bracket (liftIO $ open' s) (liftIO . close') +-- As with the postgresql backend, it's not obvious to me how best to+-- handle the Semigroup/Monoid changes. So this manually copies over+-- the changes added in+-- https://github.com/paul-rouse/mysql-simple/commit/c42e1d8dd915cf2312464db0fe7b577074435d6d#diff-20308cd48ab326c8ac85f54bdb65f0ebR73+--+combine :: MySQL.Query -> MySQL.Query -> MySQL.Query+-- combine = (<>)+combine (MySQL.Query a) (MySQL.Query b) = MySQL.Query (B.append a b)+ instance Savepoint MySQL where withConnSavepoint name m (MySQL c) = do let name' = fromString name- liftIO $ MySQL.execute_ c $ "SAVEPOINT " <> name'- x <- onException m (liftIO $ MySQL.execute_ c $ "ROLLBACK TO SAVEPOINT " <> name')- liftIO $ MySQL.execute_ c $ "RELEASE SAVEPOINT" <> name'+ liftIO $ MySQL.execute_ c $ "SAVEPOINT " `combine` name'+ x <- onException m (liftIO $ MySQL.execute_ c $ "ROLLBACK TO SAVEPOINT " `combine` name')+ liftIO $ MySQL.execute_ c $ "RELEASE SAVEPOINT" `combine` name' return x instance ConnectionManager MySQL where
changelog view
@@ -1,3 +1,6 @@+0.9.0+* Support for GHC 8.4+ 0.8.0.1 * New typeclass to allow transaction rollback through ExceptT
groundhog-mysql.cabal view
@@ -1,5 +1,5 @@ name: groundhog-mysql-version: 0.8.0.1+version: 0.9.0 license: BSD3 license-file: LICENSE author: Boris Lykah <lykahb@gmail.com>@@ -20,7 +20,7 @@ , mysql >= 0.1.1.3 && < 0.2 , bytestring >= 0.9 , transformers >= 0.2.1 && < 0.6- , groundhog >= 0.8.0.1 && < 0.9+ , groundhog >= 0.9 && < 0.10 , monad-control >= 0.3 && < 1.1 , monad-logger >= 0.3 && < 0.4 , containers >= 0.2