Skip to main content

glyff-sqlite

SQLite-backed durable ExecutionRepository implementation for glyff.

This is the production backend: one row per execution in a SQLite glyff_executions table, WAL mode, indexed lookups, and native transaction atomicity. Execution result and metadata columns are stored as readable JSON text, so serializers used with this backend must produce JSON text.

table_prefix (default glyff) names the two tables the store owns: <prefix>_executions and <prefix>_meta, which records the format version so a store written by an incompatible build is refused. Pass table_prefix= to cohabit an application's own database; PRAGMA user_version is left to the application.

Install

pip install glyff-sqlite

This package depends on glyff>=0.14.0 (no additional runtime dependencies — sqlite3 is part of the standard library).

Usage

from glyff_sqlite import SQLiteBackend

backend = SQLiteBackend("executions.sqlite3")

Public API

Name Description
SQLiteBackend Bundle exposing the store's collaborators.
SQLiteExecutionRepository Durable repository backed by local SQLite.
SQLiteTransactionProvider Transaction provider for the SQLite backend.

The underlying SQLiteClient is internal and not part of the public API.

Storage model

  • One row per execution; arguments, result and metadata are JSON text columns, readable in place with any SQLite client.
  • arguments holds the canonical arguments verbatim — the row's key is their digest, so the column is stored and returned byte-for-byte rather than re-encoded.
  • Records are keyed by (session_id, path); a <prefix>_session_domains row carries the version one session claimed for one domain, and a single <prefix>_meta row the store's format version.
  • Per-execution metadata (see the glyff README) commits atomically with the execution's COMPLETED status and result, and is removed with the execution's row when the record is deleted.

Transaction model

  • Enumeration streams the range scan a batch of rows at a time, so a sweep over a large table costs bounded memory.
  • Writes are staged in-memory per transaction and flushed on commit.
  • Nested transactions (child scopes) commit independently of their parent.
  • BEGIN IMMEDIATE prevents writer contention; WAL mode keeps reads fast. A session's version for a domain is claimed inside one, so workers racing to resume the same session agree on a single winner.
  • A per-database asyncio write lock serialises concurrent write transactions.

Planned

  • Store migrations — nothing yet converts a store from one format version to the next (#41).
  • External transaction enlistment — running inside an application's own connection (#42).

Status

Pre-1.0 — the API is unstable and will change.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glyff_sqlite-0.16.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glyff_sqlite-0.16.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file glyff_sqlite-0.16.0.tar.gz.

File metadata

  • Download URL: glyff_sqlite-0.16.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for glyff_sqlite-0.16.0.tar.gz
Algorithm Hash digest
SHA256 bc0c291cb9f8480ba4e3e1ae2539c35173cdd9662d287c8fb91d9cc61d7b2079
MD5 ec7fc10031c90378b668c65c6932b088
BLAKE2b-256 db4fc608313099d1562466b6c3407d9be17aae777d185d73c2fe78924ec26f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_sqlite-0.16.0.tar.gz:

Publisher: publish-glyff-sqlite.yml on nueruyu/glyff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file glyff_sqlite-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: glyff_sqlite-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for glyff_sqlite-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f74f8f05638dcfa468d17aeaa4d384ca082454d604ab8962a7886bf19780c95
MD5 28c9558a80cd24c6f3c040d7c8dfe1b9
BLAKE2b-256 7f3272c3087b8e988ce392bf0df61354ed3a061b95c1d52e35ccfe072905ab37

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_sqlite-0.16.0-py3-none-any.whl:

Publisher: publish-glyff-sqlite.yml on nueruyu/glyff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 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