esqueleto-streaming- Memory-constant streaming of Esqueleto results from PostgreSQL
Safe HaskellNone




selectCursor :: (SqlSelect a r, MonadIO m, MonadResource m, BackendCompatible (RawPostgresql SqlBackend) backend) => SqlQuery a -> ConduitT () r (ReaderT backend m) () Source #

Execute an esqueleto SELECT query against a PostgreSQL backend and return a stream of the results in constant memory, using the PostgreSQL cursor feature.

NB: this function is likely to perform worse than select on small result sets.

NB: for large result sets, this function is likely to perform very poorly unless you manually configure the cursor_tuple_fraction setting to be close to 1. This setting decides how much PostgreSQL will prioritise returning the first rows quickly vs. returning all rows efficiently. See

for more.