Skip to main content

functualize-state-sqlite

Status: Published — Independently installable from PyPI.

SQLite-backed state persistence and execution tracking plugin for functualize. Implements the StateBackend and ExecutionStore protocols from functualize-state, providing durable key-value storage and full execution history using a local SQLite database in WAL mode. Zero external dependencies beyond the Python standard library's sqlite3 module.

Installation

pip install functualize-state-sqlite

Quick Start

from functualize_state_sqlite import SQLiteStateBackend

# Use as a context manager for automatic cleanup
with SQLiteStateBackend(db_path="my_app.db") as backend:
    backend.set("deploy_count", 42)
    backend.set("last_env", "staging")

    count = backend.get("deploy_count")
    print(f"Deployments: {count}")

    keys = backend.keys(prefix="deploy")
    print(f"Keys: {keys}")

Features

  • Persistent key-value state — JSON-encoded values stored in SQLite with automatic schema initialization
  • WAL mode for concurrency — concurrent read access without blocking writes, suitable for multi-process environments
  • Execution tracking — full session and execution history with nested invocation support and phase recording
  • Namespace-scoped state — SQLiteStateStore provides per-job namespace isolation within workflow scopes
  • Context manager support — all backends support with statements for automatic connection cleanup
  • Zero external dependencies — uses only Python's built-in sqlite3 module
  • Automatic schema migrations — database schema is created and migrated transparently on first access

API Reference

Public classes exported by this plugin:

  • SQLiteStateBackend — Implements the StateBackend protocol with get(), set(), delete(), and keys() methods for persistent key-value storage using a dedicated kv_state table.
  • SQLiteExecutionStore — Implements the ExecutionStore protocol for recording and querying execution records and phase tracking. Methods include insert_execution(), update_execution(), get_session_executions(), insert_phase(), and get_execution_phases().
  • SQLiteStatePlugin — Plugin that registers SQLiteStateBackend and SQLiteExecutionStore with the DI registry at boot time. Hooks into APP_READY and ON_SCOPE_CREATED lifecycle events.
  • ExecutionStatePlugin — Full lifecycle plugin that tracks job executions automatically. Hooks into BEFORE_JOB, AFTER_SUCCESS, AFTER_FAILURE, INVOKE_START, INVOKE_END, and ON_SCOPE_CREATED for comprehensive execution history.

Internal classes (available via direct import but not part of the public protocol surface):

  • SQLiteBackend — Low-level connection manager with WAL mode, schema initialization, and query helpers for sessions, executions, steps, and namespaced state.
  • SQLiteStateStore — StateStoreProtocol implementation scoped to a (scope_id, job_namespace) pair, with get(), set(), delete(), keys(), to_dict(), clear(), and cross-job access via get_job_state().
  • ExecutionTracker — High-level session management and execution recording with automatic session resume based on TTL, and AI context summary generation via to_ai_context().

Development

Run plugin tests:

uv run pytest plugins/functualize-state-sqlite/tests/ -v

Build the package:

uv build --package functualize-state-sqlite

Release files for functualize-state-sqlite 0.2.3

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

Source distribution (sdist)

Source distribution for functualize-state-sqlite 0.2.3
File Size Uploaded
functualize_state_sqlite-0.2.3.tar.gz 30.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for functualize-state-sqlite 0.2.3
File Interpreter ABI Platform
functualize_state_sqlite-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 56.4 kB

Release files / functualize_state_sqlite-0.2.3.tar.gz

Download URL functualize_state_sqlite-0.2.3.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
898acf51af571cf9e56a35eef6bc7746662e4af0728e9b9bde728dc48c77746b
BLAKE2b-256 checksum
How to use checksums
e1aa7805fd9582d854bab590cb569707e30c28b3d36fc9d76d902633536c9d9d
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 Sep 4, 2026.

Transparency log

Release files / functualize_state_sqlite-0.2.3-py3-none-any.whl

Download URL functualize_state_sqlite-0.2.3-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ffcfdaf0caa0a3d51bb241fe7a272a21d43ad98dd7b8c4a96cda0a4893bdfa6
BLAKE2b-256 checksum
How to use checksums
68ada197dc5e9b2e77b4f969c325cd432c971c44d9dffb96a864dcb2b4dbe7b0
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 Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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