datanotes 3.3.0 → 3.4.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 (72) hide show
  1. package/SECURITY.md +5 -3
  2. package/dist/api/extensions.cjs +1345 -21
  3. package/dist/api/extensions.js +1345 -21
  4. package/dist/api/index.cjs +1345 -21
  5. package/dist/api/index.js +1345 -21
  6. package/dist/api/mcp.cjs +1345 -21
  7. package/dist/api/mcp.js +1345 -21
  8. package/dist/datanotes.cjs +2927 -609
  9. package/dist/docs/administration/extensions.md +2 -2
  10. package/dist/docs/api/operations/add_column.md +1 -0
  11. package/dist/docs/api/operations/alter_table.md +4 -3
  12. package/dist/docs/api/operations/check_table.md +1 -0
  13. package/dist/docs/api/operations/create_table.md +1 -0
  14. package/dist/docs/api/operations/describe_database.md +2 -0
  15. package/dist/docs/api/operations/describe_history.md +1 -0
  16. package/dist/docs/api/operations/describe_semantic_index.md +1 -0
  17. package/dist/docs/api/operations/describe_table.md +1 -0
  18. package/dist/docs/api/operations/graph_neighbors.md +1 -0
  19. package/dist/docs/api/operations/graph_path.md +1 -0
  20. package/dist/docs/api/operations/graph_traverse.md +1 -0
  21. package/dist/docs/api/operations/infer_table.md +1 -0
  22. package/dist/docs/api/operations/list_changes.md +1 -0
  23. package/dist/docs/api/operations/list_folder.md +1 -0
  24. package/dist/docs/api/operations/list_link_targets.md +1 -0
  25. package/dist/docs/api/operations/list_migrations.md +1 -0
  26. package/dist/docs/api/operations/list_tables.md +2 -0
  27. package/dist/docs/api/operations/list_webhooks.md +1 -0
  28. package/dist/docs/api/operations/read_note.md +1 -0
  29. package/dist/docs/api/operations/search.md +39 -0
  30. package/dist/docs/api/operations/search_notes.md +1 -0
  31. package/dist/docs/api/operations/select_rows.md +1 -0
  32. package/dist/docs/api/operations/semantic_search.md +1 -0
  33. package/dist/docs/api/operations/table_changes.md +1 -0
  34. package/dist/docs/api/operations/tags/queries.md +1 -0
  35. package/dist/docs/api/operations/tags/tokens.md +1 -1
  36. package/dist/docs/api/operations/tokens_create.md +1 -0
  37. package/dist/docs/api/operations/tokens_update.md +2 -1
  38. package/dist/docs/api.md +5 -4
  39. package/dist/docs/develop/build-an-app.md +2 -1
  40. package/dist/docs/develop/change-feed-and-webhooks.md +1 -1
  41. package/dist/docs/develop/http-api.md +1 -1
  42. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  43. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  44. package/dist/docs/guides/database-objects/bases.md +11 -11
  45. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
  46. package/dist/docs/guides/database-objects/columns.md +243 -40
  47. package/dist/docs/guides/database-objects/relations.md +28 -28
  48. package/dist/docs/guides/database-objects/tables.md +167 -43
  49. package/dist/docs/guides/database-objects/views.md +44 -44
  50. package/dist/docs/guides/history/change-data-feed.md +34 -34
  51. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  52. package/dist/docs/guides/history/restore.md +20 -20
  53. package/dist/docs/guides/history/table-history.md +31 -31
  54. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  55. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  56. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  57. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  58. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  59. package/dist/docs/guides/search/hybrid.md +162 -0
  60. package/dist/docs/guides/search/text.md +1 -1
  61. package/dist/docs/guides/security/security-model.md +5 -3
  62. package/dist/docs/guides/security/tokens.md +121 -8
  63. package/dist/docs/reference/cli.md +1 -1
  64. package/dist/docs/reference/glossary.md +1 -1
  65. package/dist/docs/reference/operations/auxiliary.md +3 -3
  66. package/dist/docs/reference/operations/queries.md +16 -0
  67. package/dist/docs/reference/operations/rows.md +1 -1
  68. package/dist/docs/reference/operations/schema.md +5 -5
  69. package/dist/docs/reference/operations.md +6 -5
  70. package/dist/docs/release-notes.md +59 -0
  71. package/dist/docs/start/connect-agents.md +10 -3
  72. package/package.json +1 -1
@@ -56,7 +56,7 @@ Answer:
56
56
  "op": "create_table",
57
57
  "planned_texts": ["datanotes/metastore.yaml"],
58
58
  "commits": [{ "table": "main.public.watch", "version": 0, "operation": "CREATE TABLE" }],
