aiochclient
aiochclient copied to clipboard
CREATE LIVE VIEW and WATCH support
I wonder if the LIVE VIEW and WATCH statements support is in plan. ClickHouse 19.16.3.6 introduced this feature. The client can get notified when a new data is inserted. It eliminates polling using SELECT.
Some of the things that I thought about.
- A cursor should be able to watch existing LIVE VIEW
- A cursor should be able to create a TEMPORARY LIVE VIEW with hash ID (maybe application should handle this. Each app has a different security requirement)
- handle response in event driven manner
- handle heart beat for the long-lived connection
Should it be implemented in a different package? Any thoughts?
Relevant articles https://www.altinity.com/blog/2019/11/13/making-data-come-to-life-with-clickhouse-live-view-tables https://www.altinity.com/blog/2019/12/05/taking-a-closer-look-at-clickhouse-live-view-tables
@knoguchi thank you for update! I will think about it. We can implement its interface as async event generator. I will check Clickhouse http API. By the way, if you have any ideas how to implement it or want to make PR you are welcome!