8000 Functions retreiving information about connection · postgres-haskell/postgres-wire@45c8f03 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 45c8f03

Browse files
Functions retreiving information about connection
1 parent 22f4d6f commit 45c8f03

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Database/PostgreSQL/Driver/Connection.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ data DataMessage = DataMessage [V.Vector B.ByteString]
5050

5151
-- | Parameters of the current connection.
5252
-- We store only the parameters that cannot change after startup.
53-
-- For more information about additional parameters see documentation.
53+
-- For more information about additional parameters see PostgreSQL documentation.
5454
data ConnectionParameters = ConnectionParameters
5555
{ paramServerVersion :: ServerVersion
5656
, paramServerEncoding :: B.ByteString -- ^ character set name
@@ -332,3 +332,14 @@ withConnectionMode conn mode handler = do
332332
where
333333
ref = connMode conn
334334

335+
-- Information about connection
336+
337+
getServerVersion :: Connection -> ServerVersion
338+
getServerVersion = paramServerVersion . connParameters
339+
340+
getServerEncoding :: Connection -> B.ByteString
341+
getServerEncoding = paramServerEncoding . connParameters
342+
343+
getIntegerDatetimes :: Connection -> Bool
344+
getIntegerDatetimes = paramIntegerDatetimes . connParameters
345+

0 commit comments

Comments
 (0)
0