sqlite
etrack.providers.adapters.outbox.sqlite
providers/adapters/outbox/sqlite: SqliteAdapter — the outbox in one SQLite file, on the standard library.
One table, one row per undelivered item: append inserts once per key (a key already there is not appended again),
claim leases what is due in one statement, ack deletes, release and dead settle, requeue gives a dead item a
fresh deadline. The connection is the process's own, in WAL mode with synchronous=FULL: a committed append survives a
killed process and a lost machine alike. Every call runs on a worker thread, one at a time, so the loop never waits on
the disk.
SqliteAdapter
The outbox in a SQLite file: durable on commit, read and written off the loop, one call at a time.
append
async
The item stored under key, due now; False when the key is already there (nothing is appended twice).
claim
async
claim(limit: int, lease: timedelta) -> Sequence[Entry]
Up to limit due items, the oldest first, each leased for lease and counted as one more attempt.
dead
async
Given up, with why: kept, never claimed again unless requeued.
of
async
of(key: str) -> Entry | None
The item under key while it is undelivered; None once delivered or never appended.
release
async
Not delivered this time: due again at due, with why.
Statement
Bases: StrEnum
Every statement the adapter runs: the outbox's whole SQL, in one place.