Skip to main content

SQLite-backed durable SessionStore for glyff.

Project description

glyff-sqlite

SQLite-backed durable SessionStore implementation for glyff.

This is the production backend: one row per execution in a SQLite database, WAL mode, indexed lookups, and native transaction atomicity.

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.serialization import JsonSerializer
from glyff_sqlite import SQLiteSessionStore

store = SQLiteSessionStore("executions.sqlite3", JsonSerializer())

Public API

Name Description
SQLiteSessionStore Durable SessionStore backed by a local SQLite database.
SQLiteClient Low-level SQLite key/value store (generic, reusable).

External metadata

The underlying SQLiteClient exposes stage_write / stage_delete / stage_update so application code can persist its own rows alongside execution records and commit or roll back atomically together:

client = SQLiteClient("session.sqlite3")
store = SQLiteSessionStore(client=client, serializer=JsonSerializer())

tx = await store.begin_transaction()
execution = await store.start_execution(some_id)
await execution.complete("ok", str)

client.stage_write("metadata", "my_key", b"my_value")
client.stage_delete("metadata", "old_key")

await tx.commit()   # execution record + metadata commit atomically

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.12.0.tar.gz (9.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.12.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_sqlite-0.12.0.tar.gz
  • Upload date:
  • Size: 9.6 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.12.0.tar.gz
Algorithm Hash digest
SHA256 4ad1ddeeb55142f1e3f6e902624fd361f75d9e67981055ef54d29d50228ad3a9
MD5 7ae41b49ca53e5cabd0e1ef0ae6a1078
BLAKE2b-256 827da8f75b590133fabd1e840ff44e0175c06e65068d552f925c3bfa2c47b37e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: glyff_sqlite-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 326c575c0b71cf1dc75125c76db3191393ca7f9b835ce615f46c5193a859dc0f
MD5 2d219b0aab1a4a3e4c15105e525ee136
BLAKE2b-256 92930760b4a035a2711932e10e2236912e86b838aa712ae90b6c402dcb08882c

See more details on using hashes here.

Provenance

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