| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.HDBC.PostgreSQL.Pure
Description
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 defAddressResolved 127.0.0.1:5432>>>user def"postgres">>>password def"">>>database def"">>>sendingBufferSize def4096>>>receptionBufferSize def4096
encodeString def = \code -> case code of "UTF8" ->pure.fromString; _ ->const$fail$ "unexpected character code: " <>showcode decodeString def = \code -> case code of "UTF8" ->pure.toString; _ ->const$fail$ "unexpected character code: " <>showcode
Constructors
| Config | |
Fields
| |
data Connection Source #
PostgreSQL connection.
Instances
| IConnection Connection Source # | |
Defined in Database.HDBC.PostgreSQL.Pure Methods 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.
Constructors
| 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.