Skip to main content

SqlAlchemy library

Reason this release was yanked:


Project description

QuestDB Logo

QuestDB community Slack channel

QuestDB Connect

This repository contains an implementation of QuestDB's dialect for SQLAlchemy, as well as an engine specification for Apache Superset, using psycopg2 for database connectivity.

The Python module is available here:


Psycopg2 is a widely used and trusted Python module for connecting to, and working with, QuestDB and other PostgreSQL databases.

SQLAlchemy is a SQL toolkit and ORM library for Python. It provides a high-level API for communicating with relational databases, including schema creation and modification. The ORM layer abstracts away the complexities of the database, allowing developers to work with Python objects instead of raw SQL statements.

Apache Superset is an open-source business intelligence web application that enables users to visualize and explore data through customizable dashboards and reports. It provides a rich set of data visualizations, including charts, tables, and maps.


  • Python from 3.9 to 3.11 (superset itself use version 3.9.x)
  • Psycopg2 ('psycopg2-binary~=2.9.6')
  • SQLAlchemy ('SQLAlchemy<=1.4.47')

You need to install these packages because questdb-connect depends on them.


You can install this package using pip:

pip install questdb-connect

SQLALchemy Sample Usage

Use the QuestDB dialect by specifying it in your SQLAlchemy connection string:


From that point on use standard SQLAlchemy:

import datetime
import os

os.environ.setdefault('SQLALCHEMY_SILENCE_UBER_WARNING', '1')

import questdb_connect.dialect as qdbc
from sqlalchemy import Column, MetaData, create_engine, insert
from sqlalchemy.orm import declarative_base

Base = declarative_base(metadata=MetaData())

class Signal(Base):
    __tablename__ = 'signal'
    __table_args__ = (qdbc.QDBTableEngine('signal', 'ts', qdbc.PartitionBy.HOUR, is_wal=True),)
    source = Column(qdbc.Symbol)
    value = Column(qdbc.Double)
    ts = Column(qdbc.Timestamp, primary_key=True)

def main():
    engine = create_engine('questdb://localhost:8812/main')
        with engine.connect() as conn:
        if engine:

if __name__ == '__main__':

Superset Installation

Apache Superset

Follow the instructions available here.


This package is open-source, contributions are welcome. If you find a bug or would like to request a feature, please open an issue on the GitHub repository. Have a look at the instructions for developers if you would like to push a PR.

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

questdb-connect-1.0.8.tar.gz (24.3 kB view hashes)

Uploaded Source

Built Distribution

questdb_connect-1.0.8-py3-none-any.whl (33.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page