Skip to content

letsdiscodev/python-dqlite-wire

Repository files navigation

dqlite-wire

Pure-Python codec for the dqlite wire protocol — encode and decode the messages a dqlite server speaks.

dqlite is Canonical's distributed SQLite, built on Raft. This package implements the bytes-on-the-wire layer: it turns request/response objects into frames and back, following the official wire-protocol specification. It does no networking, pooling, or SQL — just framing.

Is this the package you want?

Probably not, unless you are building a driver or doing wire-level work (a proxy, traffic capture/replay, a custom client). If you just want to run SQL against dqlite from Python, use one of the higher layers — see The dqlite Python stack below.

Installation

pip install dqlite-wire

Requires Python 3.13+.

Usage

from dqlitewire import encode_message, decode_message
from dqlitewire.messages import LeaderRequest

# Encode a request to bytes
data = encode_message(LeaderRequest())

# Decode bytes back into a message object
message = decode_message(data, is_request=True)

The dqlite Python stack

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

Package Role
sqlalchemy-dqlite 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 — this package Wire-protocol codec

Most applications should use dqlite-dbapi or sqlalchemy-dqlite.

Documentation

Development

See DEVELOPMENT.md for setup and contribution guidelines.

License

MIT

About

Pure Python wire protocol implementation for dqlite

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors