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.
- package/dist/api/extensions.cjs +1190 -2
- package/dist/api/extensions.js +1190 -2
- package/dist/api/index.cjs +1190 -2
- package/dist/api/index.js +1190 -2
- package/dist/api/mcp.cjs +1190 -2
- package/dist/api/mcp.js +1190 -2
- package/dist/datanotes.cjs +1257 -11
- package/dist/docs/api/operations/alter_table.md +4 -3
- package/dist/docs/api.md +1 -1
- package/dist/docs/guides/data-quality/check-constraints.md +10 -10
- package/dist/docs/guides/data-quality/hand-edits.md +8 -8
- package/dist/docs/guides/database-objects/bases.md +11 -11
- package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
- package/dist/docs/guides/database-objects/columns.md +38 -38
- package/dist/docs/guides/database-objects/relations.md +28 -28
- package/dist/docs/guides/database-objects/tables.md +167 -43
- package/dist/docs/guides/database-objects/views.md +44 -44
- package/dist/docs/guides/history/change-data-feed.md +34 -34
- package/dist/docs/guides/history/journal-and-undo.md +12 -12
- package/dist/docs/guides/history/restore.md +20 -20
- package/dist/docs/guides/history/table-history.md +31 -31
- package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
- package/dist/docs/guides/read-and-write/import-notes.md +20 -20
- package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
- package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
- package/dist/docs/guides/read-and-write/write-rows.md +10 -10
- package/dist/docs/guides/search/text.md +1 -1
- package/dist/docs/reference/cli.md +1 -1
- package/dist/docs/reference/operations/auxiliary.md +1 -1
- package/dist/docs/reference/operations/rows.md +1 -1
- package/dist/docs/reference/operations/schema.md +3 -3
- package/dist/docs/reference/operations.md +4 -4
- package/dist/docs/release-notes.md +16 -0
- package/package.json +1 -1
|
@@ -314,7 +314,7 @@ Answer:
|
|
|
314
314
|
"op": "create_table",
|
|
315
315
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
316
316
|
"commits": [{ "table": "main.public.film", "version": 0, "operation": "CREATE TABLE" }],
|
|
317
|
-
"migration_id": "
|
|
317
|
+
"migration_id": "20261024T053830-create_table-create-table-main-public-film"
|
|
318
318
|
}
|
|
319
319
|
```
|
|
320
320
|
|
|
@@ -359,7 +359,7 @@ Answer (70 lines)
|
|
|
359
359
|
"path": "Films/Charade.md",
|
|
360
360
|
"set": {
|
|
361
361
|
"table": "main.public.film",
|
|
362
|
-
"id": "
|
|
362
|
+
"id": "01a16c6a-f3d8-7a71-935b-e3cdd49c2cec",
|
|
363
363
|
"director": "Stanley Donen",
|
|
364
364
|
"title": "Charade"
|
|
365
365
|
},
|
|
@@ -369,7 +369,7 @@ Answer (70 lines)
|
|
|
369
369
|
"path": "Films/His Girl Friday.md",
|
|
370
370
|
"set": {
|
|
371
371
|
"table": "main.public.film",
|
|
372
|
-
"id": "
|
|
372
|
+
"id": "01a16c6a-f3d8-7b3a-a052-76112f5037b7",
|
|
373
373
|
"director": "Howard Hawks",
|
|
374
374
|
"title": "His Girl Friday"
|
|
375
375
|
},
|
|
@@ -379,7 +379,7 @@ Answer (70 lines)
|
|
|
379
379
|
"path": "Films/Metropolis.md",
|
|
380
380
|
"set": {
|
|
381
381
|
"table": "main.public.film",
|
|
382
|
-
"id": "
|
|
382
|
+
"id": "01a16c6a-f3d8-7dda-93e2-1ad75dd46ee2",
|
|
383
383
|
"director": "Fritz Lang",
|
|
384
384
|
"title": "Metropolis"
|
|
385
385
|
},
|
|
@@ -389,7 +389,7 @@ Answer (70 lines)
|
|
|
389
389
|
"path": "Films/Nosferatu.md",
|
|
390
390
|
"set": {
|
|
391
391
|
"table": "main.public.film",
|
|
392
|
-
"id": "
|
|
392
|
+
"id": "01a16c6a-f3d8-7b11-bdee-5230b4678352",
|
|
393
393
|
"director": "F. W. Murnau",
|
|
394
394
|
"title": "Nosferatu"
|
|
395
395
|
},
|
|
@@ -399,7 +399,7 @@ Answer (70 lines)
|
|
|
399
399
|
"path": "Films/The Gold Rush.md",
|
|
400
400
|
"set": {
|
|
401
401
|
"table": "main.public.film",
|
|
402
|
-
"id": "
|
|
402
|
+
"id": "01a16c6a-f3d8-71bc-a2b9-70a1be84f56f",
|
|
403
403
|
"director": "Charlie Chaplin",
|
|
404
404
|
"title": "The Gold Rush"
|
|
405
405
|
},
|
|
@@ -458,7 +458,7 @@ Answer (73 lines)
|
|
|
458
458
|
"path": "Films/Charade.md",
|
|
459
459
|
"set": {
|
|
460
460
|
"table": "main.public.film",
|
|
461
|
-
"id": "
|
|
461
|
+
"id": "01a16c6a-f3db-705d-a092-d386d6b8d680",
|
|
462
462
|
"director": "Stanley Donen",
|
|
463
463
|
"title": "Charade"
|
|
464
464
|
},
|
|
@@ -468,7 +468,7 @@ Answer (73 lines)
|
|
|
468
468
|
"path": "Films/His Girl Friday.md",
|
|
469
469
|
"set": {
|
|
470
470
|
"table": "main.public.film",
|
|
471
|
-
"id": "
|
|
471
|
+
"id": "01a16c6a-f3db-7ce9-9b15-ffdf1d9e94f9",
|
|
472
472
|
"director": "Howard Hawks",
|
|
473
473
|
"title": "His Girl Friday"
|
|
474
474
|
},
|
|
@@ -478,7 +478,7 @@ Answer (73 lines)
|
|
|
478
478
|
"path": "Films/Metropolis.md",
|
|
479
479
|
"set": {
|
|
480
480
|
"table": "main.public.film",
|
|
481
|
-
"id": "
|
|
481
|
+
"id": "01a16c6a-f3db-73dd-9ca7-c1c2c0456765",
|
|
482
482
|
"director": "Fritz Lang",
|
|
483
483
|
"title": "Metropolis"
|
|
484
484
|
},
|
|
@@ -488,7 +488,7 @@ Answer (73 lines)
|
|
|
488
488
|
"path": "Films/Nosferatu.md",
|
|
489
489
|
"set": {
|
|
490
490
|
"table": "main.public.film",
|
|
491
|
-
"id": "
|
|
491
|
+
"id": "01a16c6a-f3db-7a47-8726-24e829d99493",
|
|
492
492
|
"director": "F. W. Murnau",
|
|
493
493
|
"title": "Nosferatu"
|
|
494
494
|
},
|
|
@@ -498,7 +498,7 @@ Answer (73 lines)
|
|
|
498
498
|
"path": "Films/The Gold Rush.md",
|
|
499
499
|
"set": {
|
|
500
500
|
"table": "main.public.film",
|
|
501
|
-
"id": "
|
|
501
|
+
"id": "01a16c6a-f3db-77f9-a8b3-30bb65a6cc26",
|
|
502
502
|
"director": "Charlie Chaplin",
|
|
503
503
|
"title": "The Gold Rush"
|
|
504
504
|
},
|
|
@@ -519,7 +519,7 @@ Answer (73 lines)
|
|
|
519
519
|
}
|
|
520
520
|
],
|
|
521
521
|
"commits": [{ "table": "main.public.film", "version": 1, "operation": "ADOPT ROWS" }],
|
|
522
|
-
"migration_id": "
|
|
522
|
+
"migration_id": "20261024T053831-adopt_rows-adopt-5-notes-into-film"
|
|
523
523
|
}
|
|
524
524
|
```
|
|
525
525
|
|
|
@@ -536,7 +536,7 @@ Answer:
|
|
|
536
536
|
```markdown
|
|
537
537
|
---
|
|
538
538
|
table: main.public.film
|
|
539
|
-
id:
|
|
539
|
+
id: 01a16c6a-f3db-705d-a092-d386d6b8d680
|
|
540
540
|
year: 1963
|
|
541
541
|
minutes: 113
|
|
542
542
|
status: watched
|
|
@@ -623,7 +623,7 @@ Answer:
|
|
|
623
623
|
"files_created": 1,
|
|
624
624
|
"planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
|
|
625
625
|
"commits": [{ "table": "main.public.film", "version": 2, "operation": "WRITE" }],
|
|
626
|
-
"migration_id": "
|
|
626
|
+
"migration_id": "20261024T053831-insert_row-insert-into-film"
|
|
627
627
|
}
|
|
628
628
|
```
|
|
629
629
|
|
|
@@ -655,7 +655,7 @@ Answer:
|
|
|
655
655
|
"op": "add_column",
|
|
656
656
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
657
657
|
"commits": [{ "table": "main.public.film", "version": 4, "operation": "ADD COLUMNS" }],
|
|
658
|
-
"migration_id": "
|
|
658
|
+
"migration_id": "20261024T053832-add_column-add-column-added_by-to-film"
|
|
659
659
|
}
|
|
660
660
|
```
|
|
661
661
|
|
|
@@ -683,7 +683,7 @@ Answer:
|
|
|
683
683
|
"files_created": 1,
|
|
684
684
|
"planned_creates": ["datanotes/main/public/film/Night of the Living Dead.md"],
|
|
685
685
|
"commits": [{ "table": "main.public.film", "version": 5, "operation": "WRITE" }],
|
|
686
|
-
"migration_id": "
|
|
686
|
+
"migration_id": "20261024T053832-insert_row-insert-into-film"
|
|
687
687
|
}
|
|
688
688
|
```
|
|
689
689
|
|
|
@@ -692,7 +692,7 @@ Answer:
|
|
|
692
692
|
```markdown
|
|
693
693
|
---
|
|
694
694
|
table: main.public.film
|
|
695
|
-
id:
|
|
695
|
+
id: 01a16c6a-f9d0-7e20-8311-52386a251707
|
|
696
696
|
director: George A. Romero
|
|
697
697
|
minutes: 96
|
|
698
698
|
status: to watch
|
|
@@ -734,7 +734,7 @@ Answer:
|
|
|
734
734
|
```markdown
|
|
735
735
|
---
|
|
736
736
|
table: main.public.film
|
|
737
|
-
id:
|
|
737
|
+
id: 01a16c6a-fc6c-7872-89fb-d51beace835e
|
|
738
738
|
year: 1924
|
|
739
739
|
minutes: 45
|
|
740
740
|
status: to watch
|
|
@@ -762,7 +762,7 @@ Answer:
|
|
|
762
762
|
"op": "alter_table",
|
|
763
763
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
764
764
|
"commits": [{ "table": "main.public.film", "version": 7, "operation": "ALTER TABLE" }],
|
|
765
|
-
"migration_id": "
|
|
765
|
+
"migration_id": "20261024T053835-alter_table-alter-table-main-public-film"
|
|
766
766
|
}
|
|
767
767
|
```
|
|
768
768
|
|
|
@@ -825,7 +825,7 @@ This is the table as you inferred, corrected and extended it on this page. Its d
|
|
|
825
825
|
|
|
826
826
|
```yaml
|
|
827
827
|
# Metastore (Datanotes): catalogs, schemas, tables, columns, views.
|
|
828
|
-
id:
|
|
828
|
+
id: 01a16c6a-f3c8-7bd8-8ca7-e31ab9cbc5a7
|
|
829
829
|
config:
|
|
830
830
|
history: true
|
|
831
831
|
|
|
@@ -100,9 +100,9 @@ Answer:
|
|
|
100
100
|
"table": "main.public.watch",
|
|
101
101
|
"total": 3,
|
|
102
102
|
"rows": [
|
|
103
|
-
{ "date(occurred_at)": "2026-10-
|
|
104
|
-
{ "date(occurred_at)": "2026-10-
|
|
105
|
-
{ "date(occurred_at)": "2026-10-
|
|
103
|
+
{ "date(occurred_at)": "2026-10-19", "viewings": 1 },
|
|
104
|
+
{ "date(occurred_at)": "2026-10-22", "viewings": 1 },
|
|
105
|
+
{ "date(occurred_at)": "2026-10-23", "viewings": 1 }
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
```
|
|
@@ -138,10 +138,10 @@ Answer:
|
|
|
138
138
|
{
|
|
139
139
|
"path": "datanotes/main/public/film/Night of the Living Dead.md",
|
|
140
140
|
"title": "Night of the Living Dead",
|
|
141
|
-
"watched_on": "2026-10-
|
|
141
|
+
"watched_on": "2026-10-23",
|
|
142
142
|
"viewing": [
|
|
143
143
|
{
|
|
144
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
144
|
+
"path": "datanotes/main/public/watch/2026-10-23T2200.md",
|
|
145
145
|
"where": "cinema",
|
|
146
146
|
"with": "Oscar"
|
|
147
147
|
}
|
|
@@ -150,10 +150,10 @@ Answer:
|
|
|
150
150
|
{
|
|
151
151
|
"path": "datanotes/main/public/film/The Gold Rush.md",
|
|
152
152
|
"title": "The Gold Rush",
|
|
153
|
-
"watched_on": "2026-10-
|
|
153
|
+
"watched_on": "2026-10-22",
|
|
154
154
|
"viewing": [
|
|
155
155
|
{
|
|
156
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
156
|
+
"path": "datanotes/main/public/watch/2026-10-22T2030.md",
|
|
157
157
|
"where": "home",
|
|
158
158
|
"with": "my sister"
|
|
159
159
|
}
|
|
@@ -332,23 +332,23 @@ Answer:
|
|
|
332
332
|
"total": 3,
|
|
333
333
|
"rows": [
|
|
334
334
|
{
|
|
335
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
335
|
+
"path": "datanotes/main/public/watch/2026-10-19T2115.md",
|
|
336
336
|
"film": "[[Charade]]",
|
|
337
|
-
"occurred_at": "2026-10-
|
|
337
|
+
"occurred_at": "2026-10-19T21:15",
|
|
338
338
|
"where": "home",
|
|
339
339
|
"place": "my living room"
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
342
|
+
"path": "datanotes/main/public/watch/2026-10-22T2030.md",
|
|
343
343
|
"film": "[[The Gold Rush]]",
|
|
344
|
-
"occurred_at": "2026-10-
|
|
344
|
+
"occurred_at": "2026-10-22T20:30",
|
|
345
345
|
"where": "home",
|
|
346
346
|
"place": "my living room"
|
|
347
347
|
},
|
|
348
348
|
{
|
|
349
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
349
|
+
"path": "datanotes/main/public/watch/2026-10-23T2200.md",
|
|
350
350
|
"film": "[[Night of the Living Dead]]",
|
|
351
|
-
"occurred_at": "2026-10-
|
|
351
|
+
"occurred_at": "2026-10-23T22:00",
|
|
352
352
|
"where": "cinema",
|
|
353
353
|
"place": "the film club downtown"
|
|
354
354
|
}
|
|
@@ -459,12 +459,12 @@ Answer:
|
|
|
459
459
|
"total": 7,
|
|
460
460
|
"rows": [
|
|
461
461
|
{
|
|
462
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
463
|
-
"occurred_at": "2026-10-
|
|
462
|
+
"path": "datanotes/main/public/watch/2026-10-19T2115.md",
|
|
463
|
+
"occurred_at": "2026-10-19T21:15"
|
|
464
464
|
},
|
|
465
465
|
{
|
|
466
|
-
"path": "datanotes/main/public/watch/2026-10-
|
|
467
|
-
"occurred_at": "2026-10-
|
|
466
|
+
"path": "datanotes/main/public/watch/2026-10-15T2130.md",
|
|
467
|
+
"occurred_at": "2026-10-15T21:30"
|
|
468
468
|
}
|
|
469
469
|
]
|
|
470
470
|
}
|
|
@@ -31,7 +31,7 @@ Answer:
|
|
|
31
31
|
"files_created": 1,
|
|
32
32
|
"planned_creates": ["datanotes/main/public/film/Metropolis.md"],
|
|
33
33
|
"commits": [{ "table": "main.public.film", "version": 1, "operation": "WRITE" }],
|
|
34
|
-
"migration_id": "
|
|
34
|
+
"migration_id": "20261024T053819-insert_row-insert-into-film"
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ Answer:
|
|
|
40
40
|
```markdown
|
|
41
41
|
---
|
|
42
42
|
table: main.public.film
|
|
43
|
-
id:
|
|
43
|
+
id: 01a16c6a-c7b1-7337-8349-70046fead6ac
|
|
44
44
|
title: Metropolis
|
|
45
45
|
year: 1927
|
|
46
46
|
minutes: 153
|
|
@@ -103,7 +103,7 @@ Answer:
|
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"commits": [{ "table": "main.public.film", "version": 6, "operation": "UPDATE" }],
|
|
106
|
-
"migration_id": "
|
|
106
|
+
"migration_id": "20261024T053823-update_row-update-film"
|
|
107
107
|
}
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -174,7 +174,7 @@ Answer:
|
|
|
174
174
|
}
|
|
175
175
|
],
|
|
176
176
|
"commits": [{ "table": "main.public.film", "version": 8, "operation": "UPDATE" }],
|
|
177
|
-
"migration_id": "
|
|
177
|
+
"migration_id": "20261024T053823-update_row-update-film-3",
|
|
178
178
|
"ambiguous_mentions": [
|
|
179
179
|
{
|
|
180
180
|
"path": "datanotes/main/public/film/Nosferatu.md",
|
|
@@ -193,7 +193,7 @@ Answer:
|
|
|
193
193
|
```markdown
|
|
194
194
|
---
|
|
195
195
|
table: main.public.film
|
|
196
|
-
id:
|
|
196
|
+
id: 01a16c6a-d656-749e-960a-7aa338a198ae
|
|
197
197
|
title: Nosferatu
|
|
198
198
|
year: 1922
|
|
199
199
|
status: watched
|
|
@@ -246,7 +246,7 @@ Answer:
|
|
|
246
246
|
}
|
|
247
247
|
],
|
|
248
248
|
"commits": [{ "table": "main.public.film", "version": 9, "operation": "UPDATE" }],
|
|
249
|
-
"migration_id": "
|
|
249
|
+
"migration_id": "20261024T053823-update_row-update-film-4"
|
|
250
250
|
}
|
|
251
251
|
```
|
|
252
252
|
|
|
@@ -332,7 +332,7 @@ Answer:
|
|
|
332
332
|
}
|
|
333
333
|
],
|
|
334
334
|
"commits": [{ "table": "main.public.film", "version": 10, "operation": "UPDATE" }],
|
|
335
|
-
"migration_id": "
|
|
335
|
+
"migration_id": "20261024T053823-update_rows-update-film"
|
|
336
336
|
}
|
|
337
337
|
```
|
|
338
338
|
|
|
@@ -370,7 +370,7 @@ Answer:
|
|
|
370
370
|
],
|
|
371
371
|
"planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
|
|
372
372
|
"commits": [{ "table": "main.public.film", "version": 11, "operation": "MERGE" }],
|
|
373
|
-
"migration_id": "
|
|
373
|
+
"migration_id": "20261024T053823-merge_rows-merge-2-rows-into-film"
|
|
374
374
|
}
|
|
375
375
|
```
|
|
376
376
|
|
|
@@ -431,7 +431,7 @@ Answer:
|
|
|
431
431
|
}
|
|
432
432
|
],
|
|
433
433
|
"commits": [{ "table": "main.public.film", "version": 12, "operation": "DELETE" }],
|
|
434
|
-
"migration_id": "
|
|
434
|
+
"migration_id": "20261024T053823-delete_rows-archive-1-rows-of-film"
|
|
435
435
|
}
|
|
436
436
|
```
|
|
437
437
|
|
|
@@ -568,6 +568,6 @@ Answer (51 lines)
|
|
|
568
568
|
{ "table": "main.public.film", "version": 22, "operation": "MOVE ROWS" },
|
|
569
569
|
{ "table": "main.public.watchlist", "version": 1, "operation": "MOVE ROWS" }
|
|
570
570
|
],
|
|
571
|
-
"migration_id": "
|
|
571
|
+
"migration_id": "20261024T053823-move_rows-move-4-rows-from-film-to-watch"
|
|
572
572
|
}
|
|
573
573
|
```
|
|
@@ -68,7 +68,7 @@ Examples: [Catalogs, schemas and the database](https://datanotes.dev/guides/data
|
|
|
68
68
|
|
|
69
69
|
Validate every row against the table (required, types, ranges, enums, links, unknown columns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, cycles of hierarchy and acyclic columns, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). A CHECK violation has code `check` and the CHECK’s name as `constraint` (every other code names its `column`), as in the `violations` of list_changes. Use it to find rows edited by hand that break the schema. Without `table`, every table is checked: each row then names its `table`, `tables_checked` counts the tables checked, and a table that cannot be checked is listed in `errors` ({table, error}) while the others are. The rows with violations are paged: `limit` (default 500, at most 5000) from `offset`; `total` counts them all. (Hand edits are also checked as they happen: see `violations` in list_changes.)
|
|
70
70
|
|
|
71
|
-
Examples: [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/).
|
|
71
|
+
Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/).
|
|
72
72
|
|
|
73
73
|
| Parameter | Type | Required | Default | Description |
|
|
74
74
|
| --------- | --------- | -------- | ------- | -------------------------------------------- |
|
|
@@ -34,7 +34,7 @@ Update exactly ONE row, addressed by its `id` (the system UUID) or its `path`; r
|
|
|
34
34
|
* `expect`: compare-and-set — `{"status": "open"}` writes only if the row still has those values (a person may have changed it since you read it); otherwise refused, nothing written.
|
|
35
35
|
* `autolink`: the text written links the notes it mentions by name, at their first mention (off with `autolink: false` or the database’s setting). `links_added` lists the links made; `ambiguous_mentions` the mentions left as text with the notes they may name: read those, then link the right one with update_row and `autolink: false`, or leave the text.
|
|
36
36
|
|
|
37
|
-
Examples: [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/).
|
|
37
|
+
Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/).
|
|
38
38
|
|
|
39
39
|
| Parameter | Type | Required | Default | Description |
|
|
40
40
|
| --------------- | ------------ | -------- | ------- | ----------- |
|
|
@@ -65,7 +65,7 @@ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/).
|
|
|
65
65
|
|
|
66
66
|
**Alter Table** · destructive write
|
|
67
67
|
|
|
68
|
-
Alter a table: move it (`catalog`, `schema`), rename it (`name`), change `partition` / `filename` patterns, `description` (changes, never goes: “” is refused), `aliases`, `exclude` folders, `row_template` (“” removes it), `instructions` (how to fill a row, for agents; “” removes them), `history` (true | false | “default”), `autolink_target` (true | false | “default”: may automatic links link its rows? default: yes, unless its rows are named by a date or a time) or `tags` (key/value labels merged into the table’s, e.g. `{"domain": "health"}`; a `null` value removes that tag; `clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those), `archive` (folder name inside the table folder) or `fields` (untyped fields, name → default; a `null` value removes one). Rows, archive and transaction log follow; links are updated; renamed rows keep their old name in `aliases`. A change of metadata only (tags, description, aliases, history, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused when a row cannot fill a pattern. Renaming or moving the table
|
|
68
|
+
Alter a table: move it (`catalog`, `schema`), rename it (`name`), change `partition` / `filename` patterns, `description` (changes, never goes: “” is refused), `aliases`, `exclude` folders, `row_template` (“” removes it), `instructions` (how to fill a row, for agents; “” removes them), `history` (true | false | “default”), `autolink_target` (true | false | “default”: may automatic links link its rows? default: yes, unless its rows are named by a date or a time) or `tags` (key/value labels merged into the table’s, e.g. `{"domain": "health"}`; a `null` value removes that tag; `clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those), `archive` (folder name inside the table folder) or `fields` (untyped fields, name → default; a `null` value removes one). Rows, archive and transaction log follow; links are updated; renamed rows keep their old name in `aliases`. A change of metadata only (tags, description, aliases, history, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused when a row cannot fill a pattern. Renaming or moving the table rewrites what names it in other definitions: the `ref` and `vocabulary` of the columns of other tables and bases (lists of links included) and the tables of views (`table`, `union[].table`, `join.table`); `schema_references` 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.
|
|
69
69
|
|
|
70
70
|
The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
|
|
71
71
|
|
|
@@ -119,7 +119,7 @@ Add a typed column. Sparse by default (written only on rows that have a value
|
|
|
119
119
|
|
|
120
120
|
The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
|
|
121
121
|
|
|
122
|
-
Examples: [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/).
|
|
122
|
+
Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/).
|
|
123
123
|
|
|
124
124
|
| Parameter | Type | Required | Default | Description |
|
|
125
125
|
| --------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------- |
|
|
@@ -290,7 +290,7 @@ Create (or `replace`) a view: a named select stored in metastore.yaml. Name it w
|
|
|
290
290
|
|
|
291
291
|
The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
|
|
292
292
|
|
|
293
|
-
Examples: [Views](https://datanotes.dev/guides/database-objects/views/).
|
|
293
|
+
Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Views](https://datanotes.dev/guides/database-objects/views/).
|
|
294
294
|
|
|
295
295
|
| Parameter | Type | Required | Default | Description |
|
|
296
296
|
| ------------- | ------------ | -------- | ------- | ----------- |
|
|
@@ -16,7 +16,7 @@ Operations that define the database: tables, columns, constraints, bases and vie
|
|
|
16
16
|
| [`drop_table`](https://datanotes.dev/reference/operations/schema/#drop_table) | Drop a table. | [Tables](https://datanotes.dev/guides/database-objects/tables/) |
|
|
17
17
|
| [`alter_table`](https://datanotes.dev/reference/operations/schema/#alter_table) | Alter a table: move it (`catalog`, `schema`), rename it (`name`), change `partition` / `filename` patterns, `description` (changes, never goes: “” is refused), `aliases`, `exclude` folders, `row_template` (“” removes it), `instructions` (how to fill a row, for agents; “” removes them), `history` (true \| false \| “default”), `autolink_target` (true \| false \| “default”: may automatic links link its rows? default: yes, unless its rows are named by a date or a time) or `tags` (key/value labels merged into the table’s, e.g. | [Catalogs, schemas and the database](https://datanotes.dev/guides/database-objects/catalogs-and-schemas/), [Tables](https://datanotes.dev/guides/database-objects/tables/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/) |
|
|
18
18
|
| [`clone_table`](https://datanotes.dev/reference/operations/schema/#clone_table) | CREATE TABLE `target` CLONE `source`: same definition plus independent copies of its rows (deep clone), optionally as of a `version` / `timestamp`. | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/) |
|
|
19
|
-
| [`add_column`](https://datanotes.dev/reference/operations/schema/#add_column) | Add a typed column. | [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/)
|
|
19
|
+
| [`add_column`](https://datanotes.dev/reference/operations/schema/#add_column) | Add a typed column. | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/) |
|
|
20
20
|
| [`rename_column`](https://datanotes.dev/reference/operations/schema/#rename_column) | Rename a column in metastore.yaml and on every row. | [Columns and types](https://datanotes.dev/guides/database-objects/columns/) |
|
|
21
21
|
| [`drop_column`](https://datanotes.dev/reference/operations/schema/#drop_column) | Remove a column from the schema and every row. | [Columns and types](https://datanotes.dev/guides/database-objects/columns/) |
|
|
22
22
|
| [`alter_column`](https://datanotes.dev/reference/operations/schema/#alter_column) | Change a column’s attributes (type, min/max/step, values, required, default, label, aliases, description, note, `ref_where`, `ref_by` (see list_link_targets), `acyclic` (refused while the rows already form a cycle: they are listed); `null` removes an attribute, except `description`, which changes but never goes (null or “” is refused); `dense` true/false). | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/) |
|
|
@@ -26,7 +26,7 @@ Operations that define the database: tables, columns, constraints, bases and vie
|
|
|
26
26
|
| [`set_table_bases`](https://datanotes.dev/reference/operations/schema/#set_table_bases) | Set the bases a table inherits from (`bases`, in order; `[]` removes them). | [Bases](https://datanotes.dev/guides/database-objects/bases/) |
|
|
27
27
|
| [`add_constraint`](https://datanotes.dev/reference/operations/schema/#add_constraint) | ALTER TABLE ADD CONSTRAINT `name` CHECK: `check` is a where filter every row must match, e.g. | [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/) |
|
|
28
28
|
| [`drop_constraint`](https://datanotes.dev/reference/operations/schema/#drop_constraint) | Remove the CHECK constraint `name` from `table`. | [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/) |
|
|
29
|
-
| [`create_view`](https://datanotes.dev/reference/operations/schema/#create_view) | Create (or `replace`) a view: a named select stored in metastore.yaml. | [Views](https://datanotes.dev/guides/database-objects/views/)
|
|
29
|
+
| [`create_view`](https://datanotes.dev/reference/operations/schema/#create_view) | Create (or `replace`) a view: a named select stored in metastore.yaml. | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Views](https://datanotes.dev/guides/database-objects/views/) |
|
|
30
30
|
| [`drop_view`](https://datanotes.dev/reference/operations/schema/#drop_view) | Remove a view from `metastore.yaml` (undo with `undo_migration`). | [Views](https://datanotes.dev/guides/database-objects/views/) |
|
|
31
31
|
|
|
32
32
|
## Rows (DML)
|
|
@@ -36,7 +36,7 @@ Operations that write rows: insert, update, merge, delete, move, adopt and batch
|
|
|
36
36
|
| Operation | What it does | Examples |
|
|
37
37
|
| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
38
|
| [`insert_row`](https://datanotes.dev/reference/operations/rows/#insert_row) | Insert a row (new note). | [Catalogs, schemas and the database](https://datanotes.dev/guides/database-objects/catalogs-and-schemas/), [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Validation](https://datanotes.dev/guides/data-quality/validation/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/) |
|
|
39
|
-
| [`update_row`](https://datanotes.dev/reference/operations/rows/#update_row) | Update exactly ONE row, addressed by its `id` (the system UUID) or its `path`; refused when the row does not exist (or id and path disagree). | [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/)
|
|
39
|
+
| [`update_row`](https://datanotes.dev/reference/operations/rows/#update_row) | Update exactly ONE row, addressed by its `id` (the system UUID) or its `path`; refused when the row does not exist (or id and path disagree). | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/) |
|
|
40
40
|
| [`update_rows`](https://datanotes.dev/reference/operations/rows/#update_rows) | Update every row matching `where` (required: `{}` is every row). | [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/) |
|
|
41
41
|
| [`merge_rows`](https://datanotes.dev/reference/operations/rows/#merge_rows) | MERGE (upsert) `rows` into `table` by the key columns `on` (e.g. | [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/) |
|
|
42
42
|
| [`delete_rows`](https://datanotes.dev/reference/operations/rows/#delete_rows) | Delete rows matching `where`. | [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/) |
|
|
@@ -90,7 +90,7 @@ Operations that describe and check the database, configure it and maintain its i
|
|
|
90
90
|
| [`describe_table`](https://datanotes.dev/reference/operations/auxiliary/#describe_table) | Describe a table (`catalog.schema.table` or a shorter unambiguous name): `qualified`, `name`, `catalog`, `schema`, `description`, `aliases`, `layout` (`folder`, `row_folder`: the folder pattern of new rows, `archive`), `options` (`partition`, `filename`, `archive`, `exclude`), typed `columns` with label/aliases/description and the dense flag, `untyped_fields`, `row_count`, and when set: `tags`, `bases` (the bases it inherits from, in order), `constraints` (its CHECKs, name → where), `constraint_hints` (their own hints, name → hint), `instructions` (how to fill a row: follow them before you write one), `row_template`, `history`, `autolink_target`, `fields` (their values). | [Catalogs, schemas and the database](https://datanotes.dev/guides/database-objects/catalogs-and-schemas/), [Tables](https://datanotes.dev/guides/database-objects/tables/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/) |
|
|
91
91
|
| [`describe_database`](https://datanotes.dev/reference/operations/auxiliary/#describe_database) | Describe the database: its folder (`root`), `metastore` (`metastore.yaml`: read it freely, but it is read-only for agents and changes only through the schema operations), configuration (default catalog and schema, row partition and file-name formats, archive folder, time zone, history, automatic links), journal folder, `bases` (shared column sets and the tables using them), `catalogs` → `schemas` → `tables` (with `row_count`, `tags`, and `unreadable_count` when some rows’ front matter cannot be read) and `views`; catalogs and schemas show their `comment` (set with `comment_on`). | [Catalogs, schemas and the database](https://datanotes.dev/guides/database-objects/catalogs-and-schemas/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/) |
|
|
92
92
|
| [`configure_database`](https://datanotes.dev/reference/operations/auxiliary/#configure_database) | Configure the database (persisted in metastore.yaml `config:`): `root` (rename the database folder; links follow; revert by renaming back), `default_catalog`, `default_schema`, `default_partition` (“” = flat) and `default_filename` (date formats for new time-based tables), `archive_folder`, `timezone` (IANA; completes date-times written without offset), `history` (transaction log for every table: true in a database the engine creates, false when `config` lacks it, as in a metastore from before 3.0.0; change it only on the user’s request), `autolink` (the text a write puts in a body links the notes it mentions; on by default). | [Catalogs, schemas and the database](https://datanotes.dev/guides/database-objects/catalogs-and-schemas/), [Tables](https://datanotes.dev/guides/database-objects/tables/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/) |
|
|
93
|
-
| [`check_table`](https://datanotes.dev/reference/operations/auxiliary/#check_table) | Validate every row against the table (required, types, ranges, enums, links, unknown columns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, cycles of hierarchy and acyclic columns, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). | [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/)
|
|
93
|
+
| [`check_table`](https://datanotes.dev/reference/operations/auxiliary/#check_table) | Validate every row against the table (required, types, ranges, enums, links, unknown columns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, cycles of hierarchy and acyclic columns, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). | [Tables](https://datanotes.dev/guides/database-objects/tables/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/) |
|
|
94
94
|
| [`infer_table`](https://datanotes.dev/reference/operations/auxiliary/#infer_table) | Read-only schema inference from notes’ front matter. | [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/) |
|
|
95
95
|
| [`describe_semantic_index`](https://datanotes.dev/reference/operations/auxiliary/#describe_semantic_index) | The semantic search index: `enabled`, `provider`, `model`, `files`, `passages`, `pending`, `running`, `last_sync`, `last_error`. | [Find notes by meaning](https://datanotes.dev/guides/search/semantic/) |
|
|
96
96
|
| [`sync_semantic_index`](https://datanotes.dev/reference/operations/auxiliary/#sync_semantic_index) | Bring the semantic search index up to date: embed the notes changed since the last run (the engine also does it on its own about ten seconds after edits). | [Find notes by meaning](https://datanotes.dev/guides/search/semantic/) |
|
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
This page lists each version of Datanotes, newest first. Datanotes follows [semantic versioning](https://semver.org): a major version can break what you rely on, and its notes list those changes first. The package is on [npm](https://www.npmjs.com/package/datanotes), and each version has a [GitHub release](https://github.com/davidefornelli/datanotes/releases).
|
|
6
6
|
|
|
7
|
+
## 3.3.1
|
|
8
|
+
|
|
9
|
+
Datanotes 3.3.1 fixes `alter_table` when it renames or moves a table. It only adds to 3.3: no operation, argument or setting goes away.
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
* **References follow a moved table**: `alter_table` with `name`, `catalog` or `schema` rewrites every name of the table in the other definitions. Before, the links of other tables kept the old name, and `check_table` then reported a `ref` violation on every row. The engine now rewrites:
|
|
14
|
+
|
|
15
|
+
* the `ref` of link columns and lists of links, in tables and in bases
|
|
16
|
+
* the `vocabulary` of string columns
|
|
17
|
+
* the tables a view reads, in `table`, `union` and `join`
|
|
18
|
+
|
|
19
|
+
* **`schema_references`**: a new field of the answer lists each name rewritten, also on a dry run. `undo_migration` puts the old names back. [Rename or move a table](https://datanotes.dev/guides/database-objects/tables/#rename-or-move-a-table) shows it.
|
|
20
|
+
|
|
21
|
+
* **CHECKs and link filters**: a CHECK that follows links, or a `ref_where` / `ref_by`, that reads the table through a link no longer refuses the move. These rules name columns, not tables, so they follow the rewritten `ref`. `drop_table` still refuses while they read the table.
|
|
22
|
+
|
|
7
23
|
## 3.3.0
|
|
8
24
|
|
|
9
25
|
Datanotes 3.3.0 installs extensions: tables, views, bases and MCP tools from a git repository, pinned to a version. It only adds to 3.2: no operation, argument or setting goes away.
|
package/package.json
CHANGED