durable_queue_sqlite 1.2.0
durable_queue_sqlite: ^1.2.0 copied to clipboard
SQLite storage for durable_queue on mobile, desktop, and web. Persists tasks across app restarts with indexed, transactional queries.
1.2.0 #
- A row whose record cannot be read no longer stops the queue. Before, the
queue retried reading it forever, so one damaged row stopped every task
behind it. Now
getreturns null for it, the lists skip it (a limitedgetByStatusstill returns up to its limit of readable tasks), andgetNextReadysets it aside, leaving the row as it is.unreadableTaskIds()lists such rows andtasksSetAsidereports each one set aside. SqliteQueueLeaseopens a connection only for each check or change, so a Workmanager job that never closes it leaves nothing open.close()is now optional.
1.1.0 #
- Keeps queue state next to the tasks (
QueueStateStorage), so rate limits still hold after the app restarts or a background job opens the queue. The values live in the existing metadata table; the schema is unchanged. SqliteQueueLease: aQueueLeasekept in the queue's database, fordurable_queue_workmanager. Each check and change is one SQLite transaction, so the app and a background job cannot both take it, and there is no lease file to manage.- Requires
durable_queue1.1.0 or later.
1.0.0 #
- First stable release, for
durable_queue1.0. No API changes from 0.2.2; breaking changes now wait for 2.0.
0.2.2 #
- Several connections to the same database file, for example the app and a
background isolate, can now write at the same time. Writes take the write
lock up front (
BEGIN IMMEDIATE) and wait for each other instead of failing withdatabase is locked. Inside a transaction the app already opened, writes still use a savepoint. - The busy timeout is set before the other settings, so opening a new file from two isolates at once waits instead of failing.
0.2.1 #
- Allow
durable_queue0.5.x (>=0.3.1 <0.6.0). No code or schema change.
0.2.0 #
- Web support.
SqliteQueueStorage.openWeb(name)runs SQLite as WebAssembly (sqlite3.wasmfrompackage:sqlite3) and stores the database in IndexedDB. Every write is flushed to IndexedDB before it completes, so queued tasks survive a page reload or a closed tab. - The package now compiles for the web. 0.1.0 imported
dart:ffiand broke web builds of any app that depended on it. SqliteQueueStorage.fromDatabaseaccepts anyCommonDatabase(native or web) and an optionalflushcallback.openandinMemorythrowUnsupportedErroron the web;openWebthrows it on native platforms.- Allow
durable_queue0.4.x (>=0.3.1 <0.5.0). 0.1.0 accepted only 0.3.x. - No schema change: databases written by 0.1.0 open unchanged.
0.1.0 #
- Initial release:
SqliteQueueStorage, aQueueStoragefordurable_queuebacked by SQLite throughpackage:sqlite33.x. - Tasks survive process death. Writes run in transactions; file databases use write-ahead logging with full synchronous writes.
- Every worker query (next ready task, next wake time, deduplication, dependents, groups, recovery batches, sequence) uses an index; tests check the query plans.
- Open a file (
SqliteQueueStorage.open), an in-memory database (SqliteQueueStorage.inMemory), or tables inside a database the app already uses (SqliteQueueStorage.fromDatabase, with a configurable table prefix). - Versioned schema: opening tables written by a newer release fails clearly instead of corrupting them.
- Passes the full
durable_queuestorage contract suite.