postgresql-pure-0.2.3.0: pure Haskell PostgreSQL driver
Safe HaskellNone
LanguageHaskell2010

Database.HDBC.PostgreSQL.Pure

Description

This is a compatible interface with HDBC-postgresql's Database.HDBC.PostgreSQL except Config.

Prepared statements are closed when some requests come once Statements are GCed, because HDBC doesn't have "close" interface.

Synopsis

Connection

data Config Source #

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

Instances

Instances details
Show Config Source # 
Instance details

Defined in Database.HDBC.PostgreSQL.Pure

Default Config Source # 
Instance details

Defined in Database.HDBC.PostgreSQL.Pure

Methods

def :: Config #

data Address Source #

IP address.

Constructors

AddressResolved SockAddr

Address which is DNS resolved.

AddressNotResolved HostName ServiceName

Address which is not DNS resolved.

Instances

Instances details
Eq Address Source # 
Instance details

Defined in Database.PostgreSQL.Pure.Internal.Data

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

Show Address Source # 
Instance details

Defined in Database.PostgreSQL.Pure.Internal.Data

withConnection :: Config -> (Connection -> IO a) -> IO a Source #

Bracket function for a connection.

connect :: Config -> IO Connection Source #

To connect to the server.

Transaction

begin :: Connection -> IO () Source #

To send BEGIN SQL statement.

Orphan instances

ToField Rational Source #

Security risk of DoS attack.

You should convert Rational to Scientific with fromRationalRepetend in the user side. If the rational value is computed to repeating decimals like 1/3 = 0.3333., this consumes a lot of memories. This is provided because of the HDBC compatibility.

Instance details

ToField SqlValue Source # 
Instance details

FromField SqlValue Source # 
Instance details

Convertible Oid SqlTypeId Source # 
Instance details

ToField (TimeOfDay, TimeZone) Source # 
Instance details

FromField (TimeOfDay, TimeZone) Source # 
Instance details