Skip to main content

asqlite

This package is a fork of rapptz's asqlite. asqlite is 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())

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.

License

MIT

Release files for rapptz-asqlite 1.0.1

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

Source distribution (sdist)

Source distribution for rapptz-asqlite 1.0.1
File Size Uploaded
rapptz-asqlite-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

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

Total release size: 13.5 kB

Release files / rapptz-asqlite-1.0.1.tar.gz

Download URL rapptz-asqlite-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3395940aa097088bbdd3cf814d2430442ba576c2712363c3c8e79dbe46cc1c8d
BLAKE2b-256 checksum
How to use checksums
5a4e6e79a42ab73cb0398e4adb19ad12a555d9c6237c9207acaa5fe2dde99f88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Linux/5.17.13-300.fc36.x86_64

Release files / rapptz_asqlite-1.0.1-py3-none-any.whl

Download URL rapptz_asqlite-1.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a629ae105cc9b26611d439288b655a90b0be5fce55a4548a0e054c5affe60a90
BLAKE2b-256 checksum
How to use checksums
98dda984d8e0644448099db2291205da850025bb2fb10053a78b1629da079fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Linux/5.17.13-300.fc36.x86_64

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

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