datanotes 3.3.0 → 3.3.1

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 (34) hide show
  1. package/dist/api/extensions.cjs +1190 -2
  2. package/dist/api/extensions.js +1190 -2
  3. package/dist/api/index.cjs +1190 -2
  4. package/dist/api/index.js +1190 -2
  5. package/dist/api/mcp.cjs +1190 -2
  6. package/dist/api/mcp.js +1190 -2
  7. package/dist/datanotes.cjs +1257 -11
  8. package/dist/docs/api/operations/alter_table.md +4 -3
  9. package/dist/docs/api.md +1 -1
  10. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  11. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  12. package/dist/docs/guides/database-objects/bases.md +11 -11
  13. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
  14. package/dist/docs/guides/database-objects/columns.md +38 -38
  15. package/dist/docs/guides/database-objects/relations.md +28 -28
  16. package/dist/docs/guides/database-objects/tables.md +167 -43
  17. package/dist/docs/guides/database-objects/views.md +44 -44
  18. package/dist/docs/guides/history/change-data-feed.md +34 -34
  19. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  20. package/dist/docs/guides/history/restore.md +20 -20
  21. package/dist/docs/guides/history/table-history.md +31 -31
  22. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  23. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  24. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  25. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  26. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  27. package/dist/docs/guides/search/text.md +1 -1
  28. package/dist/docs/reference/cli.md +1 -1
  29. package/dist/docs/reference/operations/auxiliary.md +1 -1
  30. package/dist/docs/reference/operations/rows.md +1 -1
  31. package/dist/docs/reference/operations/schema.md +3 -3
  32. package/dist/docs/reference/operations.md +4 -4
  33. package/dist/docs/release-notes.md +16 -0
  34. package/package.json +1 -1
@@ -14,9 +14,10 @@ labels merged into the table's, e.g. `{"domain": "health"}`; a `null` value remo
14
14
  `null` value removes one). Rows, archive and transaction log follow; links are updated; renamed
15
15
  rows keep their old name in `aliases`. A change of metadata only (tags, description, aliases,
16
16
  history, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused
17
- when a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows
18
- links, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not
19
- rewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.
17
+ when a row cannot fill a pattern. Renaming or moving the table rewrites what names it in other
18
+ definitions: the `ref` and `vocabulary` of the columns of other tables and bases (lists of links
19
+ included) and the tables of views (`table`, `union[].table`, `join.table`); `schema_references`
20
+ lists them. CHECKs and `ref_where` / `ref_by` that read it through a link follow the new `ref`. Use `dry_run` to see `planned_moves`; undo with undo_migration.
20
21
 
21
22
  The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
22
23
 
package/dist/docs/api.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Datanotes HTTP API
2
2
 
3
- > OpenAPI 3.1.0 description of the Datanotes 3.3.0 HTTP API: https://datanotes.dev/openapi.json
3
+ > OpenAPI 3.1.0 description of the Datanotes 3.3.1 HTTP API: https://datanotes.dev/openapi.json
4
4
 
5
5
  Database of Markdown notes: tables of notes, rows, queries, history, a change feed and the vault's notes.
6
6
 
@@ -29,7 +29,7 @@ Answer:
29
29
  "commits": [
30
30
  { "table": "diary.classics.film", "version": 8, "operation": "ADD CONSTRAINT" }
31
31
  ],
32
- "migration_id": "20261020T173845-add_constraint-add-constraint-rated_when_watc"
32
+ "migration_id": "20261024T053837-add_constraint-add-constraint-rated_when_watc"
33
33
  }
34
34
  ```
35
35
 
@@ -86,7 +86,7 @@ Answer:
86
86
  "files_created": 1,
87
87
  "planned_creates": ["datanotes/diary/classics/film/His Girl Friday.md"],
88
88
  "commits": [{ "table": "diary.classics.film", "version": 10, "operation": "WRITE" }],
89
- "migration_id": "20261020T173845-insert_row-insert-into-film"
89
+ "migration_id": "20261024T053837-insert_row-insert-into-film-2"
90
90
  }
91
91
  ```
92
92
 
@@ -108,7 +108,7 @@ Answer:
108
108
  "commits": [
109
109
  { "table": "diary.classics.film", "version": 11, "operation": "DROP CONSTRAINT" }
110
110
  ],
