A SQLAlchemy dialect for TimescaleDB
Project description
SQLAlchemy TimescaleDB
This is the TimescaleDB dialect driver for SQLAlchemy.
Install
$ pip install sqlalchemy-timescaledb
Usage
Adding to table timescaledb_hypertable
option allows you to configure the hypertable parameters:
import datetime
from sqlalchemy import create_engine, MetaData
from sqlalchemy import Table, Column, Integer, String, DateTime
engine = create_engine('timescaledb://user:password@host:port/database')
metadata = MetaData()
metadata.bind = engine
Metric = Table(
'metric', metadata,
Column('name', String),
Column('value', Integer),
Column('timestamp', DateTime(), default=datetime.datetime.now),
timescaledb_hypertable={
'time_column_name': 'timestamp'
}
)
metadata.create_all(engine)
Drivers psycopg
, psycopg2
and asyncpg
are supported.
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
Built Distribution
Close
Hashes for sqlalchemy-timescaledb-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bead97dabc3d41b5ce56d52dc77204dc34ccdd7c6117ab3356febfff8349b4da |
|
MD5 | 61682c1636f5250d8c88203bcdbf4399 |
|
BLAKE2b-256 | 88a21daca39e999c34e5836a395ad219236fd55c5d251a3ce38bf8818a754b25 |
Close
Hashes for sqlalchemy_timescaledb-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ce3cc273fd892a148ab4f13bcfbe7ed0e768023ad559561d949ede68a75272d |
|
MD5 | 0100862ddfd7d1a4eeb8c147850f237b |
|
BLAKE2b-256 | 558d2817dfd797d2d6e954e98c1d25eb607aabc28e0e7fa74905ad7aa0ba054a |