Tanstack Db

🌐Community
by oakoss · vlatest · Repository

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.

1

Run in terminal (recommended)

terminal
claude mcp add tanstack-db npx -- -y @trustedskills/tanstack-db
2

Or manually add to ~/.claude/settings.json

~/.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 getKey identifier.
  • Live Queries: Automatically update when underlying data changes using useLiveQuery.
  • Filtering: Supports various filter operators like eq, gt, lt, like, and, or, and not.
  • 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, and onDelete handlers.
  • 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 getKey based 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.
  • getKey Requirement: Always provide a getKey function 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 HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
oakoss
Installs
29

🌐 Community

Passed automated security scans.