111
- "migration_id": "20261020T173845-drop_constraint-drop-constraint-at_most_three_"
111
+ "migration_id": "20261024T053837-drop_constraint-drop-constraint-at_most_three_"
112
112
  }
113
113
  ```
114
114
 
@@ -149,7 +149,7 @@ Answer:
149
149
  "commits": [
150
150
  { "table": "main.public.genre", "version": 4, "operation": "ADD CONSTRAINT" }
151
151
  ],
152
- "migration_id": "20261020T173831-add_constraint-add-constraint-parent_by_level"
152
+ "migration_id": "20261024T053821-add_constraint-add-constraint-parent_by_level"
153
153
  }
154
154
  ```
155
155
 
@@ -228,34 +228,34 @@ Answer:
228
228
  "ok": true,
229
229
  "op": "batch",
230
230
  "dry_run": false,
231
- "migration_id": "20261020T173831-batch-add-the-silent-era-and-slapsti",
231
+ "migration_id": "20261024T053821-batch-add-the-silent-era-and-slapsti",
232
232
  "steps": [
233
233
  {
234
234
  "index": 0,
235
235
  "op": "insert_row",
236
236
  "ok": true,
237
- "migration_id": "20261020T173831-insert_row-insert-into-genre-4",
237
+ "migration_id": "20261024T053821-insert_row-insert-into-genre-4",
238
238
  "result": {
239
239
  "ok": true,
240
240
  "op": "insert_row",
241
241
  "files_created": 1,
242
242
  "planned_creates": ["datanotes/main/public/genre/Silent cinema.md"],
243
243
  "commits": [{ "table": "main.public.genre", "version": 5, "operation": "WRITE" }],
244
- "migration_id": "20261020T173831-insert_row-insert-into-genre-4"
244
+ "migration_id": "20261024T053821-insert_row-insert-into-genre-4"
245
245
  }
246
246
  },
247
247
  {
248
248
  "index": 1,
249
249
  "op": "insert_row",
250
250
  "ok": true,
251
- "migration_id": "20261020T173831-insert_row-insert-into-genre-5",
251
+ "migration_id": "20261024T053821-insert_row-insert-into-genre-5",
252
252
  "result": {
253
253
  "ok": true,
254
254
  "op": "insert_row",
255
255
  "files_created": 1,
256
256
  "planned_creates": ["datanotes/main/public/genre/Slapstick comedy.md"],
257
257
  "commits": [{ "table": "main.public.genre", "version": 6, "operation": "WRITE" }],
258
- "migration_id": "20261020T173831-insert_row-insert-into-genre-5"
258
+ "migration_id": "20261024T053821-insert_row-insert-into-genre-5"
259
259
  }
260
260
  }
261
261
  ]
@@ -343,7 +343,7 @@ Answer:
343
343
  }
344
344
  ],
345
345
  "commits": [{ "table": "main.public.genre", "version": 7, "operation": "UPDATE" }],
346
- "migration_id": "20261020T173831-update_row-update-genre"
346
+ "migration_id": "20261024T053821-update_row-update-genre"
347
347
  }
348
348
  ```
349
349
 
@@ -35,7 +35,7 @@ You edit `datanotes/main/public/genre/Silent film.md` by hand, outside the engin
35
35
  ```markdown
36
36
  ---
37
37
  table: main.public.genre
38
- id: 01a15a64-b310-70dd-a3f1-8f7d07ed2729
38
+ id: 01a16c6a-d02a-78b2-b025-40ae0348957b
39
39
  name: Silent film
40
40
  kind: cinema
41
41
  parent: "[[Cinema]]"
@@ -152,7 +152,7 @@ Answer:
152
152
  }
153
153
  ],
154
154
  "commits": [{ "table": "main.public.genre", "version": 9, "operation": "UPDATE" }],
155
- "migration_id": "20261020T173832-update_row-update-genre"
155
+ "migration_id": "20261024T053823-update_row-update-genre"
156
156
  }
157
157
  ```
158
158
 
@@ -167,7 +167,7 @@ You edit `datanotes/main/public/watch/2026-10-03T2130.md` by hand, outside the e
167
167
  ```markdown
168
168
  ---
169
169
  table: main.public.watch
170
- id: 01a15a64-ab35-73d2-a276-9c24d3c889dd
170
+ id: 01a16c6a-c91c-75d4-af58-f40270afa72e
171
171
  film: His Girl Friday
