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.15.0.tar.gz (16.4 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.15.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_sqlite-0.15.0.tar.gz
  • Upload date:
  • Size: 16.4 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.15.0.tar.gz
Algorithm Hash digest
SHA256 3f41b69ebf3fc47c5e366d1a5c4640c1dab61e8e4d62312aa5a7caef83573c56
MD5 f8a5992ad5634329629b813f95b5b294
BLAKE2b-256 ae201c72eb4c4bc2399ca82fe0b6860648c1047a2d5e76604acac0d24e2ef416

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_sqlite-0.15.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.15.0-py3-none-any.whl.

File metadata

  • Download URL: glyff_sqlite-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 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.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ca938063b6993801ff3fbc00c2b8a5d9b3e26e4addbbf551a8a779d431ca9bb
MD5 6a69c8777fff86131518593d9a765f91
BLAKE2b-256 caabb7ae0cf32cf42e8dc9147489d780dac58508e0e58e592fc62e4d9b699ec1

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_sqlite-0.15.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

0.16.0

2 files

This release

0.15.0 This release

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