59
- "migration_id": "20261020T173830-create_table-create-table-main-public-watch"
59
+ "migration_id": "20261024T063905-create_table-create-table-main-public-watch"
60
60
  }
61
61
  ```
62
62
 
@@ -85,7 +85,7 @@ Answer:
85
85
  "files_created": 1,
86
86
  "planned_creates": ["datanotes/main/public/watch/2026-03-14T2030.md"],
87
87
  "commits": [{ "table": "main.public.watch", "version": 1, "operation": "WRITE" }],
88
- "migration_id": "20261020T173830-insert_row-insert-into-watch"
88
+ "migration_id": "20261024T063905-insert_row-insert-into-watch"
89
89
  }
90
90
  ```
91
91
 
@@ -94,7 +94,7 @@ Answer:
94
94
  ```markdown
95
95
  ---
96
96
  table: main.public.watch
97
- id: 01a15a64-b1c0-7d12-a17c-84d874242764
97
+ id: 01a16ca2-6a46-7ba7-aab3-b44a9f6a46ac
98
98
  film: "[[His Girl Friday]]"
99
99
  where: cinema
100
100
  place: the film club downtown
@@ -189,7 +189,7 @@ Answer:
189
189
  "op": "add_column",
190
190
  "planned_texts": ["datanotes/metastore.yaml"],
191
191
  "commits": [{ "table": "main.public.actor", "version": 4, "operation": "ADD COLUMNS" }],
192
- "migration_id": "20261020T173831-add_column-add-column-films-to-actor"
192
+ "migration_id": "20261024T063905-add_column-add-column-films-to-actor"
193
193
  }
194
194
  ```
195
195
 
@@ -217,7 +217,7 @@ Answer:
217
217
  "op": "add_column",
218
218
  "planned_texts": ["datanotes/metastore.yaml"],
219
219
  "commits": [{ "table": "main.public.film", "version": 4, "operation": "ADD COLUMNS" }],
220
- "migration_id": "20261020T173831-add_column-add-column-cast-to-film"
220
+ "migration_id": "20261024T063905-add_column-add-column-cast-to-film"
221
221
  }
222
222
  ```
223
223
 
@@ -259,7 +259,7 @@ Answer:
259
259
  { "table": "main.public.actor", "version": 5, "operation": "UPDATE" },
260
260
  { "table": "main.public.film", "version": 5, "operation": "UPDATE" }
261
261
  ],
262
- "migration_id": "20261020T173831-update_row-update-film"
262
+ "migration_id": "20261024T063905-update_row-update-film"
263
263
  }
264
264
  ```
265
265
 
@@ -268,7 +268,7 @@ Answer:
268
268
  ```markdown
269
269
  ---
270
270
  table: main.public.film
271
- id: 01a15a64-b1a7-7d34-a0dc-aa55e47859af
271
+ id: 01a16ca2-6a33-7632-913d-3e5953bdd08d
272
272
  title: Charade
273
273
  year: 1963
274
274
  minutes: 113
@@ -291,7 +291,7 @@ Answer:
291
291
  ```markdown
292
292
  ---
293
293
  table: main.public.actor
294
- id: 01a15a64-b185-745b-8061-07cff446109d
294
+ id: 01a16ca2-6a08-747b-b3fd-aca4ce9b450b
295
295
  name: Cary Grant
296
296
  born: 1904-01-18
297
297
  films:
@@ -359,7 +359,7 @@ Answer:
359
359
  {
360
360
  "path": "datanotes/main/public/actor/Cary Grant.md",
361
361
  "table": "main.public.actor",
362
- "id": "01a15a64-b185-745b-8061-07cff446109d",
362
+ "id": "01a16ca2-6a08-747b-b3fd-aca4ce9b450b",
363
363
  "name": "Cary Grant",
364
364
  "born": "1904-01-18",
365
365
  "films": ["[[Charade]]", "[[His Girl Friday]]"]
@@ -367,7 +367,7 @@ Answer:
367
367
  {
368
368
  "path": "datanotes/main/public/actor/Audrey Hepburn.md",
369
369
  "table": "main.public.actor",
370
- "id": "01a15a64-b192-78fb-b963-b173dfcdc402",
370
+ "id": "01a16ca2-6a25-75c7-b32a-05c50c51c2d1",
371
371
  "name": "Audrey Hepburn",
372
372
  "born": "1929-05-04",
373
373
  "films": ["[[Charade]]"]
@@ -423,7 +423,7 @@ Answer:
423
423
  "op": "alter_column",
424
424
  "planned_texts": ["datanotes/metastore.yaml"],
425
425
  "commits": [{ "table": "main.public.film", "version": 9, "operation": "CHANGE COLUMN" }],
426
- "migration_id": "20261020T173831-alter_column-alter-column-see_also-in-film"
426
+ "migration_id": "20261024T063905-alter_column-alter-column-see_also-in-film"
427
427
  }
428
428
  ```
429
429
 
@@ -479,7 +479,7 @@ Answer:
479
479
  "commits": [
480
480
  { "table": "main.public.film", "version": 10, "operation": "ALIGN RELATIONS" }
481
481
  ],
482
- "migration_id": "20261020T173831-align_relations-align-inverse-links-of-main-pu"
482
+ "migration_id": "20261024T063905-align_relations-align-inverse-links-of-main-pu"
483
483
  }
484
484
  ```
485
485
 
@@ -573,7 +573,7 @@ Answer:
573
573
  "op": "add_column",
574
574
  "planned_texts": ["datanotes/metastore.yaml"],
575
575
  "commits": [{ "table": "main.public.film", "version": 11, "operation": "ADD COLUMNS" }],
576
- "migration_id": "20261020T173831-add_column-add-column-tags-to-film"
576
+ "migration_id": "20261024T063905-add_column-add-column-tags-to-film"
577
577
  }
