Skip to main content

asqlite

A simple and easy to use async wrapper for sqlite3.

This is basically the same as sqlite3 except you use async with and await in front of most operations.

import asyncio
import asqlite

async def main():
    async with asqlite.connect('example.db') as conn:
        async with conn.cursor() as cursor:
            # Create table
            await cursor.execute('''CREATE TABLE stocks
                                    (date text, trans text, symbol text, qty real, price real)''')

            # Insert a row of data
            await cursor.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")

            # Save (commit) the changes
            await conn.commit()

asyncio.run(main())

Install

To install this via PyPI, use the asqlite package:

python3 -m pip install -U asqlite

Differences from sqlite3

This module differs from sqlite3 in a few ways:

  1. Connections are created with journal_mode set to wal.
  2. Connections have foreign keys enabled by default.
  3. Implicit transactions are turned off
  4. The row_factory is set to sqlite3.Row.
  5. A asqlite.Pool is provided for connection pooling

License

MIT

Metadata

Release files for asqlite 2.0.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 asqlite 2.0.0
File Size Uploaded
asqlite-2.0.0.tar.gz 9.1 kB Details

Built distribution (wheel)

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

Total release size: 18.0 kB

Release files / asqlite-2.0.0.tar.gz

Download URL asqlite-2.0.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
97645200037f822c170e7dafa8b8422f85983a36e03060e47dcd932c0e1714a3
BLAKE2b-256 checksum
How to use checksums
c3c68349e97598590d1da0675b7ffbbb1c6293af5e9421d0c8683552e1ccab1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.1

Release files / asqlite-2.0.0-py3-none-any.whl

Download URL asqlite-2.0.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
271b4206dbab14da93ff191fb03f3166d11d8feec90467653762636810f040b5
BLAKE2b-256 checksum
How to use checksums
1b29bc22327700c07d08894dfcbfb5a82349f533a0190171b3fd2d8b7dc7b8c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

0.0.1

1 release file

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