All Projects → omnilib → Aiosqlite

omnilib / Aiosqlite

Licence: mit
asyncio bridge to the standard sqlite3 module

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Aiosqlite

lighthouse
Easy clojure relational database queries, migrations and connection pooling
Stars: ✭ 19 (-95.38%)
Mutual labels:  sqlite, sqlite3
csv-to-sqlite
A desktop app to convert CSV files to SQLite databases!
Stars: ✭ 68 (-83.45%)
Mutual labels:  sqlite, sqlite3
aiosqlite3
sqlite3 on asyncio use loop.run_in_executor proxy
Stars: ✭ 21 (-94.89%)
Mutual labels:  sqlite, asyncio
selekt
A Kotlin and Android wrapper over SQLCipher, providing 256-bit AES encryption of database files.
Stars: ✭ 26 (-93.67%)
Mutual labels:  sqlite, sqlite3
Entityframework.exceptions
Handle database errors easily when working with Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql
Stars: ✭ 266 (-35.28%)
Mutual labels:  sqlite, sqlite3
PokeChat
UNIX compatible, Discord and Telegram inspired, Pokémon-themed instant messaging service.
Stars: ✭ 11 (-97.32%)
Mutual labels:  sqlite, sqlite3
Wxsqlite3
wxSQLite3 - SQLite3 database wrapper for wxWidgets (including SQLite3 encryption extension)
Stars: ✭ 373 (-9.25%)
Mutual labels:  sqlite, sqlite3
go-sqlite
Low-level Go interface to SQLite 3
Stars: ✭ 268 (-34.79%)
Mutual labels:  sqlite, sqlite3
dotfiles
Configs for apps I care about
Stars: ✭ 19 (-95.38%)
Mutual labels:  sqlite, sqlite3
sqlite-okapi-bm25
📑 SQLite extension to add the Okapi BM25 ranking algorithm
Stars: ✭ 30 (-92.7%)
Mutual labels:  sqlite, sqlite3
python-sqlite3-backup
Sqlite3 online API CPython implementation module
Stars: ✭ 44 (-89.29%)
Mutual labels:  sqlite, sqlite3
Go Sqlite Lite
SQLite driver for the Go programming language
Stars: ✭ 315 (-23.36%)
Mutual labels:  sqlite, sqlite3
react-native-quick-sqlite
Fast SQLite for react-native.
Stars: ✭ 239 (-41.85%)
Mutual labels:  sqlite, sqlite3
sqlite zstd vfs
SQLite3 extension for read/write storage compression with Zstandard
Stars: ✭ 42 (-89.78%)
Mutual labels:  sqlite, sqlite3
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (-74.94%)
Mutual labels:  sqlite, sqlite3
mdb2sqlite
Conversion tool used to convert microsoft access database to sqlite.
Stars: ✭ 79 (-80.78%)
Mutual labels:  sqlite, sqlite3
Piccolo
A fast, user friendly ORM and query builder which supports asyncio.
Stars: ✭ 219 (-46.72%)
Mutual labels:  asyncio, sqlite
LoginToASqlite3DatabaseWithoutCredentialsWithAdminer
✔️ An Adminer plugin to use SQLite databases without credentials (no username and no password)
Stars: ✭ 30 (-92.7%)
Mutual labels:  sqlite, sqlite3
VVSequelize
数据库模型映射,自动建表, 自动更新表,数据增删改查, FTS全文搜索, 支持自定义fts3,4,5分词器,可拼音分词. sql,fmdb,wcdb,sqlite3,orm,fts,fts3,fts4,fts5
Stars: ✭ 16 (-96.11%)
Mutual labels:  sqlite, sqlite3
Squeal
A Swift wrapper for SQLite databases
Stars: ✭ 303 (-26.28%)
Mutual labels:  sqlite, sqlite3

aiosqlite: Sqlite for AsyncIO

.. image:: https://img.shields.io/pypi/v/aiosqlite.svg :target: https://pypi.org/project/aiosqlite :alt: PyPI Release .. image:: https://readthedocs.org/projects/aiosqlite/badge/?version=latest :target: https://aiosqlite.omnilib.dev/en/latest/?badge=latest :alt: Documentation Status .. image:: https://img.shields.io/badge/change-log-blue :target: https://github.com/omnilib/aiosqlite/blob/master/CHANGELOG.md :alt: Changelog .. image:: https://img.shields.io/codecov/c/github/omnilib/aiosqlite/master.svg :target: https://codecov.io/gh/omnilib/aiosqlite :alt: Code Coverage .. image:: https://github.com/omnilib/aiosqlite/workflows/Build/badge.svg :target: https://github.com/omnilib/aiosqlite/actions :alt: Build Status .. image:: https://img.shields.io/pypi/l/aiosqlite.svg :target: https://github.com/omnilib/aiosqlite/blob/master/LICENSE :alt: MIT Licensed .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black :alt: Code Style Black

aiosqlite provides a friendly, async interface to sqlite databases.

It replicates the standard sqlite3 module, but with async versions of all the standard connection and cursor methods, plus context managers for automatically closing connections and cursors::

async with aiosqlite.connect(...) as db:
    await db.execute("INSERT INTO some_table ...")
    await db.commit()

    async with db.execute("SELECT * FROM some_table") as cursor:
        async for row in cursor:
            ...

It can also be used in the traditional, procedural manner::

db = await aiosqlite.connect(...)
cursor = await db.execute('SELECT * FROM some_table')
row = await cursor.fetchone()
rows = await cursor.fetchall()
await cursor.close()
await db.close()

aiosqlite also replicates most of the advanced features of sqlite3::

async with aiosqlite.connect(...) as db:
    db.row_factory = aiosqlite.Row
    async with db.execute('SELECT * FROM some_table') as cursor:
        async for row in cursor:
            value = row['column']

    await db.execute('INSERT INTO foo some_table')
    assert db.total_changes > 0

Install

aiosqlite is compatible with Python 3.6 and newer. You can install it from PyPI:

.. code-block:: bash

$ pip install aiosqlite

Details

aiosqlite allows interaction with SQLite databases on the main AsyncIO event loop without blocking execution of other coroutines while waiting for queries or data fetches. It does this by using a single, shared thread per connection. This thread executes all actions within a shared request queue to prevent overlapping actions.

Connection objects are proxies to the real connections, contain the shared execution thread, and provide context managers to handle automatically closing connections. Cursors are similarly proxies to the real cursors, and provide async iterators to query results.

License

aiosqlite is copyright John Reese <https://jreese.sh>, 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.

.. _LICENSE: https://github.com/omnilib/aiosqlite/blob/master/LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].