cloudflare/sqlalchemy-clickhouse

325

stars

49

commits

Python

primary language

Apr 24, 2026

updated

README

sqlalchemy-clickhouse
=====================

ClickHouse dialect for SQLAlchemy.

Installation
------------

The package is installable through PIP::

   pip install sqlalchemy-clickhouse

Usage
-----

The DSN format is similar to that of regular Postgres::

    >>> import sqlalchemy as sa
    >>> sa.create_engine('clickhouse://username:password@hostname:port/database')
    Engine('clickhouse://username:password@hostname:port/database')
    
For SSL add ssl parameter to URL::

    >>> import sqlalchemy as sa
    >>> sa.create_engine('clickhouse://username:password@hostname:port/database?ssl=True')
    Engine('clickhouse://username:password@hostname:port/database')

It implements a dialect, so there's no user-facing API.

Testing
-------

The dialect can be registered on runtime if you don't want to install it as::

    from sqlalchemy.dialects import registry
    registry.register("clickhouse", "base", "dialect")

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Contributors

vavrusa

25 commits

RichRadics

3 commits

janantos

3 commits

cloudflare/sqlalchemy-clickhouse

325

stars

49

commits

Python

primary language

Apr 24, 2026

updated

README

sqlalchemy-clickhouse
=====================

ClickHouse dialect for SQLAlchemy.

Installation
------------

The package is installable through PIP::

   pip install sqlalchemy-clickhouse

Usage
-----

The DSN format is similar to that of regular Postgres::

    >>> import sqlalchemy as sa
    >>> sa.create_engine('clickhouse://username:password@hostname:port/database')
    Engine('clickhouse://username:password@hostname:port/database')
    
For SSL add ssl parameter to URL::

    >>> import sqlalchemy as sa
    >>> sa.create_engine('clickhouse://username:password@hostname:port/database?ssl=True')
    Engine('clickhouse://username:password@hostname:port/database')

It implements a dialect, so there's no user-facing API.

Testing
-------

The dialect can be registered on runtime if you don't want to install it as::

    from sqlalchemy.dialects import registry
    registry.register("clickhouse", "base", "dialect")

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Contributors

vavrusa

25 commits

RichRadics

3 commits

janantos

3 commits

Languages

Python

100.0%