tanstack-db-playbook-tanstack-db-collections

Installation
SKILL.md

Collections

Collections are typed data stores that decouple data loading from data binding. They can be populated from REST APIs, sync engines, or local storage, then queried uniformly with live queries.

Collection Types

Type Package Use Case
QueryCollection @tanstack/query-db-collection REST APIs via TanStack Query
ElectricCollection @tanstack/electric-db-collection Real-time Postgres sync via Electric
PowerSyncCollection @tanstack/powersync-db-collection Offline-first with PowerSync
RxDBCollection @tanstack/rxdb-db-collection RxDB local persistence
TrailBaseCollection @tanstack/trailbase-db-collection TrailBase real-time backend
LocalStorageCollection @tanstack/db Browser localStorage persistence
LocalOnlyCollection @tanstack/db In-memory state (no persistence)

Common Patterns

QueryCollection (REST APIs)

Installs
2
First Seen
Aug 10, 2026