Async Python client for dqlite with connection pooling and leader detection
Project description
dqlite-client
Async Python client for dqlite, following asyncpg patterns.
Installation
pip install dqlite-client
Usage
import asyncio
from dqliteclient import connect
async def main():
conn = await connect("localhost:9001")
async with conn.transaction():
await conn.execute("CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, name TEXT)")
await conn.execute("INSERT INTO test (name) VALUES (?)", ["hello"])
rows = await conn.fetch("SELECT * FROM test")
for row in rows:
print(row)
await conn.close()
asyncio.run(main())
Connection Pooling
from dqliteclient import create_pool
pool = await create_pool(["localhost:9001", "localhost:9002", "localhost:9003"])
async with pool.acquire() as conn:
rows = await conn.fetch("SELECT 1")
Development
See DEVELOPMENT.md for setup and contribution guidelines.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dqlite_client-0.1.0.tar.gz.
File metadata
- Download URL: dqlite_client-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da58cf889e568edd65289784559a8b6229787d3b1a9e914f7d0ab00bbb1fcd91
|
|
| MD5 |
0cfac519a4001bae7e1c393dba150d44
|
|
| BLAKE2b-256 |
f105cd674b38e924f491b4f3f5f3a61aaf9bac6ecb8c5b4db453e63d1b62c45c
|
Provenance
The following attestation bundles were made for dqlite_client-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on letsdiscodev/python-dqlite-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dqlite_client-0.1.0.tar.gz -
Subject digest:
da58cf889e568edd65289784559a8b6229787d3b1a9e914f7d0ab00bbb1fcd91 - Sigstore transparency entry: 868877452
- Sigstore integration time:
-
Permalink:
letsdiscodev/python-dqlite-client@529cd7727f6db0008bb06a116b10754471eeaffd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/letsdiscodev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@529cd7727f6db0008bb06a116b10754471eeaffd -
Trigger Event:
push
-
Statement type:
File details
Details for the file dqlite_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dqlite_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6551631c7e1cc60cb39ff2aadadebbd92c0b196fca32a3ce5d270bfc0fd8364a
|
|
| MD5 |
808c3f4fa8ad7dc204f1819b0b08668b
|
|
| BLAKE2b-256 |
edd6c5dc3558e13cf11f88ec4cfec3666ae67e093a5329aeaf7f54a98c41eaea
|
Provenance
The following attestation bundles were made for dqlite_client-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on letsdiscodev/python-dqlite-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dqlite_client-0.1.0-py3-none-any.whl -
Subject digest:
6551631c7e1cc60cb39ff2aadadebbd92c0b196fca32a3ce5d270bfc0fd8364a - Sigstore transparency entry: 868877460
- Sigstore integration time:
-
Permalink:
letsdiscodev/python-dqlite-client@529cd7727f6db0008bb06a116b10754471eeaffd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/letsdiscodev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@529cd7727f6db0008bb06a116b10754471eeaffd -
Trigger Event:
push
-
Statement type: