Skip to content

Commit

Permalink
persistent-postgresql: expose getServerVersion
Browse files Browse the repository at this point in the history
... so users don't have to write their own.
  • Loading branch information
ixmatus committed Aug 8, 2023
1 parent b03fc4f commit 9788fad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions persistent-postgresql/Database/Persist/Postgresql.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module Database.Persist.Postgresql
, upsertManyWhere
, openSimpleConn
, openSimpleConnWithVersion
, getServerVersion
, getSimpleConn
, tableName
, fieldName
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 9788fad

Please sign in to comment.