query
Run read-only SQL (DuckDB dialect) against the vault metadata index to filter, aggregate, and analyze notes, tags, frontmatter, and wiki-links.
Instructions
Run read-only SQL (DuckDB dialect; SELECT/WITH only) over the vault metadata index. The index is rebuilt from the files — it is never a source of truth.
Schema: notes(path, name, title, type, tags VARCHAR[], aliases VARCHAR[], date, status, frontmatter JSON, modified TIMESTAMP, size, body /* full note text — SELECT specific columns, not * /) links(source / path /, target / wiki-link name as written */)
Examples: SELECT type, count() FROM notes GROUP BY type ORDER BY 2 DESC SELECT path, title FROM notes WHERE list_contains(tags, 'memory') SELECT target, count() n FROM links GROUP BY target ORDER BY n DESC LIMIT 20 SELECT path, json_extract_string(frontmatter, '$.status') FROM notes WHERE type = 'projects'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||