persistent-sqlite 2.1.0.1 → 2.1.1
raw patch · 3 files changed
+10/−6 lines, 3 files
Files
- ChangeLog.md +3/−0
- Database/Persist/Sqlite.hs +5/−5
- persistent-sqlite.cabal +2/−1
+ ChangeLog.md view
@@ -0,0 +1,3 @@+## 2.1.1++Provide a `FromJSON` instance for `SqliteConf`.
Database/Persist/Sqlite.hs view
@@ -26,7 +26,6 @@ import Data.Acquire (Acquire, mkAcquire, with) import qualified Control.Exception as E import Data.Text (Text)-import Control.Monad (mzero) import Data.Aeson import qualified Data.Text as T import Data.Conduit@@ -346,15 +345,16 @@ , sqlPoolSize :: Int } +instance FromJSON SqliteConf where+ parseJSON = withObject "SqliteConf" $ \o -> SqliteConf+ <$> o .: "database"+ <*> o .: "poolsize" instance PersistConfig SqliteConf where type PersistConfigBackend SqliteConf = SqlPersistT type PersistConfigPool SqliteConf = ConnectionPool createPoolConfig (SqliteConf cs size) = runNoLoggingT $ createSqlitePool cs size -- FIXME runPool _ = runSqlPool- loadConfig (Object o) =- SqliteConf <$> o .: "database"- <*> o .: "poolsize"- loadConfig _ = mzero+ loadConfig = parseJSON finally :: MonadBaseControl IO m => m a -- ^ computation to run first
persistent-sqlite.cabal view
@@ -1,5 +1,5 @@ name: persistent-sqlite-version: 2.1.0.1+version: 2.1.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -12,6 +12,7 @@ build-type: Simple homepage: http://www.yesodweb.com/book/persistent bug-reports: https://github.com/yesodweb/persistent/issues+extra-source-files: ChangeLog.md flag systemlib description: Use the system-wide sqlite library