tanstack-db

Installation
SKILL.md

TanStack DB

Use this skill when work touches TanStack DB: collections, live queries, optimistic mutations, sync engines, local persistence, offline queues, or moving a TanStack Query app onto DB.

Workflow

  1. Inspect the local DB shape before changing code:
    • Package versions for @tanstack/db, framework package (@tanstack/react-db), collection adapters, @tanstack/query-core, @tanstack/offline-transactions, @tanstack/react-router-with-db, React, and router.
    • Definition style: collectionOptions(...) descriptors with DbClient/DbProvider, or module-level createCollection(...) singletons.
    • Data source per collection: REST via Query, Electric, TrailBase, RxDB, PowerSync, local-only, localStorage, or custom sync.
    • Sync mode (eager, on-demand, progressive), mutation handlers, how each handler waits for sync-back, and whether SSR or offline is in scope.
  2. Refresh docs when versions or behavior matter. DB is beta and moves fast; start from source-map.md.
  3. For packages, DbClient, descriptors, getKey, schemas, sync modes, indexes, and lifecycle, use setup-collections.md.
  4. For per-backend setup (Query, Electric, TrailBase, RxDB, PowerSync, local collections, custom sync), use adapters.md.
  5. For the query builder, operators, joins, includes, aggregates, hooks, query identity, and performance, use live-queries.md.
  6. For insert/update/delete, handlers, createOptimisticAction, transactions, paced mutations, rollback, and errors, use mutations.md.
  7. For SQLite/IndexedDB persistence and @tanstack/offline-transactions, use persistence-offline.md.
  8. For SSR, hydration, TanStack Start, Next.js streaming, and testing, use ssr-testing.md.
  9. For "DB or plain Query?", incremental migration, deprecations, and breaking changes, use query-vs-db-migration.md.
Installs
2
GitHub Stars
3
First Seen
6 days ago