database_wrapper_sqlite
Part of the database_wrapper package.
This python package is a database wrapper for sqlite database.
Installation
pip install database_wrapper[sqlite]
Usage
from database_wrapper_sqlite import Sqlite, DBWrapperSqlite
db = Sqlite({"database": "my_database.db"})
db.open()
db_wrapper = DBWrapperSqlite(db_cursor=db.cursor)
res = db_wrapper.get_by_key(MyModel(), "id", 3005)
if res:
print(f"get_by_key: {res.to_dict()}")
db.close()
Async
SqliteWithPoolingAsync has the shape of PgsqlWithPoolingAsync: async with pool as (connection, cursor), so code written against one runs on the other as long as its SQL does.
It opens a fresh aiosqlite connection per context rather than reusing them.
from database_wrapper_sqlite import SqliteWithPoolingAsync, DBWrapperSqliteAsync
pool = SqliteWithPoolingAsync({"database": "/srv/app/data/app.sqlite3"})
await pool.open_pool()
async with pool as (connection, cursor):
db_wrapper = DBWrapperSqliteAsync(cursor)
async with connection.transaction():
await db_wrapper.insert(MyModel(name="x"))
res = db_wrapper.get_all(MyModel(), custom_query="SELECT * FROM my_table WHERE active = 1")
async for record in res:
print(record.to_dict())
Async connections differ from the sync Sqlite on purpose:
- Autocommit: every statement commits on its own outside
connection.transaction(), as on a pooled PostgreSQL connection.isolation_levelis ignored. transaction()starts withBEGIN IMMEDIATE, taking the write lock up front, so a transaction that reads before it writes cannot fail withSQLITE_BUSYat the write. Nested calls are savepoints.PRAGMA foreign_keys = ONon every connection, and WAL for a file database.- Rows are dicts;
DBWrapperSqliteAsyncuses?placeholders and reads inserted ids fromlastrowid.
SqliteAsync is the single-connection form, like PgsqlAsync.
Metadata
Release files for database-wrapper-sqlite 0.3.147
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| database_wrapper_sqlite-0.3.147.tar.gz | 8.8 kB | With provenance | Details for database_wrapper_sqlite-0.3.147.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| database_wrapper_sqlite-0.3.147-py3-none-any.whl | Python 3 | none | any | Details for database_wrapper_sqlite-0.3.147-py3-none-any.whl |
Total release size: 18.3 kB
Release files / database_wrapper_sqlite-0.3.147.tar.gz
| Download URL | database_wrapper_sqlite-0.3.147.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aa14f1e1b2297637ba867a9859a2265edc00df32800cf0b6d0c463abc4b51a8
|
|
BLAKE2b-256 checksum How to use checksums |
6aff4c59b8e4b424f899f8ff27b7adac8f7acca76d998f743c01037ce4764bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / database_wrapper_sqlite-0.3.147-py3-none-any.whl
| Download URL | database_wrapper_sqlite-0.3.147-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
598897d84f62c82153b14eac14e826f1ca16e83c691090e89a1b75fc4c1069ab
|
|
BLAKE2b-256 checksum How to use checksums |
054153642478abccd5b67e5b7844bdcc7d8d34f1bed850f9b5dac0cae510bbee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logSecurity for database-wrapper-sqlite 0.3.147
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for database_wrapper_sqlite-0.3.147.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.