Skip to main content

sqlalchemy-dqlite

A SQLAlchemy 2.0 dialect for dqlite, Canonical's distributed SQLite. Point SQLAlchemy (and Alembic, and most ORMs built on it) at a dqlite cluster with a dqlite:// URL and use it like any other backend.

It supports both the synchronous and the async SQLAlchemy engines, and builds on dqlite's SQLite roots, so SQLAlchemy treats it as a SQLite-family dialect.

Is this the package you want?

Yes, if you use SQLAlchemy or an ORM/migration tool on top of it (Alembic, Flask-SQLAlchemy, etc.) and want it backed by dqlite. If you want a plain database driver without SQLAlchemy, use dqlite-dbapi.

Installation

pip install sqlalchemy-dqlite

Requires Python 3.13+ and SQLAlchemy 2.0+.

Usage

from sqlalchemy import create_engine, text

engine = create_engine("dqlite://localhost:9001/mydb")
with engine.connect() as conn:
    print(conn.execute(text("SELECT 1")).fetchone())

Async:

from sqlalchemy.ext.asyncio import create_async_engine

engine = create_async_engine("dqlite+aio://localhost:9001/mydb")
async with engine.connect() as conn:
    result = await conn.execute(text("SELECT 1"))
    print(result.fetchone())

URL format: dqlite://host:port/database (or dqlite+aio://… for async). The host:port is the bootstrap node — the cluster is discovered from there. See Connection URL for details.

The dqlite Python stack

This is the top of four layered packages. Each builds on the one below:

Package Role
sqlalchemy-dqlite — this package SQLAlchemy 2.0 dialect
dqlite-dbapi PEP 249 (DB-API 2.0) driver — sync & async
dqlite-client Async wire client — pooling, leader discovery
dqlite-wire Wire-protocol codec

Documentation

  • Transactions — SQLAlchemy owns BEGIN/COMMIT; no AUTOCOMMIT.
  • Connection URL — URL format, the bootstrap address, and query parameters.
  • Limitations & notes — STRICT tables, savepoint naming, and a server-version NULL gotcha.

Development

See DEVELOPMENT.md for setup, contribution guidelines, and how to run the SQLAlchemy compliance test suite.

License

MIT

Metadata

Release files for sqlalchemy-dqlite 0.8.0

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

Source distribution (sdist)

Source distribution for sqlalchemy-dqlite 0.8.0
File Size Uploaded Provenance Actions
sqlalchemy_dqlite-0.8.0.tar.gz 103.1 kB With provenance Details for sqlalchemy_dqlite-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-dqlite 0.8.0
File Interpreter ABI Platform Actions
sqlalchemy_dqlite-0.8.0-py3-none-any.whl Python 3 none any Details for sqlalchemy_dqlite-0.8.0-py3-none-any.whl

Total release size: 125.0 kB

Release files / sqlalchemy_dqlite-0.8.0.tar.gz

Download URL sqlalchemy_dqlite-0.8.0.tar.gz
Size 103.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d34dc1884fd39e301156d6d7a7c0440ae5f1bccc0a681069727cdcf4550ce24d
BLAKE2b-256 checksum
How to use checksums
c40bc360b69e9154447d6f57fbc73245833777e43dee01655589f09b23c33565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 13, 2026.

Transparency log

Release files / sqlalchemy_dqlite-0.8.0-py3-none-any.whl

Download URL sqlalchemy_dqlite-0.8.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a3522364839a0771740bf757ebadd55f2333143d47682d049dc58343abdca8f
BLAKE2b-256 checksum
How to use checksums
95d75e61cb00f6cd72057292136328f1daf43830caceb1fef1cd0f0a32dfb020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 13, 2026.

Transparency log

Security for sqlalchemy-dqlite 0.8.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sqlalchemy_dqlite-0.8.0.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 Sep 13, 2026.

Transparency log

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