Skip to main content

SQLite-backed durable SessionStore for glyff.

Project description

glyff-sqlite

SQLite-backed durable ExecutionRepository implementation for glyff.

This is the production backend: one row per execution in a SQLite 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.

Install

pip install glyff-sqlite

This package depends on glyff>=0.1.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 repository and transaction provider.
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.

Per-execution metadata

Persist application data alongside an execution from within an engraved call:

ctx = glyff.get_context()
await ctx.metadata.set("my_key", {"any": "json-serializable value"})
value = await ctx.metadata.get("my_key", dict)

Metadata is a keyed map owned by the current Execution aggregate. ctx.metadata.set(...) stages metadata into the currently active transaction. During normal engraved execution, metadata set in the function body commits atomically with the execution's COMPLETED status and result. If completing the current execution fails, metadata staged through ctx.metadata.set(...) in that function body is rolled back with the completion write.

Metadata is removed if that execution's record is deleted.

Transaction model

  • 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 per-database asyncio write lock serialises concurrent write transactions.

Status

Early development. APIs may change before v1.0.

License

MIT

Project details


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.13.0.tar.gz (8.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.13.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_sqlite-0.13.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glyff_sqlite-0.13.0.tar.gz
Algorithm Hash digest
SHA256 d28ee1a6ca9049a1fc1848d777fecbf216efadfc1f7e0c3e7871ae228c56e190
MD5 5ff0da89e5067052ce39498e86d6b7be
BLAKE2b-256 d3e3d720251edd93a8a1f1c6948a190bb0feafd83f211a2dcdf05e09c4113e19

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: glyff_sqlite-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glyff_sqlite-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63699ea2615ea4763ca2b9f30977ed149181cae9c10a2d912086615a96addba8
MD5 e1c671a32d840396f44229d1525975a1
BLAKE2b-256 8250c4f6046f2cbe5dbf01c73a017ea30db8cdb9077296d70d5a1b4548fac035

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page