Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/sqlalchemy-clickhouse
https://github.com/cloudflare/sqlalchemy-clickhouse
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/cloudflare/sqlalchemy-clickhouse
- Owner: cloudflare
- License: apache-2.0
- Created: 2016-12-13T22:41:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T05:04:50.000Z (3 months ago)
- Last Synced: 2024-11-28T04:02:37.571Z (15 days ago)
- Language: Python
- Size: 43.9 KB
- Stars: 314
- Watchers: 20
- Forks: 105
- Open Issues: 47
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-clickhouse - cloudflare/sqlalchemy-clickhouse - This project provides a ClickHouse dialect for SQLAlchemy, allowing for seamless integration of ClickHouse and Python applications. (Language bindings / Python)
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")