SiYuan icon

SiYuan

Manage SiYuan notebooks, documents, blocks, attributes, and more. Designed for AI agent workflows.

Database → Get

AI-generated

Summary

Fetches every row and the schema for a SiYuan database (AttributeView), then optionally filters rows client-side. Choose split output for one item per matching row or single output to retain the schema and a rowCount, including when no rows match.

Inputs

  • AV ID (required) — AttributeView ID from the database block’s data-av-ID attribute; this is not the block ID. Use Database → List to find it.
  • Output Mode — Split returns flat row items keyed by column display names, with _rowId and _avId. Single returns one item containing the database metadata, columns, filtered rows, and rowCount. Use Single for existence checks because Split emits no items when there are no matches.
  • Filter (JSON) — Optional JSON object matched against flat row values. Scalar values require equality; arrays match any listed value within that column. Conditions across different keys combine with AND. Filtering occurs after the database rows are fetched.

Output shape

Either one item per matching row or one item containing database metadata and filtered rows, depending on Output Mode.

Split row items include column display-name keys plus _rowId and _avId. Single includes id, name, viewID, viewType, columns, rows, and rowCount. The operation fetches all rows, paging as needed, before applying the filter.

Links

Discussion