From 9788fad1aba92a292061159c2075feed8d38d50b Mon Sep 17 00:00:00 2001 From: Parnell Springmeyer Date: Mon, 7 Aug 2023 18:57:33 -0500 Subject: [PATCH] persistent-postgresql: expose `getServerVersion` ... so users don't have to write their own. --- persistent-postgresql/Database/Persist/Postgresql.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/persistent-postgresql/Database/Persist/Postgresql.hs b/persistent-postgresql/Database/Persist/Postgresql.hs index 0593491bb..5a513c806 100644 --- a/persistent-postgresql/Database/Persist/Postgresql.hs +++ b/persistent-postgresql/Database/Persist/Postgresql.hs @@ -53,6 +53,7 @@ module Database.Persist.Postgresql , upsertManyWhere , openSimpleConn , openSimpleConnWithVersion + , getServerVersion , getSimpleConn , tableName , fieldName @@ -358,6 +359,8 @@ open' modConn getVer constructor cstr logFunc = do return $ constructor (createBackend logFunc ver smap) conn -- | Gets the PostgreSQL server version +-- +-- @since 2.13.6 getServerVersion :: PG.Connection -> IO (Maybe Double) getServerVersion conn = do [PG.Only version] <- PG.query_ conn "show server_version";