ClickHouse SQLAlchemy Dialect with timezone support
Project description
sqlalchemy-clickhouse-timezone
add timezone support
Installation
The package is installable through PIP:
pip install sqlalchemy-clickhouse-timezone
Usage
setting the environ param to start timezone support
default is ‘0’ using pytz.utc
‘CLICKHOUSE_USE_TIMEZONE’: ‘0’ => using utc ‘CLICKHOUSE_USE_TIMEZONE’: ‘1’ => using system timezone ‘CLICKHOUSE_USE_TIMEZONE’: ‘Asia/Shanghai’ => using configed Asian/Shanghai
- configed
os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘0’) os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘1’) os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘Asia/Shanghai’)
‘infi.clickhouse_orm==1.0.4’
original project usage…
ClickHouse dialect for SQLAlchemy.
Installation
The package is installable through PIP:
pip install sqlalchemy-clickhouse
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')
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")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for sqlalchemy_clickhouse_timezone-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b527a54476b9cb21bb97a223b3eeff8b1942df97d230be48f3c94acc06c3fbb |
|
MD5 | 5d436c411d7cc1d1eb220e3a6d41e334 |
|
BLAKE2b-256 | a1baece5cba735a3f191c2f518feb05c2b9a6b479af688a4d79e0e39c05454b7 |