cratestack-client-store-sqlite
SQLite-backed state store for client-side persistence.
Overview
cratestack-client-store-sqlite provides a SQLite implementation of ClientStateStore for persisting request journals on device, suitable for desktop and mobile applications.
Installation
[]
= "0.2"
Usage
use SqliteStateStore;
use ;
use Arc;
let store = new;
let client = new.with_state_store;
// Requests are journaled to SQLite
let result = client.post.await?;
Features
- Bundled SQLite: Works out of the box with
rusqlitebundled feature - Automatic Migration: Tables created on first use
- Thread-Safe: Concurrent access via internal mutex
Storage Schema
(
id TEXT PRIMARY KEY,
path TEXT NOT NULL,
method TEXT NOT NULL,
body BLOB,
status_code INTEGER,
created_at TEXT NOT NULL
);
Use Cases
- Desktop Applications: Persist state for desktop clients
- Offline-First Apps: Queue mutations when offline
- Single-Device State: Local-only persistence without server dependency
See Also
cratestack-client-store-redis- Redis-backed store (multi-instance)cratestack-client-rust- Client runtime
License
MIT