datanotes 2.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/NOTICE +9 -0
  2. package/README.md +203 -28
  3. package/SECURITY.md +92 -45
  4. package/dist/THIRD-PARTY-NOTICES.txt +682 -0
  5. package/dist/api/catalog.d.cts +69 -0
  6. package/dist/api/catalog.d.ts +50 -2
  7. package/dist/api/cli-options.d.cts +39 -0
  8. package/dist/api/cli-options.d.ts +39 -0
  9. package/dist/api/client.d.cts +122 -0
  10. package/dist/api/client.d.ts +56 -34
  11. package/dist/api/docs.d.cts +211 -0
  12. package/dist/api/docs.d.ts +211 -0
  13. package/dist/api/guidance.d.cts +81 -0
  14. package/dist/api/guidance.d.ts +81 -0
  15. package/dist/api/index.cjs +7470 -2771
  16. package/dist/api/index.d.cts +14 -0
  17. package/dist/api/index.d.ts +11 -7
  18. package/dist/api/index.js +7470 -2771
  19. package/dist/api/local.cjs +118 -6
  20. package/dist/api/local.d.cts +95 -0
  21. package/dist/api/local.d.ts +70 -6
  22. package/dist/api/local.js +104 -6
  23. package/dist/api/mcp.cjs +17387 -0
  24. package/dist/api/mcp.d.cts +108 -0
  25. package/dist/api/mcp.d.ts +108 -0
  26. package/dist/api/mcp.js +17337 -0
  27. package/dist/api/otlp.d.cts +113 -0
  28. package/dist/api/otlp.d.ts +63 -15
  29. package/dist/api/redact.d.cts +42 -0
  30. package/dist/api/redact.d.ts +42 -0
  31. package/dist/api/requests.d.cts +26 -0
  32. package/dist/api/requests.d.ts +14 -16
  33. package/dist/api/results.d.cts +16 -0
  34. package/dist/api/results.d.ts +2 -1
  35. package/dist/api/tokens.d.cts +12 -0
  36. package/dist/api/tokens.d.ts +5 -0
  37. package/dist/api/tracing.d.cts +107 -0
  38. package/dist/api/tracing.d.ts +107 -0
  39. package/dist/datanotes.cjs +69597 -28329
  40. package/dist/docs/administration/configuration.md +59 -0
  41. package/dist/docs/administration/docker.md +80 -0
  42. package/dist/docs/administration/git-sync.md +71 -0
  43. package/dist/docs/administration/limits.md +153 -0
  44. package/dist/docs/administration/run-the-service.md +237 -0
  45. package/dist/docs/administration/status.md +61 -0
  46. package/dist/docs/administration/use-with-obsidian.md +75 -0
  47. package/dist/docs/api/operations/add_column.md +49 -0
  48. package/dist/docs/api/operations/add_constraint.md +55 -0
  49. package/dist/docs/api/operations/adopt_rows.md +50 -0
  50. package/dist/docs/api/operations/align_relations.md +41 -0
  51. package/dist/docs/api/operations/alter_column.md +46 -0
  52. package/dist/docs/api/operations/alter_table.md +67 -0
  53. package/dist/docs/api/operations/batch.md +48 -0
  54. package/dist/docs/api/operations/changes_stream.md +28 -0
  55. package/dist/docs/api/operations/check_table.md +29 -0
  56. package/dist/docs/api/operations/clone_table.md +48 -0
  57. package/dist/docs/api/operations/comment_on.md +42 -0
  58. package/dist/docs/api/operations/configure_database.md +52 -0
  59. package/dist/docs/api/operations/create_table.md +78 -0
  60. package/dist/docs/api/operations/create_view.md +54 -0
  61. package/dist/docs/api/operations/create_webhook.md +37 -0
  62. package/dist/docs/api/operations/define_base.md +52 -0
  63. package/dist/docs/api/operations/delete_rows.md +43 -0
  64. package/dist/docs/api/operations/delete_webhook.md +31 -0
  65. package/dist/docs/api/operations/describe_database.md +30 -0
  66. package/dist/docs/api/operations/describe_history.md +40 -0
  67. package/dist/docs/api/operations/describe_semantic_index.md +24 -0
  68. package/dist/docs/api/operations/describe_table.md +38 -0
  69. package/dist/docs/api/operations/docs.md +13 -0
  70. package/dist/docs/api/operations/drop_column.md +41 -0
  71. package/dist/docs/api/operations/drop_constraint.md +39 -0
  72. package/dist/docs/api/operations/drop_table.md +43 -0
  73. package/dist/docs/api/operations/drop_view.md +38 -0
  74. package/dist/docs/api/operations/engine_status.md +23 -0
  75. package/dist/docs/api/operations/graph_neighbors.md +34 -0
  76. package/dist/docs/api/operations/graph_path.md +32 -0
  77. package/dist/docs/api/operations/graph_traverse.md +43 -0
  78. package/dist/docs/api/operations/identify_session.md +24 -0
  79. package/dist/docs/api/operations/infer_table.md +43 -0
  80. package/dist/docs/api/operations/insert_row.md +48 -0
  81. package/dist/docs/api/operations/list_changes.md +35 -0
  82. package/dist/docs/api/operations/list_folder.md +28 -0
  83. package/dist/docs/api/operations/list_link_targets.md +44 -0
  84. package/dist/docs/api/operations/list_migrations.md +35 -0
  85. package/dist/docs/api/operations/list_tables.md +32 -0
  86. package/dist/docs/api/operations/list_webhooks.md +23 -0
  87. package/dist/docs/api/operations/manual_index.md +14 -0
  88. package/dist/docs/api/operations/manual_page.md +22 -0
  89. package/dist/docs/api/operations/merge_rows.md +44 -0
  90. package/dist/docs/api/operations/move_rows.md +52 -0
  91. package/dist/docs/api/operations/openapi.md +13 -0
  92. package/dist/docs/api/operations/openapi_post.md +20 -0
  93. package/dist/docs/api/operations/read_note.md +29 -0
  94. package/dist/docs/api/operations/recompute_columns.md +44 -0
  95. package/dist/docs/api/operations/record_tool_call.md +37 -0
  96. package/dist/docs/api/operations/rename_column.md +44 -0
  97. package/dist/docs/api/operations/rename_value.md +45 -0
  98. package/dist/docs/api/operations/restore_database.md +51 -0
  99. package/dist/docs/api/operations/restore_table.md +46 -0
  100. package/dist/docs/api/operations/search_notes.md +28 -0
  101. package/dist/docs/api/operations/select_rows.md +61 -0
  102. package/dist/docs/api/operations/semantic_search.md +34 -0
  103. package/dist/docs/api/operations/semantic_search_docs.md +26 -0
  104. package/dist/docs/api/operations/set_table_bases.md +44 -0
  105. package/dist/docs/api/operations/status.md +13 -0
  106. package/dist/docs/api/operations/stop_engine.md +23 -0
  107. package/dist/docs/api/operations/sync_semantic_index.md +33 -0
  108. package/dist/docs/api/operations/table_changes.md +31 -0
  109. package/dist/docs/api/operations/tags/auxiliary.md +14 -0
  110. package/dist/docs/api/operations/tags/change-feed.md +8 -0
  111. package/dist/docs/api/operations/tags/history.md +17 -0
  112. package/dist/docs/api/operations/tags/queries.md +15 -0
  113. package/dist/docs/api/operations/tags/rows-dml.md +16 -0
  114. package/dist/docs/api/operations/tags/schema-ddl.md +22 -0
  115. package/dist/docs/api/operations/tags/service.md +15 -0
  116. package/dist/docs/api/operations/tags/tokens.md +13 -0
  117. package/dist/docs/api/operations/tokens_create.md +34 -0
  118. package/dist/docs/api/operations/tokens_delete.md +29 -0
  119. package/dist/docs/api/operations/tokens_list.md +21 -0
  120. package/dist/docs/api/operations/tokens_me.md +20 -0
  121. package/dist/docs/api/operations/tokens_rotate.md +29 -0
  122. package/dist/docs/api/operations/tokens_update.md +34 -0
  123. package/dist/docs/api/operations/undo_migration.md +46 -0
  124. package/dist/docs/api/operations/update_row.md +60 -0
  125. package/dist/docs/api/operations/update_rows.md +46 -0
  126. package/dist/docs/api/operations/vacuum_table.md +37 -0
  127. package/dist/docs/api.md +135 -0
  128. package/dist/docs/develop/build-an-app.md +320 -0
  129. package/dist/docs/develop/build-on-datanotes.md +138 -0
  130. package/dist/docs/develop/change-feed-and-webhooks.md +70 -0
  131. package/dist/docs/develop/client.md +116 -0
  132. package/dist/docs/develop/concurrency.md +188 -0
  133. package/dist/docs/develop/http-api.md +89 -0
  134. package/dist/docs/develop/telemetry.md +285 -0
  135. package/dist/docs/guides/agents/docs-offline.md +99 -0
  136. package/dist/docs/guides/agents/how-agents-use-datanotes.md +124 -0
  137. package/dist/docs/guides/agents/prompts.md +495 -0
  138. package/dist/docs/guides/agents/reading-errors.md +112 -0
  139. package/dist/docs/guides/data-quality/check-constraints.md +379 -0
  140. package/dist/docs/guides/data-quality/check-table.md +63 -0
  141. package/dist/docs/guides/data-quality/hand-edits.md +507 -0
  142. package/dist/docs/guides/data-quality/sync-between-devices.md +51 -0
  143. package/dist/docs/guides/data-quality/validation.md +90 -0
  144. package/dist/docs/guides/database-objects/bases.md +480 -0
  145. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +897 -0
  146. package/dist/docs/guides/database-objects/columns.md +1332 -0
  147. package/dist/docs/guides/database-objects/relations.md +1454 -0
  148. package/dist/docs/guides/database-objects/tables.md +1340 -0
  149. package/dist/docs/guides/database-objects/views.md +1003 -0
  150. package/dist/docs/guides/history/back-up.md +203 -0
  151. package/dist/docs/guides/history/change-data-feed.md +247 -0
  152. package/dist/docs/guides/history/journal-and-undo.md +262 -0
  153. package/dist/docs/guides/history/restore.md +341 -0
  154. package/dist/docs/guides/history/table-history.md +657 -0
  155. package/dist/docs/guides/history/vacuum.md +26 -0
  156. package/dist/docs/guides/read-and-write/automatic-links.md +768 -0
  157. package/dist/docs/guides/read-and-write/batch.md +139 -0
  158. package/dist/docs/guides/read-and-write/import-notes.md +896 -0
  159. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +251 -0
  160. package/dist/docs/guides/read-and-write/read-and-filter.md +536 -0
  161. package/dist/docs/guides/read-and-write/write-rows.md +573 -0
  162. package/dist/docs/guides/search/link-graph.md +241 -0
  163. package/dist/docs/guides/search/semantic.md +133 -0
  164. package/dist/docs/guides/search/text.md +142 -0
  165. package/dist/docs/guides/security/security-model.md +110 -0
  166. package/dist/docs/guides/security/tokens.md +60 -0
  167. package/dist/docs/guides/security/who-did-what.md +44 -0
  168. package/dist/docs/index.md +113 -0
  169. package/dist/docs/llms.txt +33 -0
  170. package/dist/docs/reference/cli.md +143 -0
  171. package/dist/docs/reference/compatibility.md +83 -0
  172. package/dist/docs/reference/errors.md +72 -0
  173. package/dist/docs/reference/glossary.md +161 -0
  174. package/dist/docs/reference/operations/auxiliary.md +116 -0
  175. package/dist/docs/reference/operations/history.md +168 -0
  176. package/dist/docs/reference/operations/queries.md +169 -0
  177. package/dist/docs/reference/operations/rows.md +185 -0
  178. package/dist/docs/reference/operations/schema.md +316 -0
  179. package/dist/docs/reference/operations.md +96 -0
  180. package/dist/docs/reference/settings.md +43 -0
  181. package/dist/docs/release-notes.md +188 -0
  182. package/dist/docs/start/connect-agents.md +204 -0
  183. package/dist/docs/start/how-it-works.md +349 -0
  184. package/dist/docs/start/quick-start.md +128 -0
  185. package/package.json +60 -15
