Tanstack Db
Tanstack DB provides a performant, serverless SQL database solution for React apps, simplifying data management and boosting application speed.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add tanstack-db npx -- -y @trustedskills/tanstack-db
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"tanstack-db": {
"command": "npx",
"args": [
"-y",
"@trustedskills/tanstack-db"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
TanStack DB is a client-side, reactive store built on differential dataflow that extends TanStack Query. It provides collections, live queries, and optimistic mutations for managing local data in React applications. It normalizes data into typed collections, enabling fast cross-collection queries (sub-millisecond) and instant optimistic updates with automatic rollback if those updates fail.
When to use it
- When building reactive user interfaces that require local-first data management.
- For performing complex cross-collection joins with live, updating results.
- To implement optimistic mutations with automatic synchronization.
- If you need real-time data synchronization using ElectricSQL or similar backends.
- When your application's data complexity outgrows the per-query caching capabilities of TanStack Query alone.
Key capabilities
- Collection Creation: Define typed sets of objects with a unique
getKeyidentifier. - Live Queries: Automatically update when underlying data changes using
useLiveQuery. - Filtering: Supports various filter operators like
eq,gt,lt,like,and,or, andnot. - Field Selection: Project specific fields from collections.
- Ordering: Sort results in ascending or descending order.
- Joins: Perform cross-collection joins with type safety.
- Grouping & Aggregation: Group data and perform aggregations (count, sum, avg, min, max).
- Optimistic Mutations: Insert, update, and delete records optimistically with automatic synchronization using
onInsert,onUpdate, andonDeletehandlers. - Real-time Sync: Synchronize data in real-time via ElectricSQL.
- Sync Modes: Choose from Eager (full load), On-demand (predicate pushdown), or Progressive loading strategies.
Example prompts
Here are some examples of how you might interact with an AI agent using the TanStack DB skill:
- "Create a collection for 'products' with
getKeybased on product ID." - "Show me a live query that fetches all active users ordered by their registration date."
- "How do I perform an optimistic update to increase the quantity of a specific item in my cart?"
Tips & gotchas
- Beta Status: TanStack DB is currently in beta, and APIs may change between releases.
getKeyRequirement: Always provide agetKeyfunction when creating collections to uniquely identify items.- Not for Simple Data: TanStack Query alone is sufficient for simple fetch-and-display scenarios.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.