578
578
  ```
579
579
 
@@ -629,7 +629,7 @@ Answer:
629
629
  }
630
630
  ],
631
631
  "commits": [{ "table": "main.public.film", "version": 12, "operation": "UPDATE" }],
632
- "migration_id": "20261020T173831-update_row-update-film-4"
632
+ "migration_id": "20261024T063905-update_row-update-film-4"
633
633
  }
634
634
  ```
635
635
 
@@ -677,7 +677,7 @@ Answer:
677
677
  "op": "create_table",
678
678
  "planned_texts": ["datanotes/metastore.yaml"],
679
679
  "commits": [{ "table": "main.public.genre", "version": 0, "operation": "CREATE TABLE" }],
680
- "migration_id": "20261020T173831-create_table-create-table-main-public-genre"
680
+ "migration_id": "20261024T063905-create_table-create-table-main-public-genre"
681
681
  }
682
682
  ```
683
683
 
@@ -793,7 +793,7 @@ Answer:
793
793
  "op": "add_column",
794
794
  "planned_texts": ["datanotes/metastore.yaml"],
795
795
  "commits": [{ "table": "main.public.film", "version": 13, "operation": "ADD COLUMNS" }],
796
- "migration_id": "20261020T173831-add_column-add-column-watch_after-to-film"
796
+ "migration_id": "20261024T063906-add_column-add-column-watch_after-to-film"
797
797
  }
798
798
  ```
799
799
 
@@ -907,7 +907,7 @@ Answer:
907
907
  "commits": [
908
908
  { "table": "main.public.genre", "version": 10, "operation": "CHANGE COLUMN" }
909
909
  ],
910
- "migration_id": "20261020T173832-alter_column-alter-column-parent-in-genre"
910
+ "migration_id": "20261024T063907-alter_column-alter-column-parent-in-genre"
911
911
  }
912
912
  ```
913
913
 
@@ -1065,7 +1065,7 @@ Answer:
1065
1065
  "op": "add_column",
1066
1066
  "planned_texts": ["datanotes/metastore.yaml"],
1067
1067
  "commits": [{ "table": "main.public.film", "version": 17, "operation": "ADD COLUMNS" }],
1068
- "migration_id": "20261020T173832-add_column-add-column-genre-to-film"
1068
+ "migration_id": "20261024T063907-add_column-add-column-genre-to-film"
1069
1069
  }
1070
1070
  ```
1071
1071
 
@@ -1147,7 +1147,7 @@ Answer:
1147
1147
  "op": "add_column",
1148
1148
  "planned_texts": ["datanotes/metastore.yaml"],
1149
1149
  "commits": [{ "table": "main.public.watch", "version": 3, "operation": "ADD COLUMNS" }],
1150
- "migration_id": "20261020T173832-add_column-add-column-on_day-to-watch"
1150
+ "migration_id": "20261024T063907-add_column-add-column-on_day-to-watch"
1151
1151
  }
1152
1152
  ```
1153
1153
 
@@ -1176,7 +1176,7 @@ Answer:
1176
1176
  "files_created": 1,
1177
1177
  "planned_creates": ["datanotes/main/public/watch/2026-10-31T2300.md"],
1178
1178
  "commits": [{ "table": "main.public.watch", "version": 4, "operation": "WRITE" }],
1179
- "migration_id": "20261020T173832-insert_row-insert-into-watch"
1179
+ "migration_id": "20261024T063907-insert_row-insert-into-watch"
1180
1180
  }
1181
1181
  ```
