{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreib6t5yuavukumyaeautjedsny7j3qijgmyiwvped5rmx2lnkbyjsq",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mlsp5jtffh62"
},
"path": "/t/ann-hpgsql-a-pure-haskell-postgresql-driver-no-libpq/14101#post_8",
"publishedAt": "2026-05-14T10:36:55.000Z",
"site": "https://discourse.haskell.org",
"textContent": "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.\n\nHowever, there is one use-case that I **think** prevents me from doing that: query cancellation.\n\n\n streamResults <- queryS conn \"select ...\"\n -- Force Stream until some criteria are satisfied, then cancel the query\n cancelActiveStatement conn False\n\n\nIIUC (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.\n\nBut you can tell I didn’t explore the space too much.\n\nI also haven’t read about pure borrow yet, so I’ll owe you on that one.",
"title": "[ANN] hpgsql, a pure Haskell PostgreSQL driver (no libpq)"
}