diff --git a/hasql.cabal b/hasql.cabal
--- a/hasql.cabal
+++ b/hasql.cabal
@@ -1,7 +1,7 @@
 name:
   hasql
 version:
-  0.19.13
+  0.19.14
 category:
   Hasql, Database, PostgreSQL
 synopsis:
diff --git a/library/Hasql/Connection.hs b/library/Hasql/Connection.hs
--- a/library/Hasql/Connection.hs
+++ b/library/Hasql/Connection.hs
@@ -8,6 +8,7 @@
   release,
   Settings,
   settings,
+  withLibPQConnection
 )
 where
 
diff --git a/library/Hasql/Private/Connection.hs b/library/Hasql/Private/Connection.hs
--- a/library/Hasql/Private/Connection.hs
+++ b/library/Hasql/Private/Connection.hs
@@ -42,3 +42,11 @@
     nullConnection <- LibPQ.newNullConnection
     pqConnection <- swapMVar pqConnectionRef nullConnection
     IO.releaseConnection pqConnection
+
+-- |
+-- Execute an operation on the raw @libpq@ 'LibPQ.Connection'.
+--
+-- The access to the connection is exclusive.
+withLibPQConnection :: Connection -> (LibPQ.Connection -> IO a) -> IO a
+withLibPQConnection (Connection pqConnectionRef _ _) =
+  withMVar pqConnectionRef