1182
1182
 
@@ -1185,7 +1185,7 @@ Answer:
1185
1185
  ```markdown
1186
1186
  ---
1187
1187
  table: main.public.watch
1188
- id: 01a15a64-b92d-7a2d-b57f-e57d0d43a1c9
1188
+ id: 01a16ca2-7140-7aeb-b6ac-226c8e820686
1189
1189
  film: "[[Night of the Living Dead]]"
1190
1190
  where: cinema
1191
1191
  place: the film club downtown
@@ -1262,13 +1262,13 @@ Answer (77 lines)
1262
1262
  "ok": true,
1263
1263
  "op": "batch",
1264
1264
  "dry_run": false,
1265
- "migration_id": "20261020T173832-batch-remove-charade-and-its-viewing",
1265
+ "migration_id": "20261024T063907-batch-remove-charade-and-its-viewing",
1266
1266
  "steps": [
1267
1267
  {
1268
1268
  "index": 0,
1269
1269
  "op": "delete_rows",
1270
1270
  "ok": true,
1271
- "migration_id": "20261020T173832-delete_rows-archive-1-rows-of-watch",
1271
+ "migration_id": "20261024T063907-delete_rows-archive-1-rows-of-watch",
1272
1272
  "result": {
1273
1273
  "ok": true,
1274
1274
  "op": "delete_rows",
@@ -1280,14 +1280,14 @@ Answer (77 lines)
1280
1280
  }
1281
1281
  ],
1282
1282
  "commits": [{ "table": "main.public.watch", "version": 5, "operation": "DELETE" }],
1283
- "migration_id": "20261020T173832-delete_rows-archive-1-rows-of-watch"
1283
+ "migration_id": "20261024T063907-delete_rows-archive-1-rows-of-watch"
1284
1284
  }
1285
1285
  },
1286
1286
  {
1287
1287
  "index": 1,
1288
1288
  "op": "delete_rows",
1289
1289
  "ok": true,
1290
- "migration_id": "20261020T173832-delete_rows-archive-1-rows-of-film",
1290
+ "migration_id": "20261024T063907-delete_rows-archive-1-rows-of-film",
1291
1291
  "result": {
1292
1292
  "ok": true,
1293
1293
  "op": "delete_rows",
@@ -1330,7 +1330,7 @@ Answer (77 lines)
1330
1330
  { "table": "main.public.actor", "version": 7, "operation": "DELETE" },
1331
1331
  { "table": "main.public.film", "version": 18, "operation": "DELETE" }
1332
1332
  ],
1333
- "migration_id": "20261020T173832-delete_rows-archive-1-rows-of-film"
1333
+ "migration_id": "20261024T063907-delete_rows-archive-1-rows-of-film"
1334
1334
  }
1335
1335
  }
1336
1336
  ]
@@ -1348,7 +1348,7 @@ Answer:
1348
1348
  ```markdown
1349
1349
  ---
1350
1350
  table: main.public.actor
1351
- id: 01a15a64-b185-745b-8061-07cff446109d
1351
+ id: 01a16ca2-6a08-747b-b3fd-aca4ce9b450b
1352
1352
  name: Cary Grant
1353
1353
  born: 1904-01-18
1354
1354
  films:
@@ -1370,7 +1370,7 @@ The engine wrote this file with the relations from this page:
1370
1370
 
1371
1371
  ```yaml
1372
1372
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
1373
- id: 01a15a64-b174-7561-bafb-b0a99c2b8276
1373
+ id: 01a16ca2-6985-734f-9ae1-3ae2a9e4fbce
1374
1374
  config:
1375
1375
  history: true
1376
1376
 
@@ -58,7 +58,7 @@ Answer:
58
58
  ```json
59
59
  {
60
60
  "ok": true,
61
- "migration_id": "20261020T173828-create_table-create-table-main-public-film",
61
+ "migration_id": "20261024T063903-create_table-create-table-main-public-film",
62
62
  "summary": null
63
63
  }
64
64
  ```
@@ -67,7 +67,7 @@ Answer:
67
67
 
68
68
  ```yaml
69
69
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
70
- id: 01a15a64-a676-7657-9ff4-7a1e6bcc5df3
70
+ id: 01a16ca2-5f45-719f-8adb-a140728d9eed
71
71
  config:
72
72
  history: true
73
73
 
@@ -379,24 +379,24 @@ Answer:
379
379
  "ok": true,
380
380
  "op": "insert_row",
381
381
  "files_created": 1,
