Skip to main content

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_level is ignored.
  • transaction() starts with BEGIN IMMEDIATE, taking the write lock up front, so a transaction that reads before it writes cannot fail with SQLITE_BUSY at the write. Nested calls are savepoints.
  • PRAGMA foreign_keys = ON on every connection, and WAL for a file database.
  • Rows are dicts; DBWrapperSqliteAsync uses ? placeholders and reads inserted ids from lastrowid.

SqliteAsync is the single-connection form, like PgsqlAsync.

Metadata

Release files for database-wrapper-sqlite 0.4.0

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

Source distribution (sdist)

Source distribution for database-wrapper-sqlite 0.4.0
File Size Uploaded Provenance Actions
database_wrapper_sqlite-0.4.0.tar.gz 8.9 kB With provenance Details for database_wrapper_sqlite-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for database-wrapper-sqlite 0.4.0
File Interpreter ABI Platform Actions
database_wrapper_sqlite-0.4.0-py3-none-any.whl Python 3 none any Details for database_wrapper_sqlite-0.4.0-py3-none-any.whl

Total release size: 18.5 kB

Release files / database_wrapper_sqlite-0.4.0.tar.gz

Download URL database_wrapper_sqlite-0.4.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a7a659f520691e9b04ee02c064c135f485b86d271e3ce475cc7c72c2bc7c6ceb
BLAKE2b-256 checksum
How to use checksums
0c07e3909f91aefcdd463c976a0c8644c7fa590cae7e9ec37d7a9d9195ce703b
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 27, 2026.

Transparency log

Release files / database_wrapper_sqlite-0.4.0-py3-none-any.whl

Download URL database_wrapper_sqlite-0.4.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79a7c8bfb8a130a0723ebe26bd1d8711eb2c3931844b6ad4c461197236f474b3
BLAKE2b-256 checksum
How to use checksums
a86ecf73919f8abc8c11fe8ca515eb33a445aaf4f4264bb82a38292d45fee853
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 27, 2026.

Transparency log

Security for database-wrapper-sqlite 0.4.0

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.

Select from 2 files

Attestation for database_wrapper_sqlite-0.4.0.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 27, 2026.

Transparency log

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

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

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