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

Query as a stream #18

Open
donbonifacio opened this issue Dec 16, 2015 · 2 comments
Open

Query as a stream #18

donbonifacio opened this issue Dec 16, 2015 · 2 comments

Comments

@donbonifacio
Copy link
Contributor

Hello,

I think this is a feature request, because I did not find how to do it. I'd want to have a query delivered as a stream (for example, returning a channel that would be <! until closed. The use case is for example: Generate a report from a query that returns a huge amount of results, and not need to have it all in memory at the same time.

Btw, I did this with plain jdbc, but had other problems (can't get params like $1 to work, only ?), and would rather use this lib for this.

@alaisi
Copy link
Owner

alaisi commented Dec 19, 2015

Hi,
does the query-rows fn in master fit your use case?

Sample usage:

(query-rows! db ["select generate_series(1, $1::int4) as i" 1000])

@donbonifacio
Copy link
Contributor Author

Yes, that's great @alaisi :)

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

2 participants