@@ -0,0 +1,536 @@
1
+ # Read and filter rows
2
+
3
+ > Read rows with select_rows: filters and operators, relative dates, sorting and paging, links, and the note behind each row.
4
+
5
+ `select_rows` is the one operation that reads rows: you filter, sort, page, group and join with it, and you store its queries as views.
6
+
7
+ The examples query a diary of classic films with three tables: `film`, `actor` for the cast, and `watch` with one row per viewing from the last few weeks. The viewing dates count back from the day of the site’s build.
8
+
9
+ ## Filter rows, choose columns and sort
10
+
11
+ Every key of `where` must match, and a plain value means equal. `columns` picks the columns of the answer, which always includes `path`. `order_by` sorts the rows, and a leading `-` sorts them in descending order.
12
+
13
+ **`select_rows`**
14
+
15
+ ```json
16
+ {
17
+ "table": "film",
18
+ "columns": ["title", "minutes"],
19
+ "where": { "status": "watched" },
20
+ "order_by": "-minutes"
21
+ }
22
+ ```
23
+
24
+ Answer:
25
+
26
+ ```json
27
+ {
28
+ "table": "main.public.film",
29
+ "total": 6,
30
+ "rows": [
31
+ {
32
+ "path": "datanotes/main/public/film/Charade.md",
33
+ "title": "Charade",
34
+ "minutes": 113
35
+ },
36
+ {
37
+ "path": "datanotes/main/public/film/Night of the Living Dead.md",
38
+ "title": "Night of the Living Dead",
39
+ "minutes": 96
40
+ },
41
+ {
42
+ "path": "datanotes/main/public/film/The Gold Rush.md",
43
+ "title": "The Gold Rush",
44
+ "minutes": 95
45
+ },
46
+ {
47
+ "path": "datanotes/main/public/film/Nosferatu.md",
48
+ "title": "Nosferatu",
49
+ "minutes": 94
50
+ },
51
+ {
52
+ "path": "datanotes/main/public/film/His Girl Friday.md",
53
+ "title": "His Girl Friday",
54
+ "minutes": 92
55
+ },
56
+ {
57
+ "path": "datanotes/main/public/film/Sherlock Jr..md",
58
+ "title": "Sherlock Jr.",
59
+ "minutes": 45
60
+ }
61
+ ]
62
+ }
63
+ ```
64
+
65
+ ## Compare values with operators
66
+
67
+ A `where` key takes an object of operators in place of a plain value. These are the operators:
68
+
69
+ * **`eq`** and **`ne`**: equal and not equal
70
+ * **`gt`**, **`gte`**, **`lt`** and **`lte`**: greater than, at least, less than and at most
71
+ * **`in`**: equal to one of the listed values
72
+ * **`contains`**: contains the text, or has the item in a list
73
+ * **`icontains`**: contains the text, ignoring case and accents
74
+ * **`exists`**: has a value (`true`) or has none (`false`)
75
+
76
+ **`select_rows`**
77
+
78
+ ```json
79
+ {
80
+ "table": "film",
81
+ "columns": ["title", "minutes"],
82
+ "where": { "minutes": { "gte": 90, "lt": 100 } }
83
+ }
84
+ ```
85
+
86
+ Answer:
87
+
88
+ ```json
89
+ {
90
+ "table": "main.public.film",
91
+ "total": 4,
92
+ "rows": [
93
+ {
94
+ "path": "datanotes/main/public/film/His Girl Friday.md",
95
+ "title": "His Girl Friday",
96
+ "minutes": 92
97
+ },
98
+ {
99
+ "path": "datanotes/main/public/film/Night of the Living Dead.md",
100
+ "title": "Night of the Living Dead",
101
+ "minutes": 96
102
+ },
103
+ {
104
+ "path": "datanotes/main/public/film/Nosferatu.md",
105
+ "title": "Nosferatu",
106
+ "minutes": 94
107
+ },
108
+ {
109
+ "path": "datanotes/main/public/film/The Gold Rush.md",
110
+ "title": "The Gold Rush",
111
+ "minutes": 95
112
+ }
113
+ ]
114
+ }
115
+ ```
116
+
117
+ **`select_rows`**
118
+
119
+ ```json
120
+ {
121
+ "table": "film",
122
+ "columns": ["title"],
123
+ "where": { "cast": { "contains": "[[Cary Grant]]" } }
124
+ }
125
+ ```
126
+
127
+ Answer:
128
+
129
+ ```json
130
+ {
131
+ "table": "main.public.film",
132
+ "total": 2,
133
+ "rows": [
134
+ { "path": "datanotes/main/public/film/Charade.md", "title": "Charade" },
135
+ {
136
+ "path": "datanotes/main/public/film/His Girl Friday.md",
137
+ "title": "His Girl Friday"
138
+ }
139
+ ]
140
+ }
141
+ ```
142
+
143
+ `icontains` finds Cary Grant from a part of his name in lowercase:
144
+
145
+ **`select_rows`**
146
+
147
+ ```json
148
+ {
149
+ "table": "actor",
150
+ "columns": ["name", "born"],
151
+ "where": { "name": { "icontains": "grant" } }
152
+ }
153
+ ```
154
+
155
+ Answer:
156
+
157
+ ```json
158
+ {
159
+ "table": "main.public.actor",
160
+ "total": 1,
161
+ "rows": [
162
+ {
163
+ "path": "datanotes/main/public/actor/Cary Grant.md",
164
+ "name": "Cary Grant",
165
+ "born": "1904-01-18"
166
+ }
167
+ ]
168
+ }
169
+ ```
170
+
171
+ `exists: false` finds the films with no rating:
172
+
173
+ **`select_rows`**
174
+
175
+ ```json
176
+ { "table": "film", "columns": ["title"], "where": { "rating": { "exists": false } } }
177
+ ```
178
+
179
+ Answer:
180
+
181
+ ```json
182
+ {
183
+ "table": "main.public.film",
184
+ "total": 2,
185
+ "rows": [
186
+ {
187
+ "path": "datanotes/main/public/film/Battleship Potemkin.md",
188
+ "title": "Battleship Potemkin"
189
+ },
190
+ { "path": "datanotes/main/public/film/Metropolis.md", "title": "Metropolis" }
191
+ ]
192
+ }
193
+ ```
194
+
195
+ **`select_rows`**
196
+
197
+ ```json
198
+ {
199
+ "table": "film",
200
+ "columns": ["title", "year"],
201
+ "where": { "year": { "in": [1925, 1927] } }
202
+ }
203
+ ```
204
+
205
+ Answer:
206
+
207
+ ```json
208
+ {
209
+ "table": "main.public.film",
210
+ "total": 3,
211
+ "rows": [
212
+ {
213
+ "path": "datanotes/main/public/film/Battleship Potemkin.md",
214
+ "title": "Battleship Potemkin",
215
+ "year": 1925
216
+ },
217
+ {
218
+ "path": "datanotes/main/public/film/Metropolis.md",
219
+ "title": "Metropolis",
220
+ "year": 1927
221
+ },
222
+ {
223
+ "path": "datanotes/main/public/film/The Gold Rush.md",
224
+ "title": "The Gold Rush",
225
+ "year": 1925
226
+ }
227
+ ]
228
+ }
229
+ ```
230
+
231
+ ## Combine filters with `or`, `and` and `not`
232
+
233
+ `or`, `and` and `not` combine filters, and you can nest them. The first query finds the films still to watch and the watched films over 100 minutes. The second leaves out every film with Cary Grant.
234
+
235
+ **`select_rows`**
236
+
237
+ ```json
238
+ {
239
+ "table": "film",
240
+ "columns": ["title", "status", "minutes"],
241
+ "where": {
242
+ "or": [
243
+ { "status": "to watch" },
244
+ { "and": [{ "status": "watched" }, { "minutes": { "gt": 100 } }] }
245
+ ]
246
+ }
247
+ }
248
+ ```
249
+
250
+ Answer:
251
+
252
+ ```json
253
+ {
254
+ "table": "main.public.film",
255
+ "total": 3,
256
+ "rows": [
257
+ {
258
+ "path": "datanotes/main/public/film/Battleship Potemkin.md",
259
+ "title": "Battleship Potemkin",
260
+ "status": "to watch",
261
+ "minutes": 75
262
+ },
263
+ {
264
+ "path": "datanotes/main/public/film/Charade.md",
265
+ "title": "Charade",
266
+ "status": "watched",
267
+ "minutes": 113
268
+ },
269
+ {
270
+ "path": "datanotes/main/public/film/Metropolis.md",
271
+ "title": "Metropolis",
272
+ "status": "to watch",
273
+ "minutes": 153
274
+ }
275
+ ]
276
+ }
277
+ ```
278
+
279
+ **`select_rows`**
280
+
281
+ ```json
282
+ {
283
+ "table": "film",
284
+ "columns": ["title"],
285
+ "where": { "not": { "cast": { "contains": "[[Cary Grant]]" } } }
286
+ }
287
+ ```
288
+
289
+ Answer:
290
+
291
+ ```json
292
+ {
293
+ "table": "main.public.film",
294
+ "total": 6,
295
+ "rows": [
296
+ {
297
+ "path": "datanotes/main/public/film/Battleship Potemkin.md",
298
+ "title": "Battleship Potemkin"
299
+ },
300
+ { "path": "datanotes/main/public/film/Metropolis.md", "title": "Metropolis" },
301
+ {
302
+ "path": "datanotes/main/public/film/Night of the Living Dead.md",
303
+ "title": "Night of the Living Dead"
304
+ },
305
+ { "path": "datanotes/main/public/film/Nosferatu.md", "title": "Nosferatu" },
306
+ { "path": "datanotes/main/public/film/Sherlock Jr..md", "title": "Sherlock Jr." },
307
+ { "path": "datanotes/main/public/film/The Gold Rush.md", "title": "The Gold Rush" }
308
+ ]
309
+ }
310
+ ```
311
+
312
+ ## Filter by relative dates
313
+
314
+ The engine resolves tokens like `{today}`, `{today-7d}` and `{now-24h}` when the query runs, so a stored query keeps returning current rows. On a date column, a date-time counts by its day, so `{now-7d}` matches as `{today-7d}` does. This query finds the viewings of the last seven days.
315
+
316
+ **`select_rows`**
317
+
318
+ ```json
319
+ {
320
+ "table": "watch",
321
+ "columns": ["film", "occurred_at", "where", "place"],
322
+ "where": { "occurred_at": { "gte": "{today-7d}" } },
323
+ "order_by": "occurred_at"
324
+ }
325
+ ```
326
+
327
+ Answer:
328
+
329
+ ```json
330
+ {
331
+ "table": "main.public.watch",
332
+ "total": 3,
333
+ "rows": [
334
+ {
335
+ "path": "datanotes/main/public/watch/2026-10-09T2115.md",
336
+ "film": "[[Charade]]",
337
+ "occurred_at": "2026-10-09T21:15",
338
+ "where": "home",
339
+ "place": "my living room"
340
+ },
341
+ {
342
+ "path": "datanotes/main/public/watch/2026-10-12T2030.md",
343
+ "film": "[[The Gold Rush]]",
344
+ "occurred_at": "2026-10-12T20:30",
345
+ "where": "home",
346
+ "place": "my living room"
347
+ },
348
+ {
349
+ "path": "datanotes/main/public/watch/2026-10-13T2200.md",
350
+ "film": "[[Night of the Living Dead]]",
351
+ "occurred_at": "2026-10-13T22:00",
352
+ "where": "cinema",
353
+ "place": "the film club downtown"
354
+ }
355
+ ]
356
+ }
357
+ ```
358
+
359
+ ## Filter rows by a link
360
+
361
+ `contains` matches a list that holds the link, which you write with the note’s name.
362
+
363
+ **`select_rows`**
364
+
365
+ ```json
366
+ {
367
+ "table": "film",
368
+ "columns": ["title"],
369
+ "where": { "cast": { "contains": "[[Cary Grant]]" } }
370
+ }
371
+ ```
372
+
373
+ Answer:
374
+
375
+ ```json
376
+ {
377
+ "table": "main.public.film",
378
+ "total": 2,
379
+ "rows": [
380
+ { "path": "datanotes/main/public/film/Charade.md", "title": "Charade" },
381
+ {
382
+ "path": "datanotes/main/public/film/His Girl Friday.md",
383
+ "title": "His Girl Friday"
384
+ }
385
+ ]
386
+ }
387
+ ```
388
+
389
+ A dotted key follows the link and filters on a column of the linked row. Here it finds the actors of a film released after 1950:
390
+
391
+ **`select_rows`**
392
+
393
+ ```json
394
+ { "table": "actor", "columns": ["name"], "where": { "films.year": { "gt": 1950 } } }
395
+ ```
396
+
397
+ Answer:
398
+
399
+ ```json
400
+ {
401
+ "table": "main.public.actor",
402
+ "total": 2,
403
+ "rows": [
404
+ { "path": "datanotes/main/public/actor/Audrey Hepburn.md", "name": "Audrey Hepburn" },
405
+ { "path": "datanotes/main/public/actor/Cary Grant.md", "name": "Cary Grant" }
406
+ ]
407
+ }
408
+ ```
409
+
410
+ `film.minutes` finds the viewings of films longer than 100 minutes:
411
+
412
+ **`select_rows`**
413
+
414
+ ```json
415
+ {
416
+ "table": "watch",
417
+ "columns": ["film", "where"],
418
+ "where": { "film.minutes": { "gt": 100 } }
419
+ }
420
+ ```
421
+
422
+ Answer:
423
+
424
+ ```json
425
+ {
426
+ "table": "main.public.watch",
427
+ "total": 1,
428
+ "rows": [
429
+ {
430
+ "path": "datanotes/main/public/watch/2026-09-26T2130.md",
431
+ "film": "[[Charade]]",
432
+ "where": "home"
433
+ }
434
+ ]
435
+ }
436
+ ```
437
+
438
+ ## Page through the results
439
+
440
+ `limit` sets the page size (default 100, at most 1,000) and `offset` skips rows before the page. `total` counts every matching row, whatever the page.
441
+
442
+ **`select_rows`**
443
+
444
+ ```json
445
+ {
446
+ "table": "watch",
447
+ "columns": ["occurred_at"],
448
+ "order_by": "-occurred_at",
449
+ "limit": 2,
450
+ "offset": 2
451
+ }
452
+ ```
453
+
454
+ Answer:
455
+
456
+ ```json
457
+ {
458
+ "table": "main.public.watch",
459
+ "total": 7,
460
+ "rows": [
461
+ {
462
+ "path": "datanotes/main/public/watch/2026-10-09T2115.md",
463
+ "occurred_at": "2026-10-09T21:15"
464
+ },
465
+ {
466
+ "path": "datanotes/main/public/watch/2026-10-05T2130.md",
467
+ "occurred_at": "2026-10-05T21:30"
468
+ }
469
+ ]
470
+ }
471
+ ```
472
+
473
+ ## Read the note behind a row
474
+
475
+ Every row is a note, and you can select and filter these file columns:
476
+
477
+ * **`file_name`**: the note’s name
478
+ * **`file_link`**: a link to the note
479
+ * **`file_modified`**: when the file last changed
480
+ * **`file_backlink_count`**: the notes that link to it
481
+
482
+ `include_body` adds the note’s text to each row.
483
+
484
+ **`select_rows`**
485
+
486
+ ```json
487
+ {
488
+ "table": "film",
489
+ "columns": ["file_name", "file_link", "file_backlink_count"],
490
+ "where": { "title": "His Girl Friday" }
491
+ }
492
+ ```
493
+
494
+ Answer:
495
+
496
+ ```json
497
+ {
498
+ "table": "main.public.film",
499
+ "total": 1,
500
+ "rows": [
501
+ {
502
+ "path": "datanotes/main/public/film/His Girl Friday.md",
503
+ "file_name": "His Girl Friday",
504
+ "file_link": "[[datanotes/main/public/film/His Girl Friday|His Girl Friday]]",
505
+ "file_backlink_count": 2
506
+ }
507
+ ]
508
+ }
509
+ ```
510
+
511
+ **`select_rows`**
512
+
513
+ ```json
514
+ {
515
+ "table": "film",
516
+ "columns": ["title"],
517
+ "where": { "title": "Charade" },
518
+ "include_body": true
519
+ }
520
+ ```
521
+
522
+ Answer:
523
+
524
+ ```json
525
+ {
526
+ "table": "main.public.film",
527
+ "total": 1,
528
+ "rows": [
529
+ {
530
+ "path": "datanotes/main/public/film/Charade.md",
531
+ "title": "Charade",
532
+ "body": "[[Cary Grant]] again, twenty years after [[His Girl Friday]], and just as quick.\n"
533
+ }
534
+ ]
535
+ }
536
+ ```