Skip to main content

Toolframe SQLite provider

sql-sqlite owns data/plugins/<plugin-id>/data.sqlite, separately from core's management database. Plugins use RuntimeContext.sql() and parameterized SQL; the host supplies application, owner, generation, root and deadline identity. No file path or raw connection is returned. This is lifecycle/data ownership isolation for trusted local plugins, not an operating-system sandbox.

Install the provider into a running application before enabling plugins that require managed SQL:

toolframe --home APP plugin add pypi:toolframe-sql-sqlite==0.4.0 --enable

Normal SQL supports queries, mutations, indexes declared in migrations, and same-store transactions. Runtime DDL, transaction control, attachment, PRAGMAs and provider metadata access are denied by SQLite's authorizer. Transactions are bound to one root/generation and roll back on expiry, root loss or disposal. A statement failure poisons a transaction. Mutation IDs and same-database receipts allow callers to resolve an unknown acknowledgement without repeating a write.

Each application/owner store lazily pools one writer connection and one separate reader connection. A transaction retains the writer until commit, rollback, expiry or root cleanup; standalone mutations use the same writer. Other writes wait asynchronously instead of opening competing write connections, leaving the holder free to finish its next RPC. Committed-state reads and other owners can proceed while a transaction is open. Return all writes within a transaction through its transaction client/token; a second unscoped writer from the same root/store is rejected as nested_transaction instead of waiting on itself. A queued transaction also reserves its root/store: await an earlier write before beginning a transaction, and await begin before issuing its token-bound writes.

Each connection slot permits at most 128 waiting calls. Admission obeys the host-issued root deadline and cancellation; a full queue returns storage_busy before that call runs SQL. Connections are reset before reuse and closed on provider disposal. This coordinates one provider process, not arbitrary external SQLite writers. SQL execution is still synchronous and external lock contention retains SQLite's 50ms busy timeout. Pooling does not provide business idempotency or make long-running SQL nonblocking.

Empty stores initialize automatically. Existing schema changes require a core migration plan and explicit apply. Apply checks the plan/history, uses SQLite's backup API, executes all pending migrations and history in one transaction, and rolls back failures. Nontransactional statements are rejected. Committed schema changes are never automatically reverted; backups require an explicit operator repair workflow. Disabling/uninstalling a plugin retains its database.

The toolframe.sql.admin service is host-only. Business plugins declare a requirement on toolframe.sql version 1. Cross-plugin data access uses the owning plugin's business service. There are no cross-database transactions.

Development: uv sync --group dev, uv run pytest -q, uv build --no-sources. The sibling SDK UV source is a development convenience; wheels depend only on the published SDK contract.

For isolated local validation, GitHub Actions and manual TestPyPI/PyPI publishing, see CI and publishing.

For release validation and Trusted Publisher setup, see releasing.

License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Version 0.3 adds execute_returning for mutations with a RETURNING clause. It returns rows and rowcount, including within transactions and durable mutation receipts. Existing SQLite SQL, migration checksums and execute results are preserved; PostgreSQL variants in migration declarations do not change SQLite history.

For development hooks and contribution rules, see Contributing.

Metadata

Release files for toolframe-sql-sqlite 0.4.1

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

Source distribution (sdist)

Source distribution for toolframe-sql-sqlite 0.4.1
File Size Uploaded Provenance Actions
toolframe_sql_sqlite-0.4.1.tar.gz 41.4 kB With provenance Details for toolframe_sql_sqlite-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toolframe-sql-sqlite 0.4.1
File Interpreter ABI Platform Actions
toolframe_sql_sqlite-0.4.1-py3-none-any.whl Python 3 none any Details for toolframe_sql_sqlite-0.4.1-py3-none-any.whl

Total release size: 56.7 kB

Release files / toolframe_sql_sqlite-0.4.1.tar.gz

Download URL toolframe_sql_sqlite-0.4.1.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fa5e1662401e319cc9b70d1d2212036ae9c2834a07e09d97948c9a8a538842d8
BLAKE2b-256 checksum
How to use checksums
8db500c81cf5a5c6225e53c17d408e09d82a2b654cb20b462b660f52a1822d91
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 24, 2026.

Transparency log

Release files / toolframe_sql_sqlite-0.4.1-py3-none-any.whl

Download URL toolframe_sql_sqlite-0.4.1-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33cbd089674f7744f077658a89e68e447f579119fbc45410796d601088b801c4
BLAKE2b-256 checksum
How to use checksums
07e52396ea953fc58d7373dbf8cf20e2d2287f0f3b4ba2f922e4f85da6ef71dd
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 24, 2026.

Transparency log

Security for toolframe-sql-sqlite 0.4.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for toolframe_sql_sqlite-0.4.1.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 24, 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.

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