Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- selectCursor :: (SqlSelect a r, MonadIO m, MonadResource m, BackendCompatible (RawPostgresql SqlBackend) backend) => SqlQuery a -> ConduitT () r (ReaderT backend m) ()
Documentation
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
https://postgresqlco.nf/doc/en/param/cursor_tuple_fraction/
for more.