382
- "planned_creates": ["datanotes/main/public/watch/2026-10-20 Nosferatu.md"],
382
+ "planned_creates": ["datanotes/main/public/watch/2026-10-24 Nosferatu.md"],
383
383
  "commits": [{ "table": "main.public.watch", "version": 1, "operation": "WRITE" }],
384
- "migration_id": "20261020T173828-insert_row-insert-into-watch"
384
+ "migration_id": "20261024T063903-insert_row-insert-into-watch"
385
385
  }
386
386
  ```
387
387
 
388
- `datanotes/main/public/watch/2026-10-20 Nosferatu.md` now reads:
388
+ `datanotes/main/public/watch/2026-10-24 Nosferatu.md` now reads:
389
389
 
390
390
  ```markdown
391
391
  ---
392
392
  table: main.public.watch
393
393
  cssclasses:
394
394
  - watch
395
- id: 01a15a64-a8fb-73f8-a4e2-4263d12c1d9d
395
+ id: 01a16ca2-6190-781a-af0d-a0c61192113b
396
396
  film: Nosferatu
397
397
  where: outdoor screening
398
398
  place: the park by the river
399
- occurred_at: 2026-10-20T17:38:28Z
399
+ occurred_at: 2026-10-24T06:39:03Z
400
400
  ---
401
401
  Watched Nosferatu (outdoor screening).
402
402
 
@@ -440,7 +440,7 @@ Answer:
440
440
  "op": "alter_table",
441
441
  "planned_texts": ["datanotes/metastore.yaml"],
442
442
  "commits": [{ "table": "main.public.watch", "version": 2, "operation": "ALTER TABLE" }],
443
- "migration_id": "20261020T173828-alter_table-alter-table-main-public-watch"
443
+ "migration_id": "20261024T063903-alter_table-alter-table-main-public-watch"
444
444
  }
445
445
  ```
446
446
 
@@ -483,7 +483,51 @@ Answer:
483
483
 
484
484
  ## Rename or move a table
485
485
 
486
- `alter_table` renames a table with `name`, or moves it to another `catalog` or `schema`. Here `actors` becomes `actor`, singular like the other tables. The rows’ folder and their front matter key `table` follow, and the engine rewrites the links to them. `dry_run` lists the notes that would move.
486
+ `alter_table` renames a table with `name`, or moves it to another `catalog` or `schema`. Here `actors` becomes `actor`, singular like the other tables. The rows’ folder and their front matter key `table` follow, and the engine rewrites the links to them.
487
+
488
+ The definitions that name the table follow it too:
489
+
490
+ * the `ref` of every link column, lists of links and base columns included
491
+ * the `vocabulary` of every string column
492
+ * the tables a view reads, in `table`, `union` and `join`
493
+
494
+ `dry_run` lists the notes that would move, and `schema_references` lists the names it would rewrite. Here a film’s `lead` links an actor, and the view `cast_list` reads the actors.
495
+
496
+ **`add_column`**
497
+
498
+ ```json
499
+ {
500
+ "table": "classics.film",
501
+ "column": {
502
+ "name": "lead",
503
+ "type": "link",
504
+ "ref": "diary.classics.actors",
505
+ "description": "The actor in the leading role"
506
+ }
507
+ }
508
+ ```
509
+
510
+ **`update_row`**
511
+
512
+ ```json
513
+ {
514
+ "table": "classics.film",
515
+ "path": "datanotes/diary/classics/film/Nosferatu.md",
516
+ "set": { "lead": "[[Max Schreck]]" }
517
+ }
518
+ ```
519
+
520
+ **`create_view`**
521
+
522
+ ```json
523
+ {
524
+ "catalog": "diary",
525
+ "schema": "classics",
526
+ "name": "cast_list",
527
+ "query": { "table": "diary.classics.actors", "columns": ["name"], "order_by": "name" },
528
+ "description": "Every actor, by name"
529
+ }
530
+ ```
487
531
 
488
532
  **`alter_table`**
489
533
 
@@ -515,7 +559,22 @@ Answer:
515
559
  "to": "datanotes/diary/classics/actor/Max Schreck.md"
516
560
  }
517
561
  ],
518
- "planned_texts": ["datanotes/metastore.yaml"]
562
+ "planned_texts": ["datanotes/metastore.yaml"],
563
+ "schema_references": [
564
+ {
565
+ "table": "diary.classics.film",
566
+ "column": "lead",
567
+ "key": "ref",
568
+ "from": "diary.classics.actors",
569
+ "to": "diary.classics.actor"
570
+ },
571
+ {
572
+ "view": "diary.classics.cast_list",
573
+ "key": "table",
574
+ "from": "diary.classics.actors",
575
+ "to": "diary.classics.actor"
576
+ }
577
+ ]
519
578
  }
520
579
  ```
