persistent-postgresql 2.9.0 → 2.9.1
raw patch · 3 files changed
+15/−5 lines, 3 filesdep ~persistentnew-uploader
Dependency ranges changed: persistent
Files
- ChangeLog.md +3/−0
- Database/Persist/Postgresql.hs +10/−3
- persistent-postgresql.cabal +2/−2
ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for persistent-postgresql +## 2.9.1+* Add `openSimpleConnWithVersion` function. [#883](https://github.com/yesodweb/persistent/pull/883)+ ## 2.9.0 * Added support for SQL isolation levels to via SqlBackend. [#812]
Database/Persist/Postgresql.hs view
@@ -24,6 +24,7 @@ , ConnectionString , PostgresConf (..) , openSimpleConn+ , openSimpleConnWithVersion , tableName , fieldName , mockMigration@@ -235,11 +236,17 @@ -- | Generate a 'SqlBackend' from a 'PG.Connection'. openSimpleConn :: (IsSqlBackend backend) => LogFunc -> PG.Connection -> IO backend-openSimpleConn logFunc conn = do+openSimpleConn = openSimpleConnWithVersion getServerVersion++-- | Generate a 'SqlBackend' from a 'PG.Connection', but takes a callback for+-- obtaining the server version.+--+-- @since 2.9.1+openSimpleConnWithVersion :: (IsSqlBackend backend) => (PG.Connection -> IO (Maybe Double)) -> LogFunc -> PG.Connection -> IO backend+openSimpleConnWithVersion getVer logFunc conn = do smap <- newIORef $ Map.empty- serverVersion <- getServerVersion conn+ serverVersion <- getVer conn return $ createBackend logFunc serverVersion smap conn- -- | Create the backend given a logging function, server version, mutable statement cell, -- and connection.
persistent-postgresql.cabal view
@@ -1,5 +1,5 @@ name: persistent-postgresql-version: 2.9.0+version: 2.9.1 license: MIT license-file: LICENSE author: Felipe Lessa, Michael Snoyman <michael@snoyman.com>@@ -17,7 +17,7 @@ library build-depends: base >= 4.8 && < 5 , transformers >= 0.2.1- , postgresql-simple >= 0.4.0 && < 0.6+ , postgresql-simple >= 0.4.0 && < 0.7 , postgresql-libpq >= 0.6.1 && < 0.10 , persistent >= 2.9 && < 3 , containers >= 0.2