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.14.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.14.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_sqlite-0.14.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.14.0.tar.gz
Algorithm Hash digest
SHA256 219668aa3bda539f7bad0d38dbea509178daa3ae74f235c805fcb0490290a141
MD5 de9afdd7d80cb7340db8e74d29f2126d
BLAKE2b-256 0d84bd9ec211e7c18f962099f738ccf1c4b14cf1b83791f3a6675961874ad1f0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: glyff_sqlite-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8787c2d19c7545be3b75e2104ec79f574bcc735153e4f6d5d7da9701a98401ac
MD5 1589e13cfc6d9fc71bd3b03499b79d9e
BLAKE2b-256 899d5a63763a215337f84bcf75522955e4dac5a2988bd2d1472c2ef239f55bd7

See more details on using hashes here.

Provenance

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

0.15.0

2 files

This release

0.14.0 This release

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