db-core
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTanStack 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 (, , ,
) re-export everything from plus framework-specific
hooks. In framework projects, import from the framework package directly.
is the exception -- import operators from separately.
@tanstack/react-db@tanstack/vue-db@tanstack/svelte-db@tanstack/solid-db@tanstack/db@tanstack/angular-db@tanstack/dbTanStack DB 是一个响应式客户端数据存储库。它可以从任意后端(REST API、同步引擎、本地存储)将数据加载到类型化集合中,通过差分数据流提供亚毫秒级的实时查询,并支持带自动回滚功能的即时乐观变更操作。
框架包(、、、)会重新导出的所有内容以及框架专属的钩子。在框架项目中,请直接从对应框架包导入。是例外——需单独从导入操作符。
@tanstack/react-db@tanstack/vue-db@tanstack/svelte-db@tanstack/solid-db@tanstack/db@tanstack/angular-db@tanstack/dbSub-Skills
子技能
| Need to... | Read |
|---|---|
| Create a collection, pick an adapter, add schema | db-core/collection-setup/SKILL.md |
| Query data with where, join, groupBy, select | db-core/live-queries/SKILL.md |
| Insert, update, delete with optimistic UI | db-core/mutations-optimistic/SKILL.md |
| Build a custom sync adapter | db-core/custom-adapter/SKILL.md |
| Persist collections to SQLite (offline cache) | db-core/persistence/SKILL.md |
| Preload collections in route loaders | meta-framework/SKILL.md |
| Add offline transaction queueing | offline/SKILL.md (in @tanstack/offline-transactions) |
For framework-specific hooks:
| Framework | Read |
|---|---|
| React | react-db/SKILL.md |
| Vue | vue-db/SKILL.md |
| Svelte | svelte-db/SKILL.md |
| Solid | solid-db/SKILL.md |
| Angular | angular-db/SKILL.md |
| 需要完成... | 阅读文档路径 |
|---|---|
| 创建集合、选择适配器、添加 schema | db-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中) |
针对框架专属钩子:
| 框架 | 阅读文档路径 |
|---|---|
| React | react-db/SKILL.md |
| Vue | vue-db/SKILL.md |
| Svelte | svelte-db/SKILL.md |
| Solid | solid-db/SKILL.md |
| Angular | angular-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.