db-core

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TanStack DB — Core Concepts

TanStack DB — 核心概念

TanStack DB is a reactive client-side data store. It loads data into typed collections from any backend (REST APIs, sync engines, local storage), provides sub-millisecond live queries via differential dataflow, and supports instant optimistic mutations with automatic rollback.
Framework packages (
@tanstack/react-db
,
@tanstack/vue-db
,
@tanstack/svelte-db
,
@tanstack/solid-db
) re-export everything from
@tanstack/db
plus framework-specific hooks. In framework projects, import from the framework package directly.
@tanstack/angular-db
is the exception -- import operators from
@tanstack/db
separately.
TanStack DB 是一个响应式客户端数据存储库。它可以从任意后端(REST API、同步引擎、本地存储)将数据加载到类型化集合中,通过差分数据流提供亚毫秒级的实时查询,并支持带自动回滚功能的即时乐观变更操作。
框架包(
@tanstack/react-db
@tanstack/vue-db
@tanstack/svelte-db
@tanstack/solid-db
)会重新导出
@tanstack/db
的所有内容以及框架专属的钩子。在框架项目中,请直接从对应框架包导入。
@tanstack/angular-db
是例外——需单独从
@tanstack/db
导入操作符。

Sub-Skills

子技能

Need to...Read
Create a collection, pick an adapter, add schemadb-core/collection-setup/SKILL.md
Query data with where, join, groupBy, selectdb-core/live-queries/SKILL.md
Insert, update, delete with optimistic UIdb-core/mutations-optimistic/SKILL.md
Build a custom sync adapterdb-core/custom-adapter/SKILL.md
Persist collections to SQLite (offline cache)db-core/persistence/SKILL.md
Preload collections in route loadersmeta-framework/SKILL.md
Add offline transaction queueingoffline/SKILL.md (in @tanstack/offline-transactions)
For framework-specific hooks:
FrameworkRead
Reactreact-db/SKILL.md
Vuevue-db/SKILL.md
Sveltesvelte-db/SKILL.md
Solidsolid-db/SKILL.md
Angularangular-db/SKILL.md
需要完成...阅读文档路径
创建集合、选择适配器、添加 schemadb-core/collection-setup/SKILL.md
使用 where、join、groupBy、select 查询数据db-core/live-queries/SKILL.md
通过乐观 UI 实现插入、更新、删除操作db-core/mutations-optimistic/SKILL.md
构建自定义同步适配器db-core/custom-adapter/SKILL.md
将集合持久化到 SQLite(离线缓存)db-core/persistence/SKILL.md
在路由加载器中预加载集合meta-framework/SKILL.md
添加离线事务排队功能offline/SKILL.md(位于@tanstack/offline-transactions中)
针对框架专属钩子:
框架阅读文档路径
Reactreact-db/SKILL.md
Vuevue-db/SKILL.md
Sveltesvelte-db/SKILL.md
Solidsolid-db/SKILL.md
Angularangular-db/SKILL.md

Quick Decision Tree

快速决策树

  • Setting up for the first time? → db-core/collection-setup
  • Building queries on collection data? → db-core/live-queries
  • Writing data / handling optimistic state? → db-core/mutations-optimistic
  • Using React hooks? → react-db
  • Preloading in route loaders (Start, Next, Remix)? → meta-framework
  • Building an adapter for a new backend? → db-core/custom-adapter
  • Persisting collections to SQLite? → db-core/persistence
  • Need offline transaction persistence? → offline
  • 首次搭建?→ db-core/collection-setup
  • 基于集合数据构建查询?→ db-core/live-queries
  • 写入数据 / 处理乐观状态?→ db-core/mutations-optimistic
  • 使用 React 钩子?→ react-db
  • 在路由加载器中预加载(Start、Next、Remix)?→ meta-framework
  • 为新后端构建适配器?→ db-core/custom-adapter
  • 将集合持久化到 SQLite?→ db-core/persistence
  • 需要离线事务持久化?→ offline

Version

版本

Targets @tanstack/db v0.6.0.
目标版本:@tanstack/db v0.6.0.