esqueleto-streaming: Memory-constant streaming of Esqueleto results from PostgreSQL

[ bsd3, conduit, database, library ] [ Propose Tags ]

This library provides a set of APIs for performing queries in Esqueleto in constant memory, streaming the results using conduit.

The library relies on PostgreSQL-specific features to avoid loading all the results of a query into memory at once. This allows for accessing results of millions of rows from Haskell without a memory blow-up.

[Skip to Readme]


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS]
Change log
Dependencies base (>=4.7 && <5), conduit (>=1 && <1.4), esqueleto (>=3.5 && <3.6), persistent-postgresql (>=2.13.2 && <2.14), persistent-postgresql-streaming (>=0.1 && <0.2), resourcet (>=0.3 && <2), transformers (>=0.5 && <0.6) [details]
License BSD-3-Clause
Copyright (c) 2021 Supercede Ltd.
Author Isaac van Bakel
Category Conduit, Database
Home page
Source repo head: git clone
Uploaded by isaac_supercede at 2021-10-20T15:41:32Z
Downloads 227 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-10-20 [all 1 reports]

Readme for esqueleto-streaming-

[back to package description]


This library allows for memory-constant streaming of the results of esqueleto queries from PostgreSQL databases.

This code makes use of the PostgreSQL-only cursors, which allow for batched access to the result set of a query at speeds comparable to loading all the results into memory at once.

See the main project README for more.

Streaming results from Esqueleto queries

The main function of this library is selectCursor, which can be used in place of select to run an Esqueleto query. selectCursor runs in a ConduitT - consuming the conduit will pull results from the database in constant memory.


Why is selectCursor so slow?

Have you configured PostgreSQL correctly? See the section in the README about it.