An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:memo: Correct database item ID documentation https://github.com/siyuan-note/siyuan/issues/18468
Danielc29e6e5b00b7
diff --git a/docs/API.ja.md b/docs/API.ja.mdindex ffb45e17f8..bd77d6a9aa 100644--- a/docs/API.ja.md+++ b/docs/API.ja.md@@ -1818,9 +1818,10 @@}```- * `data.view`: レンダリングされたビューインスタンス。形状は `viewType` により異なります——`table` は `columns`/`rows`/`rowCount`、`gallery` は `columns`/`rows`、`kanban` は `columns`/`groups`(各グループ自体が `groupKey`/`groupValue` を持つビューインスタンス)を返します。`view` は `filters`/`sorts`/`group`/`showIcon`/`wrapField`/`groupFolded`/`groupHidden` も含みます。注意:有効なフィルター/グループ化により、`rowCount` > 0 でも `rows` が空になることがあります+ * `data.view`: レンダリングされたビューインスタンス。構造は `viewType` により異なります。`table` は `columns`/`rows`/`rowCount` を、`gallery` と `kanban` は `fields`/`cards`/`cardCount` を返します。グループ化が有効な場合、`groups` には `groupKey`/`groupValue` を持つグループごとのビューインスタンスが含まれます。`view` は `filters`/`sorts`/`group`/`showIcon`/`wrapField`/`groupFolded`/`groupHidden` も含みます。注意:有効なフィルターまたはグループ化により、アイテムの総数が 0 より大きくてもアイテムリストが空になることがあります* `data.view.columns[]`: 各列は `id`/`name`/`type`/`icon`/`wrap`/`hidden`/`desc`/`calc`/`numberFormat`/`template`/`pin`/`width` を持ちます;`select`/`mSelect` 列はさらに `options` を含みます- * `data.view.rows[].id`: **行 ID**(アイテム ID)。紐づく行の場合は紐づくブロック ID と同じです;独立行の場合は生成されたアイテム ID で、いかなるブロックとも異なります+ * `data.view.rows[].id`: 表形式の行の**アイテム ID**(`itemID`)です。その行の主キーセルにある `value.blockID` とも同じです。紐づく行の場合、紐づくブロック ID は主キーセルの `value.block.id` にあります。両者は異なる概念であり、同一であると仮定してはいけません+ * `data.view.cards[].id`: ギャラリーまたはカンバンのカードの**アイテム ID**(`itemID`)です。グループ化が有効な場合、表形式の行またはカードは `groups[]` 内の対応するビューインスタンスにあります* `data.view.rows[].cells[].value`: `Value` オブジェクト——すべての value 形状は [セル値を設定](#セル値を設定) を参照。`createdAt`/`updatedAt` は int64 ミリ秒タイムスタンプ* `data.views`: 全ビューのメタデータ(行データなし)* `data.isMirror`: データベースブロックがデータベースのミラー(読み取り専用コピー)の場合 `true`@@ -2051,7 +2052,7 @@| `phone` | `{"phone": {"content": "1234567890"}}` || `checkbox` | `{"checkbox": {"checked": true}}` |-> ⚠️ `itemID` は**行 ID**([レンダリング](#レンダリング) が返す `rows[].id`)です。紐づく行の場合は行 ID は紐づくブロック ID と等しく、独立行の場合は生成されたアイテム ID です。誤った ID を渡すと、値はレンダリングされたセルに現れない孤立データとして保存されます。+> ⚠️ `itemID` は**アイテム ID**、つまり[レンダリング](#レンダリング)が返すアイテムの `id` です。表形式では `rows[].id`、ギャラリーとカンバンでは `cards[].id` であり、グループ化が有効な場合は `groups[]` 内の対応するビューインスタンスにあります。また、主キー値の `value.blockID` とも同じです。紐づくアイテムの場合、紐づくブロック ID は主キー値の `value.block.id` にあります。両者は異なる概念であり、同一であると仮定してはいけません。誤った ID を渡すと、値はレンダリングされたセルに現れない孤立データとして保存されます。* `/api/av/setAttributeViewBlockAttr`* パラメータdiff --git a/docs/API.md b/docs/API.mdindex e5d6bf505f..0a16d5461e 100644--- a/docs/API.md+++ b/docs/API.md@@ -1826,9 +1826,10 @@ The field types (`keyType`) are:}```- * `data.view`: The rendered viewable instance. Shape depends on `viewType` — `table` returns `columns`/`rows`/`rowCount`, `gallery` returns `columns`/`rows`, `kanban` returns `columns`/`groups` (each group is itself a view instance with `groupKey`/`groupValue`). `view` also carries `filters`, `sorts`, `group`, `showIcon`, `wrapField`, `groupFolded`, `groupHidden`. Note: active filters/grouping can make `rows` empty even when `rowCount` > 0+ * `data.view`: The rendered view instance. Its shape depends on `viewType`: `table` returns `columns`/`rows`/`rowCount`, while `gallery` and `kanban` return `fields`/`cards`/`cardCount`. When grouping is enabled, `groups` contains a view instance for each group, including `groupKey`/`groupValue`. `view` also carries `filters`, `sorts`, `group`, `showIcon`, `wrapField`, `groupFolded`, and `groupHidden`. Note: active filters or grouping can make the item list empty even when the total item count is greater than 0* `data.view.columns[]`: Each has `id`, `name`, `type`, `icon`, `wrap`, `hidden`, `desc`, `calc`, `numberFormat`, `template`, `pin`, `width`; `select`/`mSelect` columns additionally carry `options`- * `data.view.rows[].id`: The **row ID** (an item ID). For a bound row this is the same as the bound block ID; for a detached row it is a generated item ID distinct from any block+ * `data.view.rows[].id`: The table row's **item ID** (`itemID`). It also equals `value.blockID` in that row's primary-key cell. For a bound row, the bound block ID is stored in `value.block.id` in the primary-key cell; these are distinct concepts and must not be assumed equal+ * `data.view.cards[].id`: The **item ID** (`itemID`) of a gallery or kanban card. When grouping is enabled, table rows or cards are in the corresponding view instances under `groups[]`* `data.view.rows[].cells[].value`: A `Value` object — see [Set a cell value](#Set-a-cell-value) for all value shapes. `createdAt`/`updatedAt` are int64 millisecond timestamps* `data.views`: Metadata of every view (no rows)* `data.isMirror`: `true` when the database block is a mirror (read-only copy) of the database@@ -2060,7 +2061,7 @@ Updates a single cell (one field of one row). This is the primary write endpoint| `mAsset` | `{"mAsset": [{"type": "image", "name": "", "content": "https://example.com/image"}]}` || `checkbox` | `{"checkbox": {"checked": true}}` |-> ⚠️ `itemID` is the **row ID** (`rows[].id` from [Render](#Render)). For a bound row the row ID equals the bound block ID; for a detached row it is a generated item ID. Passing the wrong ID stores the value as an orphan that does not appear in the rendered cell.+> ⚠️ `itemID` is the **item ID**, which is the rendered item's `id` from [Render](#Render): `rows[].id` for a table and `cards[].id` for a gallery or kanban, inside the corresponding view instance under `groups[]` when grouping is enabled. It also equals the primary-key value's `value.blockID`. For a bound item, the bound block ID is stored in the primary-key value's `value.block.id`; these are distinct concepts and must not be assumed equal. Passing the wrong ID stores the value as an orphan that does not appear in the rendered cell.For `mAsset`, each item uses `type: "image"` to render an image or `type: "file"` to render a file link. Updating the value replaces the entire `mAsset` array, so append operations must include the existing items.diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.mdindex 50b3842e84..ece755df27 100644--- a/docs/API.zh-CN.md+++ b/docs/API.zh-CN.md@@ -1818,9 +1818,10 @@}```- * `data.view`: 渲染后的视图实例。结构随 `viewType` 而变——`table` 返回 `columns`/`rows`/`rowCount`,`gallery` 返回 `columns`/`rows`,`kanban` 返回 `columns`/`groups`(每个分组本身也是视图实例,含 `groupKey`/`groupValue`)。`view` 还包含 `filters`/`sorts`/`group`/`showIcon`/`wrapField`/`groupFolded`/`groupHidden`。注意:启用的过滤/分组可能使 `rows` 为空,即使 `rowCount` > 0+ * `data.view`: 渲染后的视图实例。结构随 `viewType` 而变:`table` 返回 `columns`/`rows`/`rowCount`,`gallery` 和 `kanban` 返回 `fields`/`cards`/`cardCount`。启用分组时,`groups` 包含各分组的视图实例,每个实例含 `groupKey`/`groupValue`。`view` 还包含 `filters`/`sorts`/`group`/`showIcon`/`wrapField`/`groupFolded`/`groupHidden`。注意:启用的过滤或分组可能使条目列表为空,即使条目总数大于 0* `data.view.columns[]`: 每列含 `id`/`name`/`type`/`icon`/`wrap`/`hidden`/`desc`/`calc`/`numberFormat`/`template`/`pin`/`width`;`select`/`mSelect` 列还额外包含 `options`- * `data.view.rows[].id`: **行 ID**(一个条目 ID)。对于绑定行,它等于绑定的块 ID;对于独立行,它是生成的条目 ID,与任何块都不同+ * `data.view.rows[].id`: 表格行的**条目 ID**(`itemID`),也等于该行主键单元格的 `value.blockID`。对于绑定行,绑定块 ID 位于主键单元格的 `value.block.id`;二者是不同概念,不能假设相等+ * `data.view.cards[].id`: 卡片或看板卡片的**条目 ID**(`itemID`)。启用分组时,表格行或卡片位于 `groups[]` 的对应视图实例中* `data.view.rows[].cells[].value`: 一个 `Value` 对象——所有 value 形态见 [设置单元格值](#设置单元格值)。`createdAt`/`updatedAt` 为 int64 毫秒时间戳* `data.views`: 所有视图的元数据(不含行数据)* `data.isMirror`: 当数据库块为数据库的镜像(只读副本)时为 `true`@@ -2051,7 +2052,7 @@| `phone` | `{"phone": {"content": "1234567890"}}` || `checkbox` | `{"checkbox": {"checked": true}}` |-> ⚠️ `itemID` 是**行 ID**([渲染](#渲染) 返回的 `rows[].id`)。对于绑定行,行 ID 等于绑定的块 ID;对于独立行,它是生成的条目 ID。传入错误的 ID 会把值存为孤儿数据,不会出现在渲染后的单元格中。+> ⚠️ `itemID` 是**条目 ID**,即[渲染](#渲染)返回的条目 `id`:表格为 `rows[].id`,卡片和看板为 `cards[].id`,启用分组时位于 `groups[]` 的对应视图实例中。它也等于主键值的 `value.blockID`。对于绑定条目,绑定块 ID 位于主键值的 `value.block.id`;二者是不同概念,不能假设相等。传入错误的 ID 会把值存为孤儿数据,不会出现在渲染后的单元格中。* `/api/av/setAttributeViewBlockAttr`* 参数