postgres.async
postgres.async copied to clipboard
Query as a stream
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.
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])
Yes, that's great @alaisi :)