Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Config = Config {}
- data Connection
- data Address
- withConnection :: Config -> (Connection -> IO a) -> IO a
- connect :: Config -> IO Connection
- begin :: Connection -> IO ()
Connection
A configuration of a connection.
Default configuration is def
, which is following.
>>>
address def
AddressResolved 127.0.0.1:5432>>>
user def
"postgres">>>
password def
"">>>
database def
"">>>
sendingBufferSize def
4096>>>
receptionBufferSize def
4096
encodeString def = \code -> case code of "UTF8" ->pure
.fromString
; _ ->const
$fail
$ "unexpected character code: " <>show
code decodeString def = \code -> case code of "UTF8" ->pure
.toString
; _ ->const
$fail
$ "unexpected character code: " <>show
code
Config | |
|
data Connection Source #
PostgreSQL connection.
Instances
IConnection Connection Source # | |
Defined in Database.HDBC.PostgreSQL.Pure disconnect :: Connection -> IO () # commit :: Connection -> IO () # rollback :: Connection -> IO () # runRaw :: Connection -> String -> IO () # run :: Connection -> String -> [SqlValue] -> IO Integer # prepare :: Connection -> String -> IO Statement # clone :: Connection -> IO Connection # hdbcDriverName :: Connection -> String # hdbcClientVer :: Connection -> String # proxiedClientName :: Connection -> String # proxiedClientVer :: Connection -> String # dbServerVer :: Connection -> String # dbTransactionSupport :: Connection -> Bool # getTables :: Connection -> IO [String] # describeTable :: Connection -> String -> IO [(String, SqlColDesc)] # |
IP address.
AddressResolved SockAddr | Address which is DNS resolved. |
AddressNotResolved HostName ServiceName | Address which is not DNS resolved. |
withConnection :: Config -> (Connection -> IO a) -> IO a Source #
Bracket function for a connection.
Transaction
begin :: Connection -> IO () Source #
To send BEGIN
SQL statement.