Skip to main content

A simple and easy to use async wrapper for sqlite3.

Project description

fastsqlite3

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 fastsqlite3

async def main():
    async with fastsqlite3.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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastsqlite3-2.0.0a0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastsqlite3-2.0.0a0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file fastsqlite3-2.0.0a0.tar.gz.

File metadata

  • Download URL: fastsqlite3-2.0.0a0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for fastsqlite3-2.0.0a0.tar.gz
Algorithm Hash digest
SHA256 286f5f85ef8b2b6d4d5c8585ccf6b6a3c64fb80e3778fd5cbde17e1ab6addc1f
MD5 df191f2603ac0dc7903e3b0d99b23649
BLAKE2b-256 4435d52747270d27fb41aad99ab01801e4ff2320373311e8fda6ea451ed61903

See more details on using hashes here.

File details

Details for the file fastsqlite3-2.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: fastsqlite3-2.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for fastsqlite3-2.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 d471247b8952eb74951d1665dab6ee1fad1a502bf72707cd621a1d48100a906c
MD5 68c4fe2974725409fb3aedd7280553cf
BLAKE2b-256 e62e8be802cc82ae379b661dbb3508bb5f2955a7146336e235298f0c44b752e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page