Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.1.4 instead.
Reason given by maintainers: deprecated

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:

PyPi https://pypi.org/project/questdb-connect/

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.

Requirements

  • 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.

Installation

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:

questdb://admin:quest@localhost:8812/main
questdb://admin:quest@host.docker.internal:8812/main

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')
    try:
        Base.metadata.create_all(engine)
        with engine.connect() as conn:
            conn.execute(insert(Signal).values(
                source='coconut',
                value=16.88993244,
                ts=datetime.datetime.utcnow()
            ))
    finally:
        if engine:
            engine.dispose()


if __name__ == '__main__':
    main()

Superset Installation

Apache Superset

Follow the instructions available here.

Contributing

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.

Metadata

Release files for questdb-connect 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for questdb-connect 1.0.8
File Size Uploaded Provenance Actions
questdb-connect-1.0.8.tar.gz 24.3 kB Without provenance Details for questdb-connect-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for questdb-connect 1.0.8
File Interpreter ABI Platform Actions
questdb_connect-1.0.8-py3-none-any.whl Python 3 none any Details for questdb_connect-1.0.8-py3-none-any.whl

Total release size: 57.4 kB

Release files / questdb-connect-1.0.8.tar.gz

Download URL questdb-connect-1.0.8.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3c3f41a226178c87c4243e725eb6cde4df6544592d67aca95dda58bf2d7158bd
BLAKE2b-256 checksum
How to use checksums
226210b5017eb58989a2ed96ad46dcb6687ed293f96eb753c958408deb13e9fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / questdb_connect-1.0.8-py3-none-any.whl

Download URL questdb_connect-1.0.8-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5e193148be1682c2d68d2763aacc2ad0b822808b04cfaf7087f9abd5ad63ada
BLAKE2b-256 checksum
How to use checksums
39005fc230abd8edafebbb7c6bb63b8e5c3e53fb17e90d4219e50af3e264a143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for questdb-connect 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page