521
580
 
@@ -525,7 +584,7 @@ Answer:
525
584
  { "table": "classics.actors", "name": "actor" }
526
585
  ```
527
586
 
528
- Answer:
587
+ Answer (44 lines)
529
588
 
530
589
  ```json
531
590
  {
@@ -552,9 +611,25 @@ Answer:
552
611
  ],
553
612
  "planned_texts": ["datanotes/metastore.yaml"],
554
613
  "commits": [
555
- { "table": "diary.classics.actor", "version": 6, "operation": "ALTER TABLE" }
614
+ { "table": "diary.classics.actor", "version": 6, "operation": "ALTER TABLE" },
615
+ { "table": "diary.classics.film", "version": 14, "operation": "ALTER TABLE" }
556
616
  ],
557
- "migration_id": "20261020T173845-alter_table-move-table-diary-classics-acto"
617
+ "migration_id": "20261024T063921-alter_table-move-table-diary-classics-acto",
618
+ "schema_references": [
619
+ {
620
+ "table": "diary.classics.film",
621
+ "column": "lead",
622
+ "key": "ref",
623
+ "from": "diary.classics.actors",
624
+ "to": "diary.classics.actor"
625
+ },
626
+ {
627
+ "view": "diary.classics.cast_list",
628
+ "key": "table",
629
+ "from": "diary.classics.actors",
630
+ "to": "diary.classics.actor"
631
+ }
632
+ ]
558
633
  }
559
634
  ```
560
635
 
@@ -566,7 +641,7 @@ Then move it to a schema of its own:
566
641
  { "table": "classics.actor", "catalog": "diary", "schema": "credits" }
567
642
  ```
568
643
 
569
- Answer:
644
+ Answer (44 lines)
570
645
 
571
646
  ```json
572
647
  {
@@ -593,9 +668,25 @@ Answer:
593
668
  ],
594
669
  "planned_texts": ["datanotes/metastore.yaml"],
595
670
  "commits": [
671
+ { "table": "diary.classics.film", "version": 15, "operation": "ALTER TABLE" },
596
672
  { "table": "diary.credits.actor", "version": 7, "operation": "ALTER TABLE" }
597
673
  ],
598
- "migration_id": "20261020T173845-alter_table-move-table-diary-classics-acto-2"
674
+ "migration_id": "20261024T063921-alter_table-move-table-diary-classics-acto-2",
675
+ "schema_references": [
676
+ {
677
+ "table": "diary.classics.film",
678
+ "column": "lead",
679
+ "key": "ref",
680
+ "from": "diary.classics.actor",
681
+ "to": "diary.credits.actor"
682
+ },
683
+ {
684
+ "view": "diary.classics.cast_list",
685
+ "key": "table",
686
+ "from": "diary.classics.actor",
687
+ "to": "diary.credits.actor"
688
+ }
689
+ ]
599
690
  }
600
691
  ```
601
692
 
@@ -615,6 +706,39 @@ Answer:
615
706
  }
616
707
  ```
617
708
 
709
+ The link column and the view now name `diary.credits.actor`, so the view still answers and `check_table` finds no broken link:
710
+
711
+ **`select_rows`**
712
+
713
+ ```json
714
+ { "table": "cast_list" }
715
+ ```
716
+
717
+ Answer:
718
+
719
+ ```json
720
+ {
721
+ "table": "diary.credits.actor",
722
+ "total": 1,
723
+ "rows": [
724
+ { "path": "datanotes/diary/credits/actor/Max Schreck.md", "name": "Max Schreck" }
725
+ ],
726
+ "view": "diary.classics.cast_list"
727
+ }
728
+ ```
729
+
730
+ **`check_table`**
731
+
732
+ ```json
733
+ { "table": "classics.film" }
734
+ ```
735
+
736
+ Answer:
737
+
738
+ ```json
739
+ { "table": "film", "rows_checked": 2, "total": 0, "violations": [] }
740
+ ```
741
+
618
742
  ## Change sub-folders and file names
619
743
 
620
744
  `alter_table` also changes `partition`, the sub-folders, and `filename`, the name pattern. The engine renames every row to fit, and refuses the change when a row can’t fill the pattern.
@@ -657,9 +781,9 @@ Answer:
657
781
  ],
658
782
  "planned_texts": ["datanotes/metastore.yaml"],
659
783
  "commits": [
660
- { "table": "diary.classics.film", "version": 13, "operation": "ALTER TABLE" }
784
+ { "table": "diary.classics.film", "version": 17, "operation": "ALTER TABLE" }
661
785
  ],
662
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-3"
786
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil"
663
787
  }
664
788
  ```
