persistent-mysql 2.1.1 → 2.1.2
raw patch · 3 files changed
+18/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Database.Persist.MySQL: instance FromJSON MySQLConf
Files
- ChangeLog.md +3/−0
- Database/Persist/MySQL.hs +13/−13
- persistent-mysql.cabal +2/−1
+ ChangeLog.md view
@@ -0,0 +1,3 @@+## 2.1.2++Provide a `FromJSON` instance for `MySQLConf`.
Database/Persist/MySQL.hs view
@@ -15,7 +15,6 @@ ) where import Control.Arrow-import Control.Monad (mzero) import Control.Monad.Logger (MonadLogger, runNoLoggingT) import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.Class (lift)@@ -793,17 +792,8 @@ -- ^ How many connections should be held on the connection pool. } --instance PersistConfig MySQLConf where- type PersistConfigBackend MySQLConf = SqlPersistT-- type PersistConfigPool MySQLConf = ConnectionPool-- createPoolConfig (MySQLConf cs size) = runNoLoggingT $ createMySQLPool cs size -- FIXME-- runPool _ = runSqlPool-- loadConfig (Object o) = do+instance FromJSON MySQLConf where+ parseJSON = withObject "MySQLConf" $ \o -> do database <- o .: "database" host <- o .: "host" port <- o .: "port"@@ -822,7 +812,17 @@ , MySQL.connectDatabase = database } return $ MySQLConf ci pool- loadConfig _ = mzero++instance PersistConfig MySQLConf where+ type PersistConfigBackend MySQLConf = SqlPersistT++ type PersistConfigPool MySQLConf = ConnectionPool++ createPoolConfig (MySQLConf cs size) = runNoLoggingT $ createMySQLPool cs size -- FIXME++ runPool _ = runSqlPool++ loadConfig = parseJSON applyEnv conf = do env <- getEnvironment
persistent-mysql.cabal view
@@ -1,5 +1,5 @@ name: persistent-mysql-version: 2.1.1+version: 2.1.2 license: MIT license-file: LICENSE author: Felipe Lessa <felipe.lessa@gmail.com>, Michael Snoyman@@ -23,6 +23,7 @@ . * This package does not support statements inside other statements.+extra-source-files: ChangeLog.md library build-depends: base >= 4 && < 5