Skip to main content

Superset SQLAlchemy GizmoSQL ADBC Dialect

superset-sqlalchemy-gizmosql-adbc-dialect-ci Supported Python Versions PyPI version PyPI Downloads

Basic Apache Superset compatible SQLAlchemy dialect for GizmoSQL

This package uses a version of SQLAlchemy which is compatible with Apache Superset 6.0.*

[!NOTE] The term "dialect" is used in SQLAlchemy to refer to a specific database backend. See: https://docs.sqlalchemy.org/en/20/dialects/ for more details. This package uses a DuckDB SQL dialect when sending SQL commands to the GizmoSQL server.

Installation

Option 1 - from PyPi

$ pip install superset-sqlalchemy-gizmosql-adbc-dialect

Option 2 - from source - for development

git clone https://github.com/gizmodata/superset-sqlalchemy-gizmosql-adbc-dialect

cd superset-sqlalchemy-gizmosql-adbc-dialect

# Create the virtual environment
python3 -m venv .venv

# Activate the virtual environment
. .venv/bin/activate

# Upgrade pip, setuptools, and wheel
pip install --upgrade pip setuptools wheel

# Install Superset SQLAlchemy GizmoSQL ADBC Dialect - in editable mode with dev dependencies
pip install --editable .[dev]

Note

For the following commands - if you are running from source and using --editable mode (for development purposes) - you will need to set the PYTHONPATH environment variable as follows:

export PYTHONPATH=$(pwd)/src

Usage

Once you've installed this package, you should be able to just use it, as SQLAlchemy does a python path search

Start a GizmoSQL Server - example below - see https://github.com/gizmodata/GizmoSQL for more details

docker run --name gizmosql \
           --detach \
           --rm \
           --tty \
           --init \
           --publish 31337:31337 \
           --env TLS_ENABLED="1" \
           --env GIZMOSQL_PASSWORD="gizmosql_password" \
           --env PRINT_QUERIES="1" \
           --pull missing \
           gizmodata/gizmosql:latest

[!IMPORTANT] The GizmoSQL server must be started with the DuckDB (default) back-end. The SQLite back-end is not supported.

Connect with the SQLAlchemy GizmoSQL ADBC Dialect

import os
import logging

from sqlalchemy import create_engine, MetaData, Table, select, Column, text, Integer, String, Sequence
from sqlalchemy.orm import Session
from sqlalchemy.orm import declarative_base
from sqlalchemy.engine.url import URL

# Setup logging
logging.basicConfig()
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)


Base = declarative_base()


class FakeModel(Base):  # type: ignore
    __tablename__ = "fake"

    id = Column(Integer, Sequence("fakemodel_id_sequence"), primary_key=True)
    name = Column(String)


def main():
    # Build the URL
    url = URL.create(drivername="gizmosql",
                     host="localhost",
                     port=31337,
                     username=os.getenv("GIZMOSQL_USERNAME", "gizmosql_username"),
                     password=os.getenv("GIZMOSQL_PASSWORD", "gizmosql_password"),
                     query={"disableCertificateVerification": "True",
                            "useEncryption": "True"
                            }
                     )

    print(f"Database URL: {url}")

    engine = create_engine(url=url)
    Base.metadata.create_all(bind=engine)

    metadata = MetaData()
    metadata.reflect(bind=engine)

    for table_name in metadata.tables:
        print(f"Table name: {table_name}")

    with Session(bind=engine) as session:

        # Try ORM
        session.add(FakeModel(id=1, name="Joe"))
        session.commit()

        joe = session.query(FakeModel).filter(FakeModel.name == "Joe").first()

        assert joe.name == "Joe"

        # Execute some raw SQL
        results = session.execute(statement=text("SELECT * FROM fake")).fetchall()
        print(results)

        # Try a SQLAlchemy table select
        fake: Table = metadata.tables["fake"]
        stmt = select(fake.c.name)

        results = session.execute(statement=stmt).fetchall()
        print(results)


if __name__ == "__main__":
    main()

Superset - connection URL example

Here is a example connection URL (for use with Apache Superset):

gizmosql://gizmosql_username:gizmosql_password@localhost:31337?disableCertificateVerification=True&useEncryption=True

To specify a catalog other than the default - you can specify the catalog argument - example:

gizmosql://gizmosql_username:gizmosql_password@localhost:31337?disableCertificateVerification=True&useEncryption=True&catalog=test

Credits

Much code and inspiration was taken from repo: https://github.com/Mause/duckdb_engine

Metadata

Release files for superset-sqlalchemy-gizmosql-adbc-dialect 0.0.10

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

Source distribution (sdist)

Source distribution for superset-sqlalchemy-gizmosql-adbc-dialect 0.0.10
File Size Uploaded
superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for superset-sqlalchemy-gizmosql-adbc-dialect 0.0.10
File Interpreter ABI Platform
superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10.tar.gz

Download URL superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
48d72524bee94e52150823948587b9114f64fc3d03df454b7437035e9ace8aa0
BLAKE2b-256 checksum
How to use checksums
5bc753ba86ebefd781c8288e41b4abb0adc68aae83afd88ff5637ca0c096485e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release files / superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10-py3-none-any.whl

Download URL superset_sqlalchemy_gizmosql_adbc_dialect-0.0.10-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7429468a0f37c74a9d303f8f2696bf0e073ebe6031cf641a25008ffe78cf0f6
BLAKE2b-256 checksum
How to use checksums
c85047d28b1a26195c1a6cf37857b7c7e27a131c3229158b0361cbcfcb9a0764
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

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