TanStack
New
TanStack Intent
Search...
K
Auto
Log In
Start
RC
Start
RC
Router
Router
Query
Query
Table
Table
DB
beta
DB
beta
AI
alpha
AI
alpha
Form
new
Form
new
Virtual
Virtual
Pacer
beta
Pacer
beta
Hotkeys
alpha
Hotkeys
alpha
Store
alpha
Store
alpha
Devtools
alpha
Devtools
alpha
CLI
alpha
CLI
alpha
Intent
alpha
Intent
alpha
More Libraries
More Libraries
Builder
Alpha
Builder
Alpha
Blog
Blog
Maintainers
Maintainers
Partners
Partners
Showcase
Showcase
Learn
NEW
Learn
NEW
Stats
Stats
YouTube
YouTube
Discord
Discord
Merch
Merch
Support
Support
GitHub
GitHub
Ethos
Ethos
Tenets
Tenets
Brand Guide
Brand Guide
TanStack Intent
/
Registry
/
@tanstack/db
@tanstack/db
0.6.2 (latest) — 7 skills
0.6.1 — 7 skills
0.6.0 — 6 skills
0.5.33 — 6 skills
0.5.32 — 6 skills
0.5.31 — 6 skills
0.5.30 — 0 skills
0.5.29 — 0 skills
0.5.28 — 0 skills
0.5.27 — 0 skills
0.5.26 — 0 skills
0.5.25 — 0 skills
0.5.24 — 0 skills
0.5.23 — 0 skills
0.5.22 — 0 skills
0.5.21 — 0 skills
0.5.20 — 0 skills
0.5.19 — 0 skills
0.5.18 — 0 skills
0.5.17 — 0 skills
0.5.16 — 0 skills
0.5.15 — 0 skills
0.5.14 — 0 skills
0.5.13 — 0 skills
0.5.12 — 0 skills
0.5.11 — 0 skills
0.5.10 — 0 skills
0.5.9 — 0 skills
0.5.8 — 0 skills
0.5.7 — 0 skills
0.5.6 — 0 skills
Copy install prompt
A reactive client store for building super fast apps on sync
Skills
(7)
Skills
All Skills
7
db-core
core
db-core/collection-setup
sub-skill
db-core/custom-adapter
sub-skill
db-core/live-queries
sub-skill
db-core/mutations-optimistic
sub-skill
db-core/persistence
sub-skill
meta-framework
composition
Skills
7
History
db-core
core
TanStack DB core concepts: createCollection with queryCollectionOptions, electricCollectionOptions, powerSyncCollectionOptions, rxdbCollectionOptions, trailbaseCollectionOptions, localOnlyCollectionOptions. Live queries via query builder (from, where, join, select, groupBy, orderBy, limit). Optimistic mutations with draft proxy (collection.insert, collection.update, collection.delete). createOptimisticAction, createTransaction, createPacedMutations. Entry point for all TanStack DB skills.
64 lines
db-core/collection-setup
sub-skill
Creating typed collections with createCollection. Adapter selection: queryCollectionOptions (REST/TanStack Query), electricCollectionOptions (ElectricSQL real-time sync), powerSyncCollectionOptions (PowerSync SQLite), rxdbCollectionOptions (RxDB), trailbaseCollectionOptions (TrailBase), localOnlyCollectionOptions, localStorageCollectionOptions. CollectionConfig options: getKey, schema, sync, gcTime, autoIndex (default off), defaultIndexType, syncMode (eager/on-demand, plus progressive for Electric). StandardSchema validation with Zod/Valibot/ArkType. Collection lifecycle (idle/loading/ready/error). Adapter-specific sync patterns including Electric txid tracking, Query direct writes, and PowerSync query-driven sync with onLoad/onLoadSubset hooks.
447 lines
db-core/custom-adapter
sub-skill
Building custom collection adapters for new backends. SyncConfig interface: sync function receiving begin, write, commit, markReady, truncate, metadata primitives. ChangeMessage format (insert, update, delete). loadSubset for on-demand sync. LoadSubsetOptions (where, orderBy, limit, cursor). Expression parsing: parseWhereExpression, parseOrderByExpression, extractSimpleComparisons, parseLoadSubsetOptions. Collection options creator pattern. rowUpdateMode (partial vs full). Subscription lifecycle and cleanup functions. Persisted sync metadata API (metadata.row and metadata.collection) for storing per-row and per-collection adapter state.
335 lines
db-core/live-queries
sub-skill
Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin, fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct, findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull, isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String functions: upper, lower, length, concat, coalesce. Math: add. $selected namespace. createLiveQueryCollection. Derived collections. Predicate push-down. Incremental view maintenance via differential dataflow (d2ts). Virtual properties ($synced, $origin, $key, $collectionId). Includes subqueries for hierarchical data. toArray and concat(toArray(...)) scalar includes. queryOnce for one-shot queries. createEffect for reactive side effects (onEnter, onUpdate, onExit, onBatch).
493 lines
db-core/mutations-optimistic
sub-skill
collection.insert, collection.update (Immer-style draft proxy), collection.delete. createOptimisticAction (onMutate + mutationFn). createPacedMutations with debounceStrategy, throttleStrategy, queueStrategy. createTransaction, getActiveTransaction, ambient transaction context. Transaction lifecycle (pending/persisting/completed/failed). Mutation merging. onInsert/onUpdate/onDelete handlers. PendingMutation type. Transaction.isPersisted.
376 lines
db-core/persistence
sub-skill
SQLite-backed persistence for TanStack DB collections. persistedCollectionOptions wraps any adapter (Electric, Query, PowerSync, or local-only) with durable local storage. Platform adapters: browser (WA-SQLite OPFS), React Native (op-sqlite), Expo (expo-sqlite), Electron (IPC), Node (better-sqlite3), Capacitor, Tauri, Cloudflare Durable Objects. Multi-tab/multi-process coordination via BrowserCollectionCoordinator / ElectronCollectionCoordinator / SingleProcessCoordinator. schemaVersion for migration resets. Local-only mode for offline-first without a server.
242 lines
meta-framework
composition
Integrating TanStack DB with meta-frameworks (TanStack Start, Next.js, Remix, Nuxt, SvelteKit). Client-side only: SSR is NOT supported — routes must disable SSR. Preloading collections in route loaders with collection.preload(). Pattern: ssr: false + await collection.preload() in loader. Multiple collection preloading with Promise.all. Framework-specific loader APIs.
362 lines