A tiny SQLite companion for muya state management library (v0.0.5). Reactive, paginated, type-safe queries over SQLite tables that auto-sync on data mutation. Uses a push-driven subscription model: views update automatically when any part of the app calls set/delete/batchSet on the underlying table. Returns TanStack-style hook result (data, status, isLoading, isFetching, isStale, isError, error, hasNextPage, fetchNextPage, refetch). Optional global cache via cacheKey persists data and subscriptions across mount/unmount cycles. Built on useSyncExternalStore, concurrent-safe, no QueryClientProvider required. Requires muya >=2.5.8 and react >=18 <20.
npm install muya-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal runnable example: create a SQLite-backed reactive state, insert two rows, and render a paginated list that auto-updates on mutation.
Wrap the state creation in an async function or top-level await.
Install react@18 or react@19.
Use `import { useSqliteValue } from 'muya-sqlite'` instead.Always provide `key` option – the same field will be used as the document identifier.
No user action needed, but bear in mind double renders in dev.
Run `npm install muya muya-sqlite` or `bun add muya muya-sqlite`.
Use `import { createSqliteState } from 'muya-sqlite'`.Install react@18 or react@19: `npm install react@18`.