SQLAlchemy GizmoSQL ADBC Dialect
Basic SQLAlchemy dialect for GizmoSQL
Installation
Option 1 - from PyPi
$ pip install sqlalchemy-gizmosql-adbc-dialect
Option 2 - from source - for development
git clone https://github.com/gizmodata/sqlalchemy-gizmosql-adbc-dialect
cd 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 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
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()
Credits
Much code and inspiration was taken from repo: https://github.com/Mause/duckdb_engine
Metadata
Release files for sqlalchemy-gizmosql-adbc-dialect 0.0.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlalchemy_gizmosql_adbc_dialect-0.0.27.tar.gz | 11.6 kB | With provenance | Details for sqlalchemy_gizmosql_adbc_dialect-0.0.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlalchemy_gizmosql_adbc_dialect-0.0.27-py3-none-any.whl | Python 3 | none | any | Details for sqlalchemy_gizmosql_adbc_dialect-0.0.27-py3-none-any.whl |
Total release size: 21.8 kB
Release files / sqlalchemy_gizmosql_adbc_dialect-0.0.27.tar.gz
| Download URL | sqlalchemy_gizmosql_adbc_dialect-0.0.27.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c47d9ecd1f1c7d923d1c27de6bbe5a9e8c917e643fe03bd8466af7102c6a5f3
|
|
BLAKE2b-256 checksum How to use checksums |
a95b5dffbd675e06454f8f76d6e65ed836428617d40084adbeb8c931bcc3f57e
|
| 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 logRelease files / sqlalchemy_gizmosql_adbc_dialect-0.0.27-py3-none-any.whl
| Download URL | sqlalchemy_gizmosql_adbc_dialect-0.0.27-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97eea914b35cc6d63dc08468fbbb1219778817a50418dab1075774d15fe0add8
|
|
BLAKE2b-256 checksum How to use checksums |
ca07dbfafc7d1613d84d5d93a4c30b9f201adf5d4f85741c58c69d5ef0ac8e80
|
| 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 logSecurity for sqlalchemy-gizmosql-adbc-dialect 0.0.27
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sqlalchemy_gizmosql_adbc_dialect-0.0.27.tar.gz
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 logA 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.