xzkostyan / clickhouse-sqlalchemy

ClickHouse dialect for SQLAlchemy
https://clickhouse-sqlalchemy.readthedocs.io
Other
424 stars 124 forks source link

Feature Request: Support clickhouse-connect's NEW AsyncClient wrapper #324

Open kdcokenny opened 1 month ago

kdcokenny commented 1 month ago

clickhouse-connect recently released an async wrapper for using the native library asynchronously. I experience many issues with asynch which clickhouse-connect doesn't have. If we could add this wrapper as a dialect that would be great!

https://github.com/ClickHouse/clickhouse-connect/releases/tag/v0.7.16

xzkostyan commented 1 month ago

There is async wrapper via asynch: https://github.com/xzkostyan/clickhouse-sqlalchemy/pull/214

kdcokenny commented 1 month ago

I understand that but asynch is very buggy and I (and many others it seems) can't use it in production. This is why it would be helpful to have the stable and officially backed clickhouse-connect's new async wrapper supported here.

xzkostyan commented 1 month ago

Can you point to specific asynch issues that stop you from using it in production?

kdcokenny commented 1 month ago

Sure, after about 30 minutes of running asynch with FastAPI it would just stop working and throw the following errors: asynch.errors.UnexpectedPacketFromServerError: Code: 102. Unexpected packet from server localhost:9000 (expected Pong, got Hello) and asynch.errors.ProgrammingError: Code: None. some records have not been fetched. fetch the remaining records before executing the next query

switching to clickhouse's official clickhouse-connect library has worked like a charm.

ToGoBananas commented 1 month ago

+1 same issue