Skip to content

Asynch driver incompatible with asynch 0.3.1+ and SQLAlchemy 2.0.44+ #400

@kusaku

Description

@kusaku

Describe the bug

The asynch driver in clickhouse-sqlalchemy has several compatibility gaps:

  1. asynch 0.3.1+ – Parameter substitution changed from % formatting to Python .format(), which expects {name} instead of %(name)s. Queries and data containing % can break.
  2. SQLAlchemy 2.0.44+ – Async cursor must implement _async_soft_close() for proper cleanup.
  3. ClickHouse semanticscommit and rollback are passed to the asynch engine although ClickHouse is non-transactional; these should be no-ops.

To Reproduce

Using the asynch driver with asynch 0.3.1+ and/or SQLAlchemy 2.0.44+ leads to parameter/format errors, deprecation warnings, or cleanup issues depending on versions.

Example: executing a query with bound parameters fails because the driver emits %(name)s while asynch 0.3.1+ expects {name}.

Expected behavior

  • Driver works with 0.3.1+ (correct parameter format and Connection usage).
  • Compatible with SQLAlchemy 2.0.44+ async cursor lifecycle (_async_soft_close).
  • commit/rollback are no-ops.

Versions

  • clickhouse-sqlalchemy: current master
  • asynch: 0.3.1+
  • SQLAlchemy: 2.0.44+
  • Python: 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions