BSD-3-Clause licensed by Scrive AB
Maintained by Andrzej Rybczak
This version can be pinned in stack with:hpqtypes-,9523

Module documentation for


Build Status Hackage Dependencies Stackage LTS Stackage Nightly

Efficient and easy-to-use bindings to (slightly modified) libpqtypes, libpq extension that adds support for binary transport format and composite types.

Source code of libpqtypes is bundled along with the bindings.

Examples can be found in the examples directory.


hpqtypes- (2023-11-08)

  • Support multihost setups and the connect_timeout parameter in the connection string.

hpqtypes- (2023-03-14)

  • Add support for GHC 9.6.

hpqtypes- (2023-01-31)

  • Add support for setting a custom role when establishing a connection.

hpqtypes- (2023-01-18)

  • Require resource-pool >= 0.4 and adjust the createPool function to seamlessly accommodate future changes to the resource-pool library.

hpqtypes- (2022-10-12)

  • Simplify Setup.

hpqtypes- (2022-09-23)

  • Provide detailed error when openConnection fails.

hpqtypes- (2022-09-14)

  • Improve Show instances of HPQTypesError and LibPQError.
  • Remove INLINE and INLINABLE pragmas.
  • Fix a rare bug in the connect function related to file descriptors.
  • Add support for GHC 9.4.
  • Require resource-pool >= 0.3 (changes type signature of poolSource).

hpqtypes- (2022-05-18)

  • Add support for prepared statements.
  • Make more foreign C calls safe.
  • Don’t manage PGconn with a ForeignPtr.
  • Use closeFdWith when closing connections.

hpqtypes- (2022-03-30)

  • Fix withTransaction and withSavepoint with short-circuiting monad transformers such as ExceptT.

hpqtypes- (2022-02-25)

  • Fix support for M1 chips.
  • Add support for aeson >= 2.0.
  • Add support for GHC 9.2.
  • Drop support for GHC < 8.8.

hpqtypes- (2021-11-04)

  • Improve an SQL query that gets information about composite types.

hpqtypes- (2021-09-29)

  • Add method withFrozenLastQuery to (temporarily) stop recording queries.

hpqtypes- (2021-07-29)

  • Fix compilation issues caused by ambiguos occurence of controlT.

hpqtypes- (2021-05-27)

  • Support GHC 9.0.

hpqtypes- (2020-09-14)

  • Expose aesonFromSQL and aesonToSQL for convenience.

hpqtypes- (2020-09-04)

  • Remove upper bounds of dependencies.

hpqtypes- (2020-04-02)

  • Support GHC 8.8 and 8.10.

hpqtypes- (2020-02-06)

  • Make poolSource work properly with shortcircuiting monad transformers.

hpqtypes- (2019-10-31)

  • Implement UUID format (#17).
  • Support GHC 8.8.

hpqtypes- (2019-05-21)

  • Remove the Default instances for ConnectionSettings and TransactionSettings; use defaultConnectionSettings and defaultTransactionsettings instead (#15).

hpqtypes- (2018-11-24)

  • Add support for cursors (#13).
  • Remove explicit deriving Typeable from all data types.

hpqtypes- (2018-07-11)

  • Convert the PQFormat class to use TypeApplications instead of an undefined :: t argument (#11).
  • Support GHC 8.6.
  • Drop support for GHC < 8.

hpqtypes- (2018-06-04)

  • Add INLINE/INLINEABLE pragmas for call site specialization.
  • Remove -O2 -funbox-strict-fields from ghc-options.
  • Make query execution interruptible with asynchronous exceptions.
  • Make connect interruptible with asynchronous exceptions.

hpqtypes- (2018-03-18)

  • Support GHC 8.4.1.

hpqtypes- (2016-09-22)

  • Fix test suite compilation with GHC 8.
  • Fix lower bound of base version.
  • Fix compilation with ‘cabal new-build’ and Cabal < 1.24.

hpqtypes-1.5.1 (2016-07-04)

  • Do not use linux/limits.h.

hpqtypes-1.5.0 (2016-06-21)

  • Remove orphan MonadDB instances.
  • Turn ConnectionSource into indexed datatype.
  • Remove Binary wrapper and (de)serialize ByteString as bytes.
  • Use Text instead of ByteString where appropriate.
  • Use UTF-8 client encoding by default for compatibility with Text.

hpqtypes-1.4.5 (2016-05-30)

  • Fix compilation with Cabal 1.24 and GHC 8.0.1.

hpqtypes-1.4.4 (2016-01-19)

  • Fix lower bound of base version.

hpqtypes-1.4.3 (2015-10-09)

  • Remove invalid FromSQL ZonedTime instance.

hpqtypes-1.4.2 (2015-06-08)

  • Use strict StateT for DBT.
  • Use catch in withTransaction only if it might be used.

hpqtypes-1.4.1 (2015-05-15)

  • Add support for json and jsonb sql types.
  • Add support for lazy ByteString and Text.

hpqtypes-1.4.0 (2015-02-26)

  • Add support for QuickCheck 2.7.
  • Add support for notifications.
  • Remove SpaceMonoid, use Monoid and IsString instead.
  • Use data-default-class package for default values.
  • Drop Single, use Identity functor instead.
  • Remove someSQL from IsSQL class.
  • Remove foldlM/foldrM from MonadDB and make QueryResult instance of Foldable instead.
  • Add support for a type representing cartesian product of rows for more composability.
  • Do not wrap exceptions thrown from DBT in DBException unless explicitly requested.
  • Provide custom Show instance for Interval.
  • Add ToSQL instance for Int.

hpqtypes-1.3.2 (2015-01-27)

  • Replace wrong package uploaded to hackage.

hpqtypes-1.3.1 (2015-01-26)

  • Add support for XML type.

hpqtypes-1.3.0 (2015-01-09)

  • Composite: make {from,to}Composite functions pure.

hpqtypes-1.2.5 (2015-01-04)

  • Add support for monad-control >=

hpqtypes-1.2.4 (2014-12-08)

  • Add IsString instance for Savepoint newtype.