[ANN] hpgsql, a pure Haskell PostgreSQL driver (no libpq)
Haskell Community [Unofficial]
May 14, 2026
I was quite tempted to use linear streams in the public API, because the natural requirement that emerges from postgresql’s protocol is that query results must be consumed fully or until an error.
However, there is one use-case that I think prevents me from doing that: query cancellation.
streamResults <- queryS conn "select ..."
-- Force Stream until some criteria are satisfied, then cancel the query
cancelActiveStatement conn False
IIUC (but I have very little practical experience with linear types!) the user would then have to force the stream to get an exception, or cancelActiveStatement would have to take the stream as an argument, or other similar API choices/changes? And something similar would happen to pipelines.
But you can tell I didn’t explore the space too much.
I also haven’t read about pure borrow yet, so I’ll owe you on that one.
Discussion in the ATmosphere