clickhouse-connect v1.9.0
ClickHouse Connect 1.9.0 adds native async SQLAlchemy support, Rust codec performance improvements, and fixes across client cleanup, SQLAlchemy, Alembic, and inserts. It includes all changes from the three 1.9.0 release candidates.
Highlights
Features
- Native async SQLAlchemy support for SQLAlchemy 2.0.44+. Use
clickhousedb+async://withcreate_async_engine()for buffered Core and ORM execution, DDL, reflection, and Alembic migrations throughrun_sync(). Use the nativeAsyncClientfor streaming and bulk inserts. #576 - SQLAlchemy multi-row
Insert.values()supports dictionaries, tuples, and SQL expressions, including Pandasto_sql(method="multi"). #1024 - Opt-in Native Map
pairsreads preserve duplicate keys and the order returned by the server. Dictionary output remains the default, and inserts still require dictionaries. #949
Performance
- Rust codec responses that fit in one chunk avoid starting a read-ahead thread.
- Rust codec pandas
StringDtyperesults use Arrow buffers directly without first creating Python strings. - Synchronous HTTP connections use operating-system socket buffer sizing for large uploads. #1044
Bug fixes
- Improved async cancellation, initialization, connection disposal, token-provider cleanup, and pool timeout handling.
- Rust read-ahead threads explicitly close their source iterators, so early cleanup no longer depends on prompt garbage collection.
- Arrow inserts correctly quote table and database identifiers on both clients. #1014
- Comments, quoted identifiers, and escaped strings containing
LIMIT 0no longer cause query results to be discarded. Metadata probes that unexpectedly return rows raiseInternalErrorwithout replaying the query; useraw_query()for those queries. #925 - Fixed SQLAlchemy DateTime64 precision, Decimal arithmetic, table-engine reflection, Alembic version-table handling, and timezone-aware Date/Date32 inserts.
Compatibility
- Parameterized DB-API
executemany()preserves SQL expressions and sends one request per parameter set. Earlier writes remain committed if a later request fails. UseClient.insert()for Native bulk throughput. - SQLAlchemy DateTime64 declarations must match the server schema.
- Package metadata now uses PEP 639 license fields. Building from source requires
setuptools>=77.0.3. #996
Installation
pip install clickhouse-connectFor async SQLAlchemy:
pip install "clickhouse-connect[sqlalchemy-async]"See the SQLAlchemy guide and full changelog, including the RC1, RC2, and RC3 sections.