665
789
 
@@ -709,9 +833,9 @@ Answer:
709
833
  ],
710
834
  "planned_texts": ["datanotes/metastore.yaml"],
711
835
  "commits": [
712
- { "table": "diary.classics.film", "version": 14, "operation": "ALTER TABLE" }
836
+ { "table": "diary.classics.film", "version": 18, "operation": "ALTER TABLE" }
713
837
  ],
714
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-4"
838
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-2"
715
839
  }
716
840
  ```
717
841
 
@@ -751,9 +875,9 @@ Answer:
751
875
  "op": "alter_table",
752
876
  "planned_texts": ["datanotes/metastore.yaml"],
753
877
  "commits": [
754
- { "table": "diary.classics.film", "version": 15, "operation": "ALTER TABLE" }
878
+ { "table": "diary.classics.film", "version": 19, "operation": "ALTER TABLE" }
755
879
  ],
756
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-5"
880
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-3"
757
881
  }
758
882
  ```
759
883
 
@@ -771,9 +895,9 @@ Answer:
771
895
  "op": "alter_table",
772
896
  "planned_texts": ["datanotes/metastore.yaml"],
773
897
  "commits": [
774
- { "table": "diary.classics.film", "version": 16, "operation": "ALTER TABLE" }
898
+ { "table": "diary.classics.film", "version": 20, "operation": "ALTER TABLE" }
775
899
  ],
776
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-6"
900
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-4"
777
901
  }
778
902
  ```
779
903
 
@@ -791,9 +915,9 @@ Answer:
791
915
  "op": "alter_table",
792
916
  "planned_texts": ["datanotes/metastore.yaml"],
793
917
  "commits": [
794
- { "table": "diary.classics.film", "version": 17, "operation": "ALTER TABLE" }
918
+ { "table": "diary.classics.film", "version": 21, "operation": "ALTER TABLE" }
795
919
  ],
796
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-7"
920
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-5"
797
921
  }
798
922
  ```
799
923
 
@@ -819,8 +943,8 @@ Answer:
819
943
  "op": "insert_row",
820
944
  "files_created": 1,
821
945
  "planned_creates": ["datanotes/diary/classics/film/1925/Battleship Potemkin (1925).md"],
822
- "commits": [{ "table": "diary.classics.film", "version": 18, "operation": "WRITE" }],
823
- "migration_id": "20261020T173845-insert_row-insert-into-film-3"
946
+ "commits": [{ "table": "diary.classics.film", "version": 22, "operation": "WRITE" }],
947
+ "migration_id": "20261024T063921-insert_row-insert-into-film-3"
824
948
  }
825
949
  ```
826
950
 
@@ -830,7 +954,7 @@ Answer:
830
954
  ---
831
955
  table: diary.classics.film
832
956
  cut: restored
833
- id: 01a15a64-ea48-70a1-84d2-829cc3c9da62
957
+ id: 01a16ca2-a6bc-7cb6-8200-5208c70c73fd
834
958
  title: Battleship Potemkin
835
959
  year: 1925
836
960
  minutes: 75
@@ -859,9 +983,9 @@ Answer:
859
983
  "op": "alter_table",
860
984
  "planned_texts": ["datanotes/metastore.yaml"],
861
985
  "commits": [
862
- { "table": "diary.classics.film", "version": 19, "operation": "ALTER TABLE" }
986
+ { "table": "diary.classics.film", "version": 23, "operation": "ALTER TABLE" }
863
987
  ],
864
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-8"
988
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-6"
865
989
  }
866
990
  ```
867
991
 
@@ -882,8 +1006,8 @@ Answer:
882
1006
  "op": "insert_row",
883
1007
  "files_created": 1,
884
1008
  "planned_creates": ["datanotes/diary/classics/film/1924/Sherlock Jr. (1924).md"],
885
- "commits": [{ "table": "diary.classics.film", "version": 20, "operation": "WRITE" }],
886
- "migration_id": "20261020T173845-insert_row-insert-into-film-4"
1009
+ "commits": [{ "table": "diary.classics.film", "version": 24, "operation": "WRITE" }],
1010
+ "migration_id": "20261024T063921-insert_row-insert-into-film-4"
887
1011
  }