172
172
  occurred_at: 2026-10-03T21:30
173
173
  where: cinema
@@ -226,7 +226,7 @@ Answer:
226
226
  }
227
227
  ],
228
228
  "commits": [{ "table": "main.public.watch", "version": 3, "operation": "RECOMPUTE" }],
229
- "migration_id": "20261020T173830-recompute_columns-recompute-id-day-label-of-watc"
229
+ "migration_id": "20261024T053821-recompute_columns-recompute-id-day-label-of-watc"
230
230
  }
231
231
  ```
232
232
 
@@ -292,7 +292,7 @@ Answer:
292
292
  ```markdown
293
293
  ---
294
294
  table: main.public.watch
295
- id: 01a15a65-0df1-7af6-9ccd-c58c8b5346c0
295
+ id: 01a16c6b-31f3-71ea-805b-9a972bd80279
296
296
  occurred_at: 2026-09-25T21:00
297
297
  film: "[[Charade]]"
298
298
  where: home
@@ -311,7 +311,7 @@ You edit `datanotes/main/public/film/Metropolis.md` by hand, outside the engine.
311
311
  ```markdown
312
312
  ---
313
313
  table: main.public.film
314
- id: 01a15a64-cea3-776e-b81b-389706767aa1
314
+ id: 01a16c6a-f3db-73dd-9ca7-c1c2c0456765
315
315
  year: 1927
316
316
  minutes: 153
317
317
  status: to watch
@@ -384,7 +384,7 @@ You edit `datanotes/main/public/film/Sherlock Jr..md` by hand, outside the engin
384
384
  ```markdown
385
385
  ---
386
386
  table: main.public.film
387
- id: 01a15a64-b991-7728-99e2-bf13797d5532
387
+ id: 01a16c6a-d660-7ca7-ab67-0e0e1c2d096a
388
388
  title: Sherlock Jr.: the projectionist
389
389
  year: 1924
390
390
  status: watched
@@ -471,7 +471,7 @@ You edit `datanotes/main/public/film/Sherlock Jr..md` by hand, outside the engin
471
471
  ```markdown
472
472
  ---
473
473
  table: main.public.film
474
- id: 01a15a64-b991-7728-99e2-bf13797d5532
474
+ id: 01a16c6a-d660-7ca7-ab67-0e0e1c2d096a
475
475
  title: "Sherlock Jr.: the projectionist"
476
476
  year: 1924
477
477
  status: watched
@@ -30,7 +30,7 @@ Answer:
30
30
  "ok": true,
31
31
  "op": "define_base",
32
32
  "planned_texts": ["datanotes/metastore.yaml"],
33
- "migration_id": "20261020T173845-define_base-create-base-entry"
33
+ "migration_id": "20261024T053837-define_base-create-base-entry"
34
34
  }
35
35
  ```
36
36
 
@@ -50,7 +50,7 @@ Answer:
50
50
  "commits": [
51
51
  { "table": "diary.classics.film", "version": 6, "operation": "SET TABLE BASES" }
52
52
  ],
53
- "migration_id": "20261020T173845-set_table_bases-diary-classics-film-extends-en"
53
+ "migration_id": "20261024T053837-set_table_bases-diary-classics-film-extends-en"
54
54
  }
55
55
  ```
56
56
 
@@ -118,14 +118,14 @@ Answer:
118
118
  "rows": [
119
119
  {
120
120
  "path": "datanotes/diary/classics/actors/Max Schreck.md",
121
- "id": "01a15a64-e8e3-73eb-9164-1fc8de45795b",
121
+ "id": "01a16c6b-0dc8-714f-bb09-fc483851af7c",
122
122
  "added_on": "2026-10-05",
123
123
  "note": "The face of Nosferatu",
124
124
  "_source": "diary.classics.actors"
125
125
  },
126
126
  {
127
127
  "path": "datanotes/diary/classics/film/Nosferatu.md",
128
- "id": "01a15a64-e863-705a-96ae-42d6c22c878b",
128
+ "id": "01a16c6b-0d7b-7381-9d5e-8f90a0dcab88",
129
129
  "added_on": "2026-10-05",
130
130
  "note": null,
131
131
  "_source": "diary.classics.film"
@@ -169,7 +169,7 @@ Answer:
169
169
  "commits": [
170
170
  { "table": "diary.classics.actors", "version": 3, "operation": "DEFINE BASE" }
171
171
  ],
172
- "migration_id": "20261020T173845-define_base-alter-base-entry"
172
+ "migration_id": "20261024T053837-define_base-alter-base-entry"
173
173
  }
174
174
  ```
