Run SQL query
sql_queryRun read-only SQL queries against the SiYuan index to count blocks or filter by tag and attribute when other tools cannot. Only SELECT, WITH, and EXPLAIN statements are allowed.
Instructions
Run a read-only SQL query against the SiYuan index to answer questions the other tools cannot, e.g. counting blocks or filtering by tag/attribute. Main table: blocks (id, parent_id, root_id, box, path, hpath, type, subtype, content, tag, ial, created, updated). Only SELECT/WITH/EXPLAIN are allowed; results are capped at 64 rows by the kernel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stmt | Yes | A single read-only SQL statement. |