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

Add support for streaming queries to the .select() shortcut #130

Open
codetheweb opened this issue Oct 28, 2022 · 2 comments
Open

Add support for streaming queries to the .select() shortcut #130

codetheweb opened this issue Oct 28, 2022 · 2 comments
Assignees

Comments

@codetheweb
Copy link

I'm mapping over a very large table and so am using cursors (currently via pg-query-stream).

The SQL statement generated by the .select() shortcut doesn't work for streaming because jsonb_agg(...) is used to gather the result. I took a quick look at the code but it seems like it could be rather complicated to add cursor/streaming support, either to .select() or in general to SQLFragment<>.

Is this something you'd be interested in Zapatos supporting? If so, do you have any tips for implementation? Happy to take a crack at this.

@jawj
Copy link
Owner

jawj commented Oct 28, 2022

Hi Max. This is a nice idea, though not sure exactly what the API ought to be. I'll try to have a look at it in the next few days. Would be great if you're then happy to have a go at it!

@vitaly-t
Copy link

Check out pg-iterator ;)

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