175
175
 
@@ -246,7 +246,7 @@ Answer:
246
246
  "commits": [
247
247
  { "table": "diary.classics.actors", "version": 4, "operation": "DEFINE BASE" }
248
248
  ],
249
- "migration_id": "20261020T173845-define_base-alter-base-entry-2"
249
+ "migration_id": "20261024T053837-define_base-alter-base-entry-2"
250
250
  }
251
251
  ```
252
252
 
@@ -280,7 +280,7 @@ Answer:
280
280
  "ok": true,
281
281
  "op": "define_base",
282
282
  "planned_texts": ["datanotes/metastore.yaml"],
283
- "migration_id": "20261020T173845-define_base-create-base-credited"
283
+ "migration_id": "20261024T053837-define_base-create-base-credited"
284
284
  }
285
285
  ```
286
286
 
@@ -300,7 +300,7 @@ Answer:
300
300
  "commits": [
301
301
  { "table": "diary.classics.actors", "version": 5, "operation": "SET TABLE BASES" }
302
302
  ],
303
- "migration_id": "20261020T173845-set_table_bases-diary-classics-actors-extends--2"
303
+ "migration_id": "20261024T053837-set_table_bases-diary-classics-actors-extends--2"
304
304
  }
305
305
  ```
306
306
 
@@ -329,7 +329,7 @@ Answer:
329
329
  "ok": true,
330
330
  "op": "define_base",
331
331
  "planned_texts": ["datanotes/metastore.yaml"],
332
- "migration_id": "20261020T173845-define_base-create-base-tree"
332
+ "migration_id": "20261024T053837-define_base-create-base-tree"
333
333
  }
334
334
  ```
335
335
 
@@ -369,7 +369,7 @@ Answer:
369
369
  "commits": [
370
370
  { "table": "diary.classics.genre", "version": 1, "operation": "SET TABLE BASES" }
371
371
  ],
372
- "migration_id": "20261020T173845-set_table_bases-diary-classics-genre-extends-t"
372
+ "migration_id": "20261024T053837-set_table_bases-diary-classics-genre-extends-t"
373
373
  }
374
374
  ```
375
375
 
@@ -475,6 +475,6 @@ Answer:
475
475
  "operation": "SET TABLE BASES"
476
476
  }
477
477
  ],
478
- "migration_id": "20261020T173845-set_table_bases-diary-classics-genre_draft-ext"
478
+ "migration_id": "20261024T053837-set_table_bases-diary-classics-genre_draft-ext"
479
479
  }
480
480
  ```
@@ -63,7 +63,7 @@ Answer:
63
63
  "commits": [
64
64
  { "table": "diary.classics.film", "version": 0, "operation": "CREATE TABLE" }
65
65
  ],
66
- "migration_id": "20261020T173844-create_table-create-table-diary-classics-fi"
66
+ "migration_id": "20261024T053837-create_table-create-table-diary-classics-fi"
67
67
  }
68
68
  ```
69
69
 
@@ -91,7 +91,7 @@ Answer:
91
91
  "files_created": 1,
92
92
  "planned_creates": ["datanotes/diary/classics/film/Nosferatu.md"],
93
93
  "commits": [{ "table": "diary.classics.film", "version": 1, "operation": "WRITE" }],
94
- "migration_id": "20261020T173844-insert_row-insert-into-film"
94
+ "migration_id": "20261024T053837-insert_row-insert-into-film"
95
95
  }
96
96
  ```
97
97
 
@@ -127,7 +127,7 @@ Answer:
127
127
  "commits": [
128
128
  { "table": "diary.classics.film", "version": 3, "operation": "ALTER TABLE" }
129
129
  ],
130
- "migration_id": "20261020T173844-alter_table-alter-table-diary-classics-fil-2"
130
+ "migration_id": "20261024T053837-alter_table-alter-table-diary-classics-fil-2"
131
131
  }
