hpqtypes-1.6.1.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Internal.Connection

Synopsis

Documentation

newtype Connection Source #

Wrapper for hiding representation of a connection object.

Constructors

Connection 

data ConnectionData Source #

Representation of a connection object.

Constructors

ConnectionData 

Fields

data ConnectionStats Source #

Simple connection statistics.

Constructors

ConnectionStats 

Fields

data ConnectionSettings Source #

Constructors

ConnectionSettings 

Fields

def :: Default a => a #

The default value for this type.

newtype ConnectionSourceM m Source #

Database connection supplier.

Constructors

ConnectionSourceM 

Fields

newtype ConnectionSource (cs :: [(* -> *) -> Constraint]) Source #

Wrapper for a polymorphic connection source.

Constructors

ConnectionSource 

Fields

simpleSource :: ConnectionSettings -> ConnectionSource [MonadBase IO, MonadMask] Source #

Default connection supplier. It establishes new database connection each time withConnection is called.

poolSource Source #

Arguments

:: ConnectionSettings 
-> Int

Stripe count. The number of distinct sub-pools to maintain. The smallest acceptable value is 1.

-> NominalDiffTime

Amount of time for which an unused database connection is kept open. The smallest acceptable value is 0.5 seconds.

The elapsed time before closing database connection may be a little longer than requested, as the reaper thread wakes at 1-second intervals.

-> Int

Maximum number of database connections to keep open per stripe. The smallest acceptable value is 1.

Requests for database connections will block if this limit is reached on a single stripe, even if other stripes have idle connections available.

-> IO (ConnectionSource [MonadBase IO, MonadMask]) 

Pooled source. It uses striped pool from resource-pool package to cache established connections and reuse them.

connect :: ConnectionSettings -> IO Connection Source #

Low-level function for connecting to the database. Useful if one wants to implement custom connection source.

disconnect :: Connection -> IO () Source #

Low-level function for disconnecting from the database. Useful if one wants to implement custom connection source.