Metadata-Version: 2.1
Name: rapptz-asqlite
Version: 1.0.0
Summary: A simple async wrapper for sqlite3
Home-page: https://github.com/Rapptz/asqlite
License: MIT
Author: Rapptz
Maintainer: Seon82
Requires-Python: >=3.5
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Issue Tracker, https://github.com/Rapptz/asqlite/issues/
Project-URL: Repository, https://github.com/Rapptz/asqlite
Description-Content-Type: text/markdown

### 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.

```python
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][implicit-transactions]
4. The [`row_factory`][row_factory] is set to [`sqlite3.Row`][Row].

[implicit-transactions]: https://docs.python.org/3/library/sqlite3.html#controlling-transactions
[row_factory]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.row_factory
[Row]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Row

### License

MIT

