-
Notifications
You must be signed in to change notification settings - Fork 11
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 Repo.stream #96
Comments
There is currently no way to stream even though there is a |
Yes, because Repo.checkout(fn ->
"numbers"
|> select([n], n.number)
|> limit(100)
|> Repo.stream(prefix: "system")
|> Stream.each(fn rows -> IO.inspect(rows) end)
|> Stream.run
end) results in
Ideally, I'd want to make it work with |
That would require a change in |
I'm not sure. I haven't looked into it yet :) But we can always work around |
Do you have any recommendations for streaming right now? I need it for a data export which currently grows to a few hundred MBs while it's going on. I could do what you describe in plausible/ch#82 (comment) but I don't think there is a way to retrieve a |
You can start config = Plausible.SomeClickhouseRepo.config()
{:ok, ch_conn} = Ch.start_link(Keyword.put(config, :pool_size, 1)) # which dies when the export process finishes |
Thanks @ruslandoga! That looks useful. I take it as you are also using |
I guess I'll need to implement it in ecto_ch sooner or later :) Maybe when the export/import pr in Plausible reaches "MVP" stage and I start refactoring it. Regarding whether it'd be easy or not, I can't say for certain, I just haven't looked into it much... |
Hi @ruslandoga is the above still the best way to stream responses? |
Yes, except |
No description provided.
The text was updated successfully, but these errors were encountered: