-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ideas - Feel free to post ideas. #82
Comments
Livebook smart cell :) |
Streaming the results of queries would be great. I think it requires setting the connection mode to active though. |
There is an undocumented Here's a minimal example: {:ok, pid} = Ch.start_link()
Ch.run(pid, fn conn ->
conn
|> Ch.stream("select number from system.numbers limit {limit:UInt64}", %{"limit" => 1_000_000}, types: ["UInt64"])
|> Stream.each(fn rows -> IO.puts("at #{Time.utc_now()} got #{length(List.flatten(rows))} rows") end)
|> Stream.run()
end)
And some tests. |
That's great! Will it support not having to specify |
@hkrutzer yeah, most likely. We'd "just" need to decode types from |
is there a way to hook into clickhouse's WATCH functionality? |
I think that functionality is deprecated and will be removed: https://clickhouse.com/docs/en/sql-reference/statements/create/view#live-view-deprecated |
I wasn't able to create a live view on eb6fbe5ed437 :) CREATE LIVE VIEW lv WITH REFRESH 5 AS SELECT now();
Syntax error: failed at position 21 ('WITH'):
CREATE LIVE VIEW lv WITH REFRESH 5 AS SELECT now();
Expected one of: token, Dot, UUID, ON, TO, OpeningRoundBracket, sql security, DEFINER, SQL SECURITY, AS I expect something like this to work, {:ok, pid} = Ch.start_link(pool_size: 1)
DBConnection.run(pid, fn conn ->
Ch.stream(conn, "watch lv format JSONEachRowWithProgress")
|> Stream.each(&IO.inspect/1)
|> Stream.run()
end, timeout: :infinity) |
Did you run |
No, but it doesn't seem to have changed much. Somehow it's a syntax error. eb6fbe5ed437 :) set allow_experimental_live_view = 1;
SET allow_experimental_live_view = 1
Query id: e40f3eb8-548e-4b3d-bc0e-8f92456f076c
Ok.
0 rows in set. Elapsed: 0.001 sec.
eb6fbe5ed437 :) CREATE LIVE VIEW lv WITH REFRESH 5 AS SELECT now();
Syntax error: failed at position 21 ('WITH'):
CREATE LIVE VIEW lv WITH REFRESH 5 AS SELECT now();
Expected one of: token, Dot, UUID, ON, TO, OpeningRoundBracket, sql security, DEFINER, SQL SECURITY, AS
eb6fbe5ed437 :) |
ah okay, thank you! 🙇 |
Feel free to post ideas.
That idea itself is stolen from youki-dev/youki#10
The text was updated successfully, but these errors were encountered: