Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "fold" from postgresql-simple #27

Open
purcell-nec opened this issue Jan 25, 2018 · 2 comments
Open

Missing "fold" from postgresql-simple #27

purcell-nec opened this issue Jan 25, 2018 · 2 comments

Comments

@purcell-nec
Copy link

Large result sets returned via query etc. get read completely into memory, for which reason postgresql-simple also provides fold, forEach and co. There's no corresponding way to consume result sets incrementally within PGTransactionT. Is this something you've considered adding?

@reiddraper
Copy link
Contributor

@purcell-nec we would absolutely merge this. Would you be interested in making a PR? Thanks for the suggestion, either way!

@purcell
Copy link

purcell commented Jan 26, 2018

Would you be interested in making a PR?

Quite possibly, yes. Although I realised that this still doesn't give me exactly what I want. fold etc. are backed by a cursor, and what I'd like is to be able to iterate over result rows from that cursor and decide based on what I see whether or not to continue. fold will always consume every available record from the result set, so probably what I need is a monadic context for the cursor inside which I could sequence rows or abort.

I really enjoy that postgresql-transactional gives me a consistent transactional context, so I'd like to be able to tackle this sort of problem in that same context rather than having to run everything in a pipes or conduit-based connection pipeline instead -- which is partly to say, thanks for this library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants