DQL (DataView Query Language) lets you query frontmatter metadata across your entire knowledge base. It is inspired by Obsidian Dataview but runs server-side against the SQLite metadata index.Documentation Index
Fetch the complete documentation index at: https://docs.kiwifs.com/llms.txt
Use this file to discover all available pages before exploring further.
Query modes
DQL supports four output modes.- TABLE returns tabular results with the fields you specify.
- LIST returns a flat list of matching page paths.
- COUNT returns the number of matching pages.
- DISTINCT returns unique values for a single field.
Clauses
| Clause | Description |
|---|---|
FROM "path/" | Scope the query to a directory. |
WHERE | Filter with boolean logic (AND, OR, NOT), comparison operators (=, !=, >, <, >=, <=), CONTAINS, and MATCHES (regex). |
SORT field ASC|DESC | Sort results by a field. |
GROUP BY field | Group results by a field. |
FLATTEN field | Expand array fields into multiple rows. |
LIMIT n | Cap the number of results. |
Implicit fields
Every page exposes these fields without any frontmatter:| Field | Description |
|---|---|
_path | File path relative to the knowledge base root. |
_updated | Last modified timestamp. |
_size | File size in bytes. |
_words | Word count of the page body. |
Expressions
DQL supports arithmetic, function calls, string interpolation, comparisons, and boolean logic insideWHERE and computed field definitions.
Built-in functions
DQL ships with 27 functions:Date and time
Date and time
now(), date(), duration(), days_since(), format()String
String
lower(), upper(), trim(), split(), join(), contains(), regextest()Math
Math
round(), floor(), ceil(), abs(), min(), max()Collection
Collection
len(), sum(), avg(), first(), last(), sort(), reverse(), unique()Metadata
Metadata
meta() — access implicit fields programmatically.CLI usage
Run a DQL query from the command line:REST API
Run a DQL query over HTTP:Aggregation
Use theaggregate command to group and summarize metadata:
count, avg, sum, min, max. You can group by any frontmatter field.
Computed views
A markdown file withkiwi-view: true in its frontmatter becomes a computed view. KiwiFS auto-refreshes the file body from a DQL query embedded in the frontmatter.
Computed frontmatter fields
You can define virtual fields in.kiwi/config.toml that are evaluated at index time. These fields are queryable like any other frontmatter field.
Computed fields are recalculated on every reindex. They do not modify your source files.