mirror of
https://github.com/postgres-haskell/postgres-wire.git
synced 2024-11-22 05:53:12 +03:00
Functions retreiving information about connection
This commit is contained in:
parent
22f4d6f047
commit
45c8f03ebe
@ -50,7 +50,7 @@ data DataMessage = DataMessage [V.Vector B.ByteString]
|
||||
|
||||
-- | Parameters of the current connection.
|
||||
-- We store only the parameters that cannot change after startup.
|
||||
-- For more information about additional parameters see documentation.
|
||||
-- For more information about additional parameters see PostgreSQL documentation.
|
||||
data ConnectionParameters = ConnectionParameters
|
||||
{ paramServerVersion :: ServerVersion
|
||||
, paramServerEncoding :: B.ByteString -- ^ character set name
|
||||
@ -332,3 +332,14 @@ withConnectionMode conn mode handler = do
|
||||
where
|
||||
ref = connMode conn
|
||||
|
||||
-- Information about connection
|
||||
|
||||
getServerVersion :: Connection -> ServerVersion
|
||||
getServerVersion = paramServerVersion . connParameters
|
||||
|
||||
getServerEncoding :: Connection -> B.ByteString
|
||||
getServerEncoding = paramServerEncoding . connParameters
|
||||
|
||||
getIntegerDatetimes :: Connection -> Bool
|
||||
getIntegerDatetimes = paramIntegerDatetimes . connParameters
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user