132
132
  ```
133
133
 
@@ -144,7 +144,7 @@ Answer:
144
144
  "ok": true,
145
145
  "op": "comment_on",
146
146
  "planned_texts": ["datanotes/metastore.yaml"],
147
- "migration_id": "20261020T173844-comment_on-comment-on-catalog-diary"
147
+ "migration_id": "20261024T053837-comment_on-comment-on-catalog-diary"
148
148
  }
149
149
  ```
150
150
 
@@ -165,7 +165,7 @@ Answer:
165
165
  "ok": true,
166
166
  "op": "comment_on",
167
167
  "planned_texts": ["datanotes/metastore.yaml"],
168
- "migration_id": "20261020T173845-comment_on-comment-on-schema-diary-classi"
168
+ "migration_id": "20261024T053837-comment_on-comment-on-schema-diary-classi"
169
169
  }
170
170
  ```
171
171
 
@@ -173,7 +173,7 @@ Answer:
173
173
 
174
174
  ```yaml
175
175
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
176
- id: 01a15a64-e851-7907-b148-bbd50adcd745
176
+ id: 01a16c6b-0d6f-702d-bc09-cd959a95f3fe
177
177
  config:
178
178
  history: true
179
179
 
@@ -270,7 +270,7 @@ Answer:
270
270
  "commits": [
271
271
  { "table": "diary.classics.film", "version": 4, "operation": "ALTER TABLE" }
272
272
  ],
273
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil"
273
+ "migration_id": "20261024T053837-alter_table-alter-table-diary-classics-fil-3"
274
274
  }
275
275
  ```
276
276
 
@@ -287,7 +287,7 @@ Answer:
287
287
  "ok": true,
288
288
  "op": "comment_on",
289
289
  "planned_texts": ["datanotes/metastore.yaml"],
290
- "migration_id": "20261020T173845-comment_on-remove-the-comment-on-schema-d"
290
+ "migration_id": "20261024T053837-comment_on-remove-the-comment-on-schema-d"
291
291
  }
292
292
  ```
293
293
 
@@ -309,7 +309,7 @@ Answer:
309
309
  "commits": [
310
310
  { "table": "diary.classics.film", "version": 5, "operation": "ALTER TABLE" }
311
311
  ],
312
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-2"
312
+ "migration_id": "20261024T053837-alter_table-alter-table-diary-classics-fil-4"
313
313
  }
314
314
  ```
315
315
 
@@ -593,7 +593,7 @@ This is the database of this page as the engine wrote it. `metastore.yaml` holds
593
593
 
594
594
  ```yaml
595
595
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
596
- id: 01a15a64-e851-7907-b148-bbd50adcd745
596
+ id: 01a16c6b-0d6f-702d-bc09-cd959a95f3fe
597
597
  config:
598
598
  history: true
599
599
  default_catalog: diary
@@ -667,6 +667,10 @@ catalogs:
667
667
  min: 1
668
668
  max: 5
669
669
  description: My rating, from 1 (poor) to 5 (a masterpiece)
670
+ - name: lead
671
+ type: link
672
+ ref: diary.credits.actor
673
+ description: The actor in the leading role
670
674
  genre:
671
675
  description: Eras and genres of cinema, as a tree
672
676
  options:
@@ -703,6 +707,14 @@ catalogs:
703
707
  type: string
704
708
  required: true
705
709
  description: The name of the era or genre
710
+ views:
711
+ cast_list:
712
+ description: Every actor, by name
713
+ query:
714
+ table: diary.credits.actor
715
+ columns:
716
+ - name
717
+ order_by: name
706
718
  credits:
707
719
  tables:
708
720
  actor:
@@ -819,6 +831,10 @@ catalogs:
819
831
  min: 1
820
832
  max: 5
821
833
  description: My rating, from 1 (poor) to 5 (a masterpiece)
834
+ - name: lead
835
+ type: link
836
+ ref: diary.credits.actor
837
+ description: The actor in the leading role
822
838
  film_empty:
823
839
  description: "One note per classic film: what I watched and what I thought"
824
840
  aliases:
@@ -875,6 +891,10 @@ catalogs:
875
891
  min: 1
876
892
  max: 5
877
893
  description: My rating, from 1 (poor) to 5 (a masterpiece)
894
+ - name: lead
895
+ type: link
896
+ ref: diary.credits.actor
897
+ description: The actor in the leading role
878
898
  bases:
879
899
  entry:
880
900
  description: A note of the film diary