888
1012
  ```
889
1013
 
@@ -893,7 +1017,7 @@ Answer:
893
1017
  ---
894
1018
  table: diary.classics.film
895
1019
  cut: restored
896
- id: 01a15a64-ea5e-737b-a2ef-e105a2e98fdc
1020
+ id: 01a16ca2-a6cd-7965-b3f6-d8fe19c1527b
897
1021
  title: Sherlock Jr.
898
1022
  year: 1924
899
1023
  minutes: 45
@@ -924,9 +1048,9 @@ Answer:
924
1048
  "op": "alter_table",
925
1049
  "planned_texts": ["datanotes/metastore.yaml"],
926
1050
  "commits": [
927
- { "table": "diary.classics.film", "version": 21, "operation": "ALTER TABLE" }
1051
+ { "table": "diary.classics.film", "version": 25, "operation": "ALTER TABLE" }
928
1052
  ],
929
- "migration_id": "20261020T173845-alter_table-alter-table-diary-classics-fil-9"
1053
+ "migration_id": "20261024T063921-alter_table-alter-table-diary-classics-fil-7"
930
1054
  }
931
1055
  ```
932
1056
 
@@ -1008,7 +1132,7 @@ Answer:
1008
1132
  ```json
1009
1133
  {
1010
1134
  "ok": true,
1011
- "migration_id": "20261020T173845-create_table-create-table-diary-log-watch"
1135
+ "migration_id": "20261024T063921-create_table-create-table-diary-log-watch"
1012
1136
  }
1013
1137
  ```
1014
1138
 
@@ -1037,7 +1161,7 @@ Answer:
1037
1161
  "files_created": 1,
1038
1162
  "planned_creates": ["datanotes/diary/log/watch/2026/10/2026-10-06 2130.md"],
1039
1163
  "commits": [{ "table": "diary.log.watch", "version": 1, "operation": "WRITE" }],
1040
- "migration_id": "20261020T173845-insert_row-insert-into-watch"
1164
+ "migration_id": "20261024T063921-insert_row-insert-into-watch"
1041
1165
  }
1042
1166
  ```
1043
1167
 
@@ -1046,7 +1170,7 @@ Answer:
1046
1170
  ```markdown
1047
1171
  ---
1048
1172
  table: diary.log.watch
1049
- id: 01a15a64-eaa5-7d15-957a-55f01a116533
1173
+ id: 01a16ca2-a703-76e7-80ce-9d75d9129f91
1050
1174
  film: "[[Nosferatu (1922)]]"
1051
1175
  occurred_at: 2026-10-06T21:30:00+02:00
1052
1176
  where: outdoor screening
@@ -1082,7 +1206,7 @@ Answer:
1082
1206
  "commits": [
1083
1207
  { "table": "sandbox.classics.film_copy", "version": 0, "operation": "CLONE" }
1084
1208
  ],
1085
- "migration_id": "20261020T173845-clone_table-clone-diary-classics-film-to-s"
1209
+ "migration_id": "20261024T063921-clone_table-clone-diary-classics-film-to-s"
1086
1210
  }
1087
1211
  ```
1088
1212
 
@@ -1148,7 +1272,7 @@ Answer:
1148
1272
  "commits": [
1149
1273
  { "table": "sandbox.classics.film_empty", "version": 0, "operation": "CLONE" }
1150
1274
  ],
1151
- "migration_id": "20261020T173845-clone_table-clone-diary-classics-film-to-s-2"
1275
+ "migration_id": "20261024T063921-clone_table-clone-diary-classics-film-to-s-2"
1152
1276
  }
1153
1277
  ```
1154
1278
 
@@ -1166,7 +1290,7 @@ Answer:
1166
1290
  "catalog": "sandbox",
1167
1291
  "schema": "classics",
1168
1292
  "rows": 0,
1169
- "columns": ["id", "added_on", "title", "year", "minutes", "status", "rating"]
1293
+ "columns": ["id", "added_on", "title", "year", "minutes", "status", "rating", "lead"]
1170
1294
  }
1171
1295
  ```
1172
1296
 
@@ -1230,7 +1354,7 @@ Answer:
1230
1354
  ],
1231
1355
  "planned_texts": ["datanotes/metastore.yaml"],
1232
1356
  "commits": [{ "table": "main.public.scratch", "version": 2, "operation": "DROP TABLE" }],
1233
- "migration_id": "20261020T173828-drop_table-drop-table-scratch"
1357
+ "migration_id": "20261024T063903-drop_table-drop-table-scratch"
1234
1358
  }
1235
1359
  ```
1236
1360
 
@@ -1254,7 +1378,7 @@ The engine wrote this file in its own words. It holds `film`, `watch` and `revie
1254
1378
 
1255
1379
  ```yaml
1256
1380
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
1257
- id: 01a15a64-a676-7657-9ff4-7a1e6bcc5df3
1381
+ id: 01a16ca2-5f45-719f-8adb-a140728d9eed
1258
1382
  config:
1259
1383
  history: true
1260
1384