Need help with sqlalchemy-clickhouse?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

cloudflare
269 Stars 100 Forks Apache License 2.0 53 Commits 45 Opened issues

Services available

!
?

Need anything else?

Contributors list

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:[email protected]:port/database')
Engine('clickhouse://username:[email protected]:port/database')

For SSL add ssl parameter to URL::

>>> import sqlalchemy as sa
>>> sa.create_engine('clickhouse://username:[email protected]:port/database?ssl=True')
Engine('clickhouse://username:[email protected]: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")

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.