db-core/live-queries

Creates live query collections with incremental updates for TanStack DB.

3.9k|254|Updated Mar 11, 2025
One-click install
npx skills add https://github.com/TanStack/db --skill db-core-live-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-core/live-queries
Source: https://github.com/TanStack/db/tree/main/packages/db/skills/db-core/live-queries
Command: npx skills add https://github.com/TanStack/db --skill db-core-live-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TanStack DB live queries enable building reactive derived data views that automatically update when underlying data changes, removing the need for manual refreshes and complex state synchronization.

Core Features & Use Cases

  • Fluent, SQL-like queries that produce live collections with incremental maintenance
  • Support for from, joins, groupBy, having, orderBy, limit, and derived collections as sources for composable data flows
  • Ideal for UI bindings, dashboards, and real-time analytics where data freshness matters

Quick Start

Define a live query with createLiveQueryCollection and consume the reactive results.

Frequently Asked Questions about db-core/live-queries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create reactive live queries that update automatically when data changes?

Reactive live queries use incremental maintenance via differential dataflow to automatically update derived collections when underlying data changes, removing the need for manual refreshes and complex state synchronization in TypeScript applications.

What SQL-like operations are supported for building incremental derived collections?

Incremental derived collections support fluent SQL-like operations including from, joins, groupBy, having, orderBy, and limit, along with utilities like eq, inArray, and aggregate functions for composable data flows.

Can I use a derived collection as a source for another live query in TanStack DB?

Yes, derived collections can serve as sources for other live queries, enabling composable data flows where reactive output from one query feeds into another for layered incremental processing.

When do I need incremental live queries instead of manual refreshes for dashboards?

Incremental live queries are needed for real-time dashboards, UI bindings, and analytics where data freshness matters, ensuring views stay current without manual refreshes or complex state synchronization.

Does TanStack DB live queries work with TypeScript for real-time UI bindings?

TanStack DB live queries are designed for TypeScript and support real-time UI bindings by producing live collections that automatically reflect underlying data changes through incremental maintenance.

What are the limitations of using incremental maintenance with differential dataflow for live queries?

Incremental maintenance via differential dataflow handles from, join, groupBy, having, orderBy, and limit operations, but complex query compositions may require careful structuring of derived collection sources to ensure proper reactivity.