Skip to main content

aql

Simple, async query library for modern Python

build status code coverage version license code style

Highlights

aql is a simple, modern, and composable query builder, with support for asynchronous execution of queries against multiple database backends using a unified API. aql uses modern, type annotated data structures for both table definitions and queries.

aql is still in early alpha. Not all features are available or finalized.

Define tables:

@table("objects")
class Object:
    id: PrimaryKey[AutoIncrement[int]]
    name: Unique[str]
    description: text
    created: datetime

Build queries:

query = (
    Object.select()
    .where(Object.id >= 25)
    .order_by(Object.name)
    .limit(5)
)

sql, params = SqlEngine.prepare(query)
# "select * from `objects` where `id` >= ? order by `name` asc limit 5", (25)

Execute queries:

async with connect(...) as db:
    cursor = db.execute(Object.select().where(Object.id < 100))
    async for row in cursor:
        print(f"{row.id} {row.name} {row.description}")

Simple actions:

async with connect(...) as db:
    rows = await db.get(Object, Object.id == 100)
    rows[0].description += "updated"

    await db.modify(Object, rows)

License

aql is copyright Amethyst Reese, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

Metadata

Release files for aql 0.5.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 aql 0.5.0
File Size Uploaded Provenance Actions
aql-0.5.0.tar.gz 27.0 kB Without provenance Details for aql-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aql 0.5.0
File Interpreter ABI Platform Actions
aql-0.5.0-py3-none-any.whl Python 3 none any Details for aql-0.5.0-py3-none-any.whl

Total release size: 55.9 kB

Release files / aql-0.5.0.tar.gz

Download URL aql-0.5.0.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae30b4be985dee7d79128fec42d4ce440e7ac8d28f6beb8d8358bfb48886adb
BLAKE2b-256 checksum
How to use checksums
a49a15254abbf411388e993aa08238f2daba69c375af36873b69f2f01ab6359f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / aql-0.5.0-py3-none-any.whl

Download URL aql-0.5.0-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e3f632b6167bb9e1c6114a38b7884c79ff71fd66ceaef946279888430e3abdd
BLAKE2b-256 checksum
How to use checksums
1a156bece658b235beac805413291c1d47dec683f190748b4d73e365cfdfe009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for aql 0.5.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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