datanotes 3.1.0 → 3.2.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.
- package/dist/api/index.cjs +175 -8
- package/dist/api/index.js +175 -8
- package/dist/api/mcp.cjs +175 -8
- package/dist/api/mcp.js +175 -8
- package/dist/datanotes.cjs +591 -139
- package/dist/docs/api/operations/add_column.md +1 -0
- package/dist/docs/api/operations/add_constraint.md +2 -0
- package/dist/docs/api/operations/alter_column.md +1 -1
- package/dist/docs/api/operations/alter_table.md +3 -2
- package/dist/docs/api/operations/check_table.md +1 -1
- package/dist/docs/api/operations/create_table.md +3 -1
- package/dist/docs/api/operations/describe_table.md +1 -1
- package/dist/docs/api/operations/insert_row.md +2 -2
- package/dist/docs/api/operations/tags/rows-dml.md +1 -1
- package/dist/docs/api.md +2 -2
- package/dist/docs/guides/data-quality/check-constraints.md +14 -13
- package/dist/docs/guides/data-quality/hand-edits.md +10 -10
- package/dist/docs/guides/database-objects/bases.md +11 -11
- package/dist/docs/guides/database-objects/catalogs-and-schemas.md +16 -10
- package/dist/docs/guides/database-objects/columns.md +38 -38
- package/dist/docs/guides/database-objects/relations.md +173 -36
- package/dist/docs/guides/database-objects/tables.md +80 -35
- 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 +21 -21
- 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/errors.md +1 -1
- package/dist/docs/reference/operations/auxiliary.md +2 -2
- package/dist/docs/reference/operations/rows.md +1 -1
- package/dist/docs/reference/operations/schema.md +15 -11
- package/dist/docs/reference/operations.md +28 -28
- package/dist/docs/release-notes.md +24 -0
- package/package.json +1 -1
|
@@ -23,56 +23,56 @@ Answer (74 lines)
|
|
|
23
23
|
"events": [
|
|
24
24
|
{
|
|
25
25
|
"seq": 3,
|
|
26
|
-
"at": "2026-10-
|
|
26
|
+
"at": "2026-10-19T04:06:55.908Z",
|
|
27
27
|
"table": "main.public.film",
|
|
28
28
|
"kind": "insert",
|
|
29
29
|
"op": "insert_row",
|
|
30
30
|
"path": "datanotes/main/public/film/Nosferatu.md",
|
|
31
|
-
"row_id": "
|
|
31
|
+
"row_id": "01a15257-4ea0-749e-bc45-1d36404958ac",
|
|
32
32
|
"changes": {
|
|
33
|
-
"id": { "after": "
|
|
33
|
+
"id": { "after": "01a15257-4ea0-749e-bc45-1d36404958ac" },
|
|
34
34
|
"title": { "after": "Nosferatu" },
|
|
35
35
|
"status": { "after": "to watch" }
|
|
36
36
|
},
|
|
37
37
|
"source": "engine",
|
|
38
38
|
"row": {
|
|
39
|
-
"id": "
|
|
39
|
+
"id": "01a15257-4ea0-749e-bc45-1d36404958ac",
|
|
40
40
|
"title": "Nosferatu",
|
|
41
41
|
"status": "to watch"
|
|
42
42
|
},
|
|
43
43
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
44
|
-
"migration_id": "
|
|
44
|
+
"migration_id": "20261019T040655-insert_row-insert-into-film"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"seq": 4,
|
|
48
|
-
"at": "2026-10-
|
|
48
|
+
"at": "2026-10-19T04:06:55.914Z",
|
|
49
49
|
"table": "main.public.film",
|
|
50
50
|
"kind": "insert",
|
|
51
51
|
"op": "insert_row",
|
|
52
52
|
"path": "datanotes/main/public/film/Metropolis.md",
|
|
53
|
-
"row_id": "
|
|
53
|
+
"row_id": "01a15257-4ea6-7caa-8cee-e372c1fec68a",
|
|
54
54
|
"changes": {
|
|
55
|
-
"id": { "after": "
|
|
55
|
+
"id": { "after": "01a15257-4ea6-7caa-8cee-e372c1fec68a" },
|
|
56
56
|
"title": { "after": "Metropolis" },
|
|
57
57
|
"status": { "after": "to watch" }
|
|
58
58
|
},
|
|
59
59
|
"source": "engine",
|
|
60
60
|
"row": {
|
|
61
|
-
"id": "
|
|
61
|
+
"id": "01a15257-4ea6-7caa-8cee-e372c1fec68a",
|
|
62
62
|
"title": "Metropolis",
|
|
63
63
|
"status": "to watch"
|
|
64
64
|
},
|
|
65
65
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
66
|
-
"migration_id": "
|
|
66
|
+
"migration_id": "20261019T040655-insert_row-insert-into-film-2"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"seq": 5,
|
|
70
|
-
"at": "2026-10-
|
|
70
|
+
"at": "2026-10-19T04:06:55.921Z",
|
|
71
71
|
"table": "main.public.film",
|
|
72
72
|
"kind": "update",
|
|
73
73
|
"op": "update_row",
|
|
74
74
|
"path": "datanotes/main/public/film/Nosferatu.md",
|
|
75
|
-
"row_id": "
|
|
75
|
+
"row_id": "01a15257-4ea0-749e-bc45-1d36404958ac",
|
|
76
76
|
"changes": {
|
|
77
77
|
"status": { "before": "to watch", "after": "watched" },
|
|
78
78
|
"rating": { "after": 4 },
|
|
@@ -80,14 +80,14 @@ Answer (74 lines)
|
|
|
80
80
|
},
|
|
81
81
|
"source": "engine",
|
|
82
82
|
"row": {
|
|
83
|
-
"id": "
|
|
83
|
+
"id": "01a15257-4ea0-749e-bc45-1d36404958ac",
|
|
84
84
|
"title": "Nosferatu",
|
|
85
85
|
"status": "watched",
|
|
86
86
|
"rating": 4,
|
|
87
87
|
"watched_on": "2026-10-03"
|
|
88
88
|
},
|
|
89
89
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
90
|
-
"migration_id": "
|
|
90
|
+
"migration_id": "20261019T040655-update_row-update-film"
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
"last": 5,
|
|
@@ -116,25 +116,25 @@ Answer:
|
|
|
116
116
|
"events": [
|
|
117
117
|
{
|
|
118
118
|
"seq": 14,
|
|
119
|
-
"at": "2026-10-
|
|
119
|
+
"at": "2026-10-19T04:07:00.489Z",
|
|
120
120
|
"table": "main.public.film",
|
|
121
121
|
"kind": "insert",
|
|
122
122
|
"op": "insert_row",
|
|
123
123
|
"path": "datanotes/main/public/film/His Girl Friday.md",
|
|
124
|
-
"row_id": "
|
|
124
|
+
"row_id": "01a15257-6086-7874-808c-ad022ba671e1",
|
|
125
125
|
"changes": {
|
|
126
|
-
"id": { "after": "
|
|
126
|
+
"id": { "after": "01a15257-6086-7874-808c-ad022ba671e1" },
|
|
127
127
|
"title": { "after": "His Girl Friday" },
|
|
128
128
|
"status": { "after": "to watch" }
|
|
129
129
|
},
|
|
130
130
|
"source": "engine",
|
|
131
131
|
"row": {
|
|
132
|
-
"id": "
|
|
132
|
+
"id": "01a15257-6086-7874-808c-ad022ba671e1",
|
|
133
133
|
"title": "His Girl Friday",
|
|
134
134
|
"status": "to watch"
|
|
135
135
|
},
|
|
136
136
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
137
|
-
"migration_id": "
|
|
137
|
+
"migration_id": "20261019T040700-insert_row-insert-into-film"
|
|
138
138
|
}
|
|
139
139
|
],
|
|
140
140
|
"last": 14,
|
|
@@ -149,19 +149,19 @@ Answer:
|
|
|
149
149
|
**`create_webhook`**
|
|
150
150
|
|
|
151
151
|
```json
|
|
152
|
-
{ "url": "http://127.0.0.1:
|
|
152
|
+
{ "url": "http://127.0.0.1:46035/datanotes-hook", "tables": ["film"] }
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
Answer:
|
|
156
156
|
|
|
157
157
|
```json
|
|
158
158
|
{
|
|
159
|
-
"id": "
|
|
160
|
-
"url": "http://127.0.0.1:
|
|
159
|
+
"id": "wh_ec4e37b04323",
|
|
160
|
+
"url": "http://127.0.0.1:46035/datanotes-hook",
|
|
161
161
|
"tables": ["film"],
|
|
162
162
|
"enabled": true,
|
|
163
163
|
"cursor": 14,
|
|
164
|
-
"created_at": "2026-10-
|
|
164
|
+
"created_at": "2026-10-19T04:07:00.494Z",
|
|
165
165
|
"failures": 0,
|
|
166
166
|
"status": "ok",
|
|
167
167
|
"secret": "<shown once>"
|
|
@@ -183,28 +183,28 @@ The receiver got this request:
|
|
|
183
183
|
```json
|
|
184
184
|
{
|
|
185
185
|
"headers": {
|
|
186
|
-
"x-datanotes-signature": "sha256=
|
|
186
|
+
"x-datanotes-signature": "sha256=42e2f1b279304e507dc504eead14b0848c55dea078fad8cb58078598c1263936"
|
|
187
187
|
},
|
|
188
188
|
"body": {
|
|
189
|
-
"webhook": "
|
|
189
|
+
"webhook": "wh_ec4e37b04323",
|
|
190
190
|
"events": [
|
|
191
191
|
{
|
|
192
192
|
"seq": 15,
|
|
193
|
-
"at": "2026-10-
|
|
193
|
+
"at": "2026-10-19T04:07:00.499Z",
|
|
194
194
|
"table": "main.public.film",
|
|
195
195
|
"kind": "update",
|
|
196
196
|
"op": "update_row",
|
|
197
197
|
"path": "datanotes/main/public/film/His Girl Friday.md",
|
|
198
|
-
"row_id": "
|
|
198
|
+
"row_id": "01a15257-6086-7874-808c-ad022ba671e1",
|
|
199
199
|
"changes": { "status": { "before": "to watch", "after": "watched" } },
|
|
200
200
|
"source": "engine",
|
|
201
201
|
"row": {
|
|
202
|
-
"id": "
|
|
202
|
+
"id": "01a15257-6086-7874-808c-ad022ba671e1",
|
|
203
203
|
"title": "His Girl Friday",
|
|
204
204
|
"status": "watched"
|
|
205
205
|
},
|
|
206
206
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
207
|
-
"migration_id": "
|
|
207
|
+
"migration_id": "20261019T040700-update_row-update-film"
|
|
208
208
|
}
|
|
209
209
|
],
|
|
210
210
|
"last": 15
|
|
@@ -220,13 +220,13 @@ Answer:
|
|
|
220
220
|
{
|
|
221
221
|
"webhooks": [
|
|
222
222
|
{
|
|
223
|
-
"id": "
|
|
224
|
-
"url": "http://127.0.0.1:
|
|
223
|
+
"id": "wh_ec4e37b04323",
|
|
224
|
+
"url": "http://127.0.0.1:46035/datanotes-hook",
|
|
225
225
|
"tables": ["film"],
|
|
226
226
|
"enabled": true,
|
|
227
227
|
"cursor": 15,
|
|
228
|
-
"created_at": "2026-10-
|
|
229
|
-
"last_delivery": "2026-10-
|
|
228
|
+
"created_at": "2026-10-19T04:07:00.494Z",
|
|
229
|
+
"last_delivery": "2026-10-19T04:07:00.504Z",
|
|
230
230
|
"failures": 0,
|
|
231
231
|
"status": "ok"
|
|
232
232
|
}
|
|
@@ -237,7 +237,7 @@ Answer:
|
|
|
237
237
|
**`delete_webhook`**
|
|
238
238
|
|
|
239
239
|
```json
|
|
240
|
-
{ "id": "
|
|
240
|
+
{ "id": "wh_ec4e37b04323" }
|
|
241
241
|
```
|
|
242
242
|
|
|
243
243
|
Answer:
|
|
@@ -87,11 +87,11 @@ Answer:
|
|
|
87
87
|
"total": 13,
|
|
88
88
|
"migrations": [
|
|
89
89
|
{
|
|
90
|
-
"migration_id": "
|
|
90
|
+
"migration_id": "20261019T040643-delete_rows-archive-1-rows-of-film",
|
|
91
91
|
"op": "delete_rows",
|
|
92
92
|
"summary": "archive 1 rows of film",
|
|
93
93
|
"table": "main.public.film",
|
|
94
|
-
"executed_at": "2026-10-
|
|
94
|
+
"executed_at": "2026-10-19T04:06:43.206Z",
|
|
95
95
|
"notes_changed": 0,
|
|
96
96
|
"files_changed": 1,
|
|
97
97
|
"undone": false,
|
|
@@ -99,11 +99,11 @@ Answer:
|
|
|
99
99
|
"by": "docs-example"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
"migration_id": "
|
|
102
|
+
"migration_id": "20261019T040643-merge_rows-merge-2-rows-into-film",
|
|
103
103
|
"op": "merge_rows",
|
|
104
104
|
"summary": "merge 2 rows into film",
|
|
105
105
|
"table": "main.public.film",
|
|
106
|
-
"executed_at": "2026-10-
|
|
106
|
+
"executed_at": "2026-10-19T04:06:43.194Z",
|
|
107
107
|
"notes_changed": 1,
|
|
108
108
|
"files_changed": 1,
|
|
109
109
|
"undone": false,
|
|
@@ -111,11 +111,11 @@ Answer:
|
|
|
111
111
|
"by": "docs-example"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
|
-
"migration_id": "
|
|
114
|
+
"migration_id": "20261019T040643-update_rows-update-film",
|
|
115
115
|
"op": "update_rows",
|
|
116
116
|
"summary": "update film",
|
|
117
117
|
"table": "main.public.film",
|
|
118
|
-
"executed_at": "2026-10-
|
|
118
|
+
"executed_at": "2026-10-19T04:06:43.181Z",
|
|
119
119
|
"notes_changed": 3,
|
|
120
120
|
"files_changed": 0,
|
|
121
121
|
"undone": false,
|
|
@@ -129,7 +129,7 @@ Answer:
|
|
|
129
129
|
**`undo_migration`**
|
|
130
130
|
|
|
131
131
|
```json
|
|
132
|
-
{ "migration_id": "
|
|
132
|
+
{ "migration_id": "20261019T040643-delete_rows-archive-1-rows-of-film" }
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
Answer:
|
|
@@ -138,8 +138,8 @@ Answer:
|
|
|
138
138
|
{
|
|
139
139
|
"ok": true,
|
|
140
140
|
"op": "undo_migration",
|
|
141
|
-
"undoes": "
|
|
142
|
-
"migration_id": "
|
|
141
|
+
"undoes": "20261019T040643-delete_rows-archive-1-rows-of-film",
|
|
142
|
+
"migration_id": "20261019T040643-undo_migration-undo-20261019t040643-delete_ro",
|
|
143
143
|
"conflicts": [],
|
|
144
144
|
"failed": []
|
|
145
145
|
}
|
|
@@ -197,7 +197,7 @@ Answer:
|
|
|
197
197
|
}
|
|
198
198
|
],
|
|
199
199
|
"commits": [{ "table": "main.public.film", "version": 14, "operation": "UPDATE" }],
|
|
200
|
-
"migration_id": "
|
|
200
|
+
"migration_id": "20261019T040643-update_row-update-film-5"
|
|
201
201
|
}
|
|
202
202
|
```
|
|
203
203
|
|
|
@@ -216,7 +216,7 @@ Then someone changes the rating again:
|
|
|
216
216
|
**`undo_migration`**
|
|
217
217
|
|
|
218
218
|
```json
|
|
219
|
-
{ "migration_id": "
|
|
219
|
+
{ "migration_id": "20261019T040643-update_row-update-film-5" }
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
Refused:
|
|
@@ -249,7 +249,7 @@ The undo of an insert trashes the new note only while it’s as the insert left
|
|
|
249
249
|
**`undo_migration`**
|
|
250
250
|
|
|
251
251
|
```json
|
|
252
|
-
{ "migration_id": "
|
|
252
|
+
{ "migration_id": "20261019T040643-insert_row-insert-into-film-6" }
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
Refused:
|
|
@@ -21,7 +21,7 @@ The dry run names the version by its time, with a `timestamp` from the history r
|
|
|
21
21
|
**`restore_table`**
|
|
22
22
|
|
|
23
23
|
```json
|
|
24
|
-
{ "table": "film", "timestamp": "2026-10-
|
|
24
|
+
{ "table": "film", "timestamp": "2026-10-19T04:06:55.926Z", "dry_run": true }
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Answer:
|
|
@@ -50,7 +50,7 @@ Answer:
|
|
|
50
50
|
"files_created": 1,
|
|
51
51
|
"planned_creates": ["datanotes/main/public/film/Metropolis.md"],
|
|
52
52
|
"commits": [{ "table": "main.public.film", "version": 7, "operation": "RESTORE" }],
|
|
53
|
-
"migration_id": "
|
|
53
|
+
"migration_id": "20261019T040655-restore_table-restore-main-public-film-to-ve"
|
|
54
54
|
}
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -113,7 +113,7 @@ An agent can change several tables in one call: here one batch adds an actor and
|
|
|
113
113
|
Answer:
|
|
114
114
|
|
|
115
115
|
```json
|
|
116
|
-
{ "ok": true, "migration_id": "
|
|
116
|
+
{ "ok": true, "migration_id": "20261019T040704-batch-add-cary-grant-rate-his-girl-f" }
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
**`describe_history`**
|
|
@@ -136,10 +136,10 @@ Answer (62 lines)
|
|
|
136
136
|
{
|
|
137
137
|
"table": "main.public.film",
|
|
138
138
|
"version": 11,
|
|
139
|
-
"timestamp": "2026-10-
|
|
139
|
+
"timestamp": "2026-10-19T04:07:04.568Z",
|
|
140
140
|
"operation": "UPDATE",
|
|
141
141
|
"operation_parameters": { "summary": "update film" },
|
|
142
|
-
"migration_id": "
|
|
142
|
+
"migration_id": "20261019T040704-update_row-update-film",
|
|
143
143
|
"operation_metrics": {
|
|
144
144
|
"num_added_files": 1,
|
|
145
145
|
"num_removed_files": 1,
|
|
@@ -148,16 +148,16 @@ Answer (62 lines)
|
|
|
148
148
|
"engine_info": "datanotes",
|
|
149
149
|
"user_name": "docs-example",
|
|
150
150
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
151
|
-
"batch": "
|
|
151
|
+
"batch": "20261019T040704-batch-add-cary-grant-rate-his-girl-f",
|
|
152
152
|
"tables": ["main.public.actor", "main.public.film"]
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
"table": "main.public.actor",
|
|
156
156
|
"version": 2,
|
|
157
|
-
"timestamp": "2026-10-
|
|
157
|
+
"timestamp": "2026-10-19T04:07:04.563Z",
|
|
158
158
|
"operation": "WRITE",
|
|
159
159
|
"operation_parameters": { "summary": "insert into actor" },
|
|
160
|
-
"migration_id": "
|
|
160
|
+
"migration_id": "20261019T040704-insert_row-insert-into-actor-2",
|
|
161
161
|
"operation_metrics": {
|
|
162
162
|
"num_added_files": 1,
|
|
163
163
|
"num_removed_files": 0,
|
|
@@ -166,16 +166,16 @@ Answer (62 lines)
|
|
|
166
166
|
"engine_info": "datanotes",
|
|
167
167
|
"user_name": "docs-example",
|
|
168
168
|
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
|
|
169
|
-
"batch": "
|
|
169
|
+
"batch": "20261019T040704-batch-add-cary-grant-rate-his-girl-f",
|
|
170
170
|
"tables": ["main.public.actor", "main.public.film"]
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
"table": "main.public.film_at",
|
|
174
174
|
"version": 1,
|
|
175
|
-
"timestamp": "2026-10-
|
|
175
|
+
"timestamp": "2026-10-19T04:07:04.557Z",
|
|
176
176
|
"operation": "ALTER TABLE",
|
|
177
177
|
"operation_parameters": { "summary": "alter table main.public.film_at" },
|
|
178
|
-
"migration_id": "
|
|
178
|
+
"migration_id": "20261019T040704-alter_table-alter-table-main-public-film_a",
|
|
179
179
|
"operation_metrics": {
|
|
180
180
|
"num_added_files": 0,
|
|
181
181
|
"num_removed_files": 0,
|
|
@@ -195,7 +195,7 @@ Answer (62 lines)
|
|
|
195
195
|
|
|
196
196
|
```json
|
|
197
197
|
{
|
|
198
|
-
"before_migration": "
|
|
198
|
+
"before_migration": "20261019T040704-batch-add-cary-grant-rate-his-girl-f",
|
|
199
199
|
"dry_run": true
|
|
200
200
|
}
|
|
201
201
|
```
|
|
@@ -209,7 +209,7 @@ Answer:
|
|
|
209
209
|
"dry_run": true,
|
|
210
210
|
"planned_deletes": ["datanotes/main/public/actor/Cary Grant.md"],
|
|
211
211
|
"planned_texts": ["datanotes/main/public/film/His Girl Friday.md"],
|
|
212
|
-
"restored_to": "2026-10-
|
|
212
|
+
"restored_to": "2026-10-19T04:07:04.562Z",
|
|
213
213
|
"tables": [
|
|
214
214
|
{
|
|
215
215
|
"table": "main.public.actor",
|
|
@@ -245,7 +245,7 @@ Answer:
|
|
|
245
245
|
**`restore_database`**
|
|
246
246
|
|
|
247
247
|
```json
|
|
248
|
-
{ "before_migration": "
|
|
248
|
+
{ "before_migration": "20261019T040704-batch-add-cary-grant-rate-his-girl-f" }
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
Answer:
|
|
@@ -253,8 +253,8 @@ Answer:
|
|
|
253
253
|
```json
|
|
254
254
|
{
|
|
255
255
|
"ok": true,
|
|
256
|
-
"migration_id": "
|
|
257
|
-
"restored_to": "2026-10-
|
|
256
|
+
"migration_id": "20261019T040704-restore_database-restore-database-to-before-202",
|
|
257
|
+
"restored_to": "2026-10-19T04:07:04.562Z",
|
|
258
258
|
"tables": ["main.public.actor: restore", "main.public.film: restore"]
|
|
259
259
|
}
|
|
260
260
|
```
|
|
@@ -287,13 +287,13 @@ A `timestamp` names the moment by its time, as it does for a table. `restored_to
|
|
|
287
287
|
**`undo_migration`**
|
|
288
288
|
|
|
289
289
|
```json
|
|
290
|
-
{ "migration_id": "
|
|
290
|
+
{ "migration_id": "20261019T040704-restore_database-restore-database-to-before-202" }
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
**`restore_database`**
|
|
294
294
|
|
|
295
295
|
```json
|
|
296
|
-
{ "timestamp": "2026-10-
|
|
296
|
+
{ "timestamp": "2026-10-19T04:07:04.562Z", "dry_run": true }
|
|
297
297
|
```
|
|
298
298
|
|
|
299
299
|
Answer:
|
|
@@ -320,7 +320,7 @@ Time travel reads several tables the same way. `select_rows` with `timestamp` on
|
|
|
320
320
|
**`select_rows`**
|
|
321
321
|
|
|
322
322
|
```json
|
|
323
|
-
{ "table": "actor", "columns": ["name"], "timestamp": "2026-10-
|
|
323
|
+
{ "table": "actor", "columns": ["name"], "timestamp": "2026-10-19T04:07:04.562Z" }
|
|
324
324
|
```
|
|
325
325
|
|
|
326
326
|
Answer:
|
|
@@ -336,6 +336,6 @@ Answer:
|
|
|
336
336
|
}
|
|
337
337
|
],
|
|
338
338
|
"version": 1,
|
|
339
|
-
"timestamp": "2026-10-
|
|
339
|
+
"timestamp": "2026-10-19T04:07:04.531Z"
|
|
340
340
|
}
|
|
341
341
|
```
|
|
@@ -26,7 +26,7 @@ Answer:
|
|
|
26
26
|
"op": "alter_table",
|
|
27
27
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
28
28
|
"commits": [{ "table": "main.public.film", "version": 1, "operation": "ALTER TABLE" }],
|
|
29
|
-
"migration_id": "
|
|
29
|
+
"migration_id": "20261019T040655-alter_table-alter-table-main-public-film"
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -88,10 +88,10 @@ Answer (110 lines)
|
|
|
88
88
|
"history": [
|
|
89
89
|
{
|
|
90
90
|
"version": 6,
|
|
91
|
-
"timestamp": "2026-10-
|
|
91
|
+
"timestamp": "2026-10-19T04:06:55.931Z",
|
|
92
92
|
"operation": "DELETE",
|
|
93
93
|
"operation_parameters": { "summary": "archive 1 rows of film" },
|
|
94
|
-
"migration_id": "
|
|
94
|
+
"migration_id": "20261019T040655-delete_rows-archive-1-rows-of-film",
|
|
95
95
|
"operation_metrics": {
|
|
96
96
|
"num_added_files": 0,
|
|
97
97
|
"num_removed_files": 1,
|
|
@@ -103,10 +103,10 @@ Answer (110 lines)
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"version": 5,
|
|
106
|
-
"timestamp": "2026-10-
|
|
106
|
+
"timestamp": "2026-10-19T04:06:55.926Z",
|
|
107
107
|
"operation": "UPDATE",
|
|
108
108
|
"operation_parameters": { "summary": "update film" },
|
|
109
|
-
"migration_id": "
|
|
109
|
+
"migration_id": "20261019T040655-update_row-update-film-2",
|
|
110
110
|
"operation_metrics": {
|
|
111
111
|
"num_added_files": 1,
|
|
112
112
|
"num_removed_files": 1,
|
|
@@ -118,10 +118,10 @@ Answer (110 lines)
|
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"version": 4,
|
|
121
|
-
"timestamp": "2026-10-
|
|
121
|
+
"timestamp": "2026-10-19T04:06:55.920Z",
|
|
122
122
|
"operation": "UPDATE",
|
|
123
123
|
"operation_parameters": { "summary": "update film" },
|
|
124
|
-
"migration_id": "
|
|
124
|
+
"migration_id": "20261019T040655-update_row-update-film",
|
|
125
125
|
"operation_metrics": {
|
|
126
126
|
"num_added_files": 1,
|
|
127
127
|
"num_removed_files": 1,
|
|
@@ -133,10 +133,10 @@ Answer (110 lines)
|
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"version": 3,
|
|
136
|
-
"timestamp": "2026-10-
|
|
136
|
+
"timestamp": "2026-10-19T04:06:55.913Z",
|
|
137
137
|
"operation": "WRITE",
|
|
138
138
|
"operation_parameters": { "summary": "insert into film" },
|
|
139
|
-
"migration_id": "
|
|
139
|
+
"migration_id": "20261019T040655-insert_row-insert-into-film-2",
|
|
140
140
|
"operation_metrics": {
|
|
141
141
|
"num_added_files": 1,
|
|
142
142
|
"num_removed_files": 0,
|
|
@@ -148,10 +148,10 @@ Answer (110 lines)
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"version": 2,
|
|
151
|
-
"timestamp": "2026-10-
|
|
151
|
+
"timestamp": "2026-10-19T04:06:55.908Z",
|
|
152
152
|
"operation": "WRITE",
|
|
153
153
|
"operation_parameters": { "summary": "insert into film" },
|
|
154
|
-
"migration_id": "
|
|
154
|
+
"migration_id": "20261019T040655-insert_row-insert-into-film",
|
|
155
155
|
"operation_metrics": {
|
|
156
156
|
"num_added_files": 1,
|
|
157
157
|
"num_removed_files": 0,
|
|
@@ -163,10 +163,10 @@ Answer (110 lines)
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"version": 1,
|
|
166
|
-
"timestamp": "2026-10-
|
|
166
|
+
"timestamp": "2026-10-19T04:06:55.901Z",
|
|
167
167
|
"operation": "ALTER TABLE",
|
|
168
168
|
"operation_parameters": { "summary": "alter table main.public.film" },
|
|
169
|
-
"migration_id": "
|
|
169
|
+
"migration_id": "20261019T040655-alter_table-alter-table-main-public-film",
|
|
170
170
|
"operation_metrics": {
|
|
171
171
|
"num_added_files": 0,
|
|
172
172
|
"num_removed_files": 0,
|
|
@@ -178,10 +178,10 @@ Answer (110 lines)
|
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
"version": 0,
|
|
181
|
-
"timestamp": "2026-10-
|
|
181
|
+
"timestamp": "2026-10-19T04:06:55.893Z",
|
|
182
182
|
"operation": "CREATE TABLE",
|
|
183
183
|
"operation_parameters": { "summary": "create table main.public.film" },
|
|
184
|
-
"migration_id": "
|
|
184
|
+
"migration_id": "20261019T040655-create_table-create-table-main-public-film",
|
|
185
185
|
"operation_metrics": {
|
|
186
186
|
"num_added_files": 0,
|
|
187
187
|
"num_removed_files": 0,
|
|
@@ -226,7 +226,7 @@ Answer:
|
|
|
226
226
|
}
|
|
227
227
|
],
|
|
228
228
|
"version": 5,
|
|
229
|
-
"timestamp": "2026-10-
|
|
229
|
+
"timestamp": "2026-10-19T04:06:55.926Z"
|
|
230
230
|
}
|
|
231
231
|
```
|
|
232
232
|
|
|
@@ -253,7 +253,7 @@ Answer:
|
|
|
253
253
|
],
|
|
254
254
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
255
255
|
"commits": [{ "table": "main.public.film_before", "version": 0, "operation": "CLONE" }],
|
|
256
|
-
"migration_id": "
|
|
256
|
+
"migration_id": "20261019T040655-clone_table-clone-main-public-film-to-main"
|
|
257
257
|
}
|
|
258
258
|
```
|
|
259
259
|
|
|
@@ -294,7 +294,7 @@ This call names the same moment by its time, taken from the history read above:
|
|
|
294
294
|
{
|
|
295
295
|
"source": "film",
|
|
296
296
|
"target": "film_at",
|
|
297
|
-
"timestamp": "2026-10-
|
|
297
|
+
"timestamp": "2026-10-19T04:06:55.926Z",
|
|
298
298
|
"copy_rows": false
|
|
299
299
|
}
|
|
300
300
|
```
|
|
@@ -316,33 +316,33 @@ Answer:
|
|
|
316
316
|
"table": "main.public.film",
|
|
317
317
|
"changes": [
|
|
318
318
|
{
|
|
319
|
-
"id": "
|
|
319
|
+
"id": "01a15257-4ea6-7caa-8cee-e372c1fec68a",
|
|
320
320
|
"title": "Metropolis",
|
|
321
321
|
"status": "to watch",
|
|
322
322
|
"path": "datanotes/main/public/film/Metropolis.md",
|
|
323
323
|
"_change_type": "update_preimage",
|
|
324
324
|
"_commit_version": 5,
|
|
325
|
-
"_commit_timestamp": "2026-10-
|
|
325
|
+
"_commit_timestamp": "2026-10-19T04:06:55.926Z",
|
|
326
326
|
"_operation": "UPDATE"
|
|
327
327
|
},
|
|
328
328
|
{
|
|
329
|
-
"id": "
|
|
329
|
+
"id": "01a15257-4ea6-7caa-8cee-e372c1fec68a",
|
|
330
330
|
"title": "Metropolis",
|
|
331
331
|
"status": "watched",
|
|
332
332
|
"path": "datanotes/main/public/film/Metropolis.md",
|
|
333
333
|
"_change_type": "update_postimage",
|
|
334
334
|
"_commit_version": 5,
|
|
335
|
-
"_commit_timestamp": "2026-10-
|
|
335
|
+
"_commit_timestamp": "2026-10-19T04:06:55.926Z",
|
|
336
336
|
"_operation": "UPDATE"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
"id": "
|
|
339
|
+
"id": "01a15257-4ea6-7caa-8cee-e372c1fec68a",
|
|
340
340
|
"title": "Metropolis",
|
|
341
341
|
"status": "watched",
|
|
342
342
|
"path": "datanotes/main/public/film/Metropolis.md",
|
|
343
343
|
"_change_type": "delete",
|
|
344
344
|
"_commit_version": 6,
|
|
345
|
-
"_commit_timestamp": "2026-10-
|
|
345
|
+
"_commit_timestamp": "2026-10-19T04:06:55.931Z",
|
|
346
346
|
"_operation": "DELETE"
|
|
347
347
|
}
|
|
348
348
|
]
|
|
@@ -358,7 +358,7 @@ You edit `datanotes/main/public/film/Nosferatu.md` by hand, outside the engine.
|
|
|
358
358
|
```markdown
|
|
359
359
|
---
|
|
360
360
|
table: main.public.film
|
|
361
|
-
id:
|
|
361
|
+
id: 01a15257-4ea0-749e-bc45-1d36404958ac
|
|
362
362
|
title: Nosferatu
|
|
363
363
|
status: watched
|
|
364
364
|
rating: 5
|
|
@@ -380,7 +380,7 @@ Answer:
|
|
|
380
380
|
"history": [
|
|
381
381
|
{
|
|
382
382
|
"version": 8,
|
|
383
|
-
"timestamp": "2026-10-
|
|
383
|
+
"timestamp": "2026-10-19T04:06:58.986Z",
|
|
384
384
|
"operation": "EXTERNAL_EDIT",
|
|
385
385
|
"operation_metrics": {
|
|
386
386
|
"num_added_files": 1,
|
|
@@ -392,10 +392,10 @@ Answer:
|
|
|
392
392
|
},
|
|
393
393
|
{
|
|
394
394
|
"version": 7,
|
|
395
|
-
"timestamp": "2026-10-
|
|
395
|
+
"timestamp": "2026-10-19T04:06:55.974Z",
|
|
396
396
|
"operation": "RESTORE",
|
|
397
397
|
"operation_parameters": { "summary": "restore main.public.film to version 5" },
|
|
398
|
-
"migration_id": "
|
|
398
|
+
"migration_id": "20261019T040655-restore_table-restore-main-public-film-to-ve",
|
|
399
399
|
"operation_metrics": {
|
|
400
400
|
"num_added_files": 1,
|
|
401
401
|
"num_removed_files": 0,
|
|
@@ -488,7 +488,7 @@ Answer:
|
|
|
488
488
|
"ok": true,
|
|
489
489
|
"op": "alter_table",
|
|
490
490
|
"planned_texts": ["datanotes/metastore.yaml"],
|
|
491
|
-
"migration_id": "
|
|
491
|
+
"migration_id": "20261019T040704-alter_table-alter-table-main-public-film_b"
|
|
492
492
|
}
|
|
493
493
|
```
|
|
494
494
|
|
|
@@ -508,7 +508,7 @@ Answer:
|
|
|
508
508
|
"commits": [
|
|
509
509
|
{ "table": "main.public.film_at", "version": 1, "operation": "ALTER TABLE" }
|
|
510
510
|
],
|
|
511
|
-
"migration_id": "
|
|
511
|
+
"migration_id": "20261019T040704-alter_table-alter-table-main-public-film_a"
|
|
512
512
|
}
|
|
513
513
|
```
|
|
514
514
|
|
|
@@ -520,7 +520,7 @@ History is a setting of the definition. `alter_table` writes `history: true` und
|
|
|
520
520
|
|
|
521
521
|
```yaml
|
|
522
522
|
# Metastore (Datanotes): catalogs, schemas, tables, columns, views.
|
|
523
|
-
id:
|
|
523
|
+
id: 01a15257-4e88-79c8-b3b9-4944e17406ca
|
|
524
524
|
config:
|
|
525
525
|
history: true
|
|
526
526
|
|