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
package/dist/api/index.js
CHANGED
|
@@ -330,7 +330,7 @@ var OPERATIONS = [
|
|
|
330
330
|
},
|
|
331
331
|
{
|
|
332
332
|
"name": "describe_table",
|
|
333
|
-
"description": "Describe a table (`catalog.schema.table` or a shorter unambiguous name): `qualified`, `name`,\n`catalog`, `schema`, `description`, `aliases`, `layout` (`folder`, `row_folder`: the folder pattern\nof new rows, `archive`), `options` (`partition`, `filename`, `archive`, `exclude`), typed `columns`\nwith label/aliases/description and the dense flag, `untyped_fields`, `row_count`, and when set:\n`tags`, `bases` (the bases it inherits from, in order), `constraints` (its CHECKs, name \u2192 where), `row_template`, `history`,\n`autolink_target`, `fields` (their values).\n\nBefore adding a column (e.g. a new metric), read `columns` and match your concept against\n`name`, `label`, `aliases` and `description`; reuse an existing column when it means the same.\n\n`missing_descriptions` (`{table, columns}`), present only when something has no description (a table\ndefined before descriptions were required), names what lacks one: write them with alter_table\n`description` and alter_column `changes.description`, asking the user when the meaning is unclear.",
|
|
333
|
+
"description": "Describe a table (`catalog.schema.table` or a shorter unambiguous name): `qualified`, `name`,\n`catalog`, `schema`, `description`, `aliases`, `layout` (`folder`, `row_folder`: the folder pattern\nof new rows, `archive`), `options` (`partition`, `filename`, `archive`, `exclude`), typed `columns`\nwith label/aliases/description and the dense flag, `untyped_fields`, `row_count`, and when set:\n`tags`, `bases` (the bases it inherits from, in order), `constraints` (its CHECKs, name \u2192 where), `constraint_hints` (their own hints, name \u2192 hint), `instructions` (how to fill a row: follow them before you write one), `row_template`, `history`,\n`autolink_target`, `fields` (their values).\n\nBefore adding a column (e.g. a new metric), read `columns` and match your concept against\n`name`, `label`, `aliases` and `description`; reuse an existing column when it means the same.\n\n`missing_descriptions` (`{table, columns}`), present only when something has no description (a table\ndefined before descriptions were required), names what lacks one: write them with alter_table\n`description` and alter_column `changes.description`, asking the user when the meaning is unclear.",
|
|
334
334
|
"inputSchema": {
|
|
335
335
|
"additionalProperties": false,
|
|
336
336
|
"properties": {
|
|
@@ -453,6 +453,10 @@ var OPERATIONS = [
|
|
|
453
453
|
"inverse": {
|
|
454
454
|
"type": "string"
|
|
455
455
|
},
|
|
456
|
+
"acyclic": {
|
|
457
|
+
"type": "boolean",
|
|
458
|
+
"description": "Link column to its own table whose links never form a cycle (a write that closes one is refused)."
|
|
459
|
+
},
|
|
456
460
|
"ref_where": {
|
|
457
461
|
"type": "object",
|
|
458
462
|
"description": "Link column: the where filter every linked row must match.",
|
|
@@ -562,6 +566,17 @@ var OPERATIONS = [
|
|
|
562
566
|
},
|
|
563
567
|
"description": "Its CHECK constraints: name \u2192 the where every row must match."
|
|
564
568
|
},
|
|
569
|
+
"constraint_hints": {
|
|
570
|
+
"type": "object",
|
|
571
|
+
"additionalProperties": {
|
|
572
|
+
"type": "string"
|
|
573
|
+
},
|
|
574
|
+
"description": "The hint of each CHECK that has one: name \u2192 what to do when a row breaks it."
|
|
575
|
+
},
|
|
576
|
+
"instructions": {
|
|
577
|
+
"type": "string",
|
|
578
|
+
"description": "How to fill a row of the table (alter_table instructions): follow them before you write one."
|
|
579
|
+
},
|
|
565
580
|
"row_template": {
|
|
566
581
|
"type": "string",
|
|
567
582
|
"description": "The text of every new row's note."
|
|
@@ -595,7 +610,7 @@ var OPERATIONS = [
|
|
|
595
610
|
},
|
|
596
611
|
{
|
|
597
612
|
"name": "create_table",
|
|
598
|
-
"description": 'Create a table: `name`, in `catalog` and `schema` (default: the database\'s defaults); the definition\ngoes in metastore.yaml, the rows in `<root>/<catalog>/<schema>/<name>/`. Names: lowercase letters,\ndigits, `_` (no dots: pass the catalog and the schema as their own arguments).\n- `description` (required): what a row of the table records. Every column needs its own `description`\n too, what it holds: the table is refused otherwise, with every missing one listed. Descriptions are how\n agents and people understand the schema, so write them for a reader who never saw the notes. The\n engine writes those of `id` and of `identity` "uuid" / "created" columns.\n- `columns`: specs like `{"name": "kind", "type": "enum", "values": ["a","b"], "required": true,\n "description": "What kind of entry the row is"}`.\n Types: string, integer, number, boolean, date, datetime, enum, link, list (+ `items`), json.\n Attributes: required, default (`"{now}"`/`"{today}"`), min, max, step, values, `ordered` (enum in\n order: filters/avg use the position), ref (link target, full `catalog.schema.table` or "self"),\n unique, label, description, aliases, `generated` (e.g. `"date(occurred_at)"`, `"{name} {surname}"`),\n `identity` ("filename" | "created"), `vocabulary` (allowed values = names of another table\'s rows),\n `hierarchy: true` (one parent link to its own table), `dense` (written on every row),\n `inverse` on a link column: the column of the `ref` table that links back (`friends` \u2194\n `friends`, `children` \u2194 `parents`, `partner` \u2194 `partner`); writes keep both sides in step.\n- `time_column`: rows named by that date/datetime; otherwise `filename` (e.g. `"{name}"`).\n- The table\'s options, as alter_table names them: `aliases` (how agents find it, with the\n description), `partition`, `exclude`, `archive`, `history` (keep its versions; default: the\n database\'s setting), `autolink_target` (true / false: may automatic links link its rows? default:\n yes, unless its rows are named by a date or a time, as with `time_column`).\n- `row_template`: markdown body of new rows. Shared columns come from bases: `set_table_bases`.\n- `tags`: key/value labels of the table, strings (`{"domain": "health"}`); list_tables and\n describe_table return them, alter_table changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
613
|
+
"description": 'Create a table: `name`, in `catalog` and `schema` (default: the database\'s defaults); the definition\ngoes in metastore.yaml, the rows in `<root>/<catalog>/<schema>/<name>/`. Names: lowercase letters,\ndigits, `_` (no dots: pass the catalog and the schema as their own arguments).\n- `description` (required): what a row of the table records. Every column needs its own `description`\n too, what it holds: the table is refused otherwise, with every missing one listed. Descriptions are how\n agents and people understand the schema, so write them for a reader who never saw the notes. The\n engine writes those of `id` and of `identity` "uuid" / "created" columns.\n- `columns`: specs like `{"name": "kind", "type": "enum", "values": ["a","b"], "required": true,\n "description": "What kind of entry the row is"}`.\n Types: string, integer, number, boolean, date, datetime, enum, link, list (+ `items`), json.\n Attributes: required, default (`"{now}"`/`"{today}"`), min, max, step, values, `ordered` (enum in\n order: filters/avg use the position), ref (link target, full `catalog.schema.table` or "self"),\n unique, label, description, aliases, `generated` (e.g. `"date(occurred_at)"`, `"{name} {surname}"`),\n `identity` ("filename" | "created"), `vocabulary` (allowed values = names of another table\'s rows),\n `hierarchy: true` (one parent link to its own table), `acyclic: true` (links to rows of its own table that never loop back, such as tasks blocked by tasks; with `inverse`, the rule holds on both sides), `dense` (written on every row),\n `inverse` on a link column: the column of the `ref` table that links back (`friends` \u2194\n `friends`, `children` \u2194 `parents`, `partner` \u2194 `partner`); writes keep both sides in step.\n- `time_column`: rows named by that date/datetime; otherwise `filename` (e.g. `"{name}"`).\n- The table\'s options, as alter_table names them: `aliases` (how agents find it, with the\n description), `partition`, `exclude`, `archive`, `history` (keep its versions; default: the\n database\'s setting), `autolink_target` (true / false: may automatic links link its rows? default:\n yes, unless its rows are named by a date or a time, as with `time_column`).\n- `row_template`: markdown body of new rows. Shared columns come from bases: `set_table_bases`.\n- `instructions`: how to fill a row, for agents (Markdown); describe_table returns them.\n- `tags`: key/value labels of the table, strings (`{"domain": "health"}`); list_tables and\n describe_table return them, alter_table changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
599
614
|
"inputSchema": {
|
|
600
615
|
"additionalProperties": false,
|
|
601
616
|
"properties": {
|
|
@@ -756,6 +771,18 @@ var OPERATIONS = [
|
|
|
756
771
|
"default": null,
|
|
757
772
|
"description": "Markdown body of new rows; {column} placeholders are filled from the row."
|
|
758
773
|
},
|
|
774
|
+
"instructions": {
|
|
775
|
+
"anyOf": [
|
|
776
|
+
{
|
|
777
|
+
"type": "string"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"type": "null"
|
|
781
|
+
}
|
|
782
|
+
],
|
|
783
|
+
"default": null,
|
|
784
|
+
"description": "How to fill a row, for agents (Markdown): which columns first, what to ask the user. describe_table returns them."
|
|
785
|
+
},
|
|
759
786
|
"fields": {
|
|
760
787
|
"anyOf": [
|
|
761
788
|
{
|
|
@@ -893,6 +920,10 @@ var OPERATIONS = [
|
|
|
893
920
|
"type": "string",
|
|
894
921
|
"description": "The CHECK's name (code check)."
|
|
895
922
|
},
|
|
923
|
+
"hint": {
|
|
924
|
+
"type": "string",
|
|
925
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
926
|
+
},
|
|
896
927
|
"code": {
|
|
897
928
|
"type": "string",
|
|
898
929
|
"enum": [
|
|
@@ -1302,6 +1333,10 @@ var OPERATIONS = [
|
|
|
1302
1333
|
"type": "string",
|
|
1303
1334
|
"description": "The CHECK's name (code check)."
|
|
1304
1335
|
},
|
|
1336
|
+
"hint": {
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
1339
|
+
},
|
|
1305
1340
|
"code": {
|
|
1306
1341
|
"type": "string",
|
|
1307
1342
|
"enum": [
|
|
@@ -1581,7 +1616,7 @@ var OPERATIONS = [
|
|
|
1581
1616
|
},
|
|
1582
1617
|
{
|
|
1583
1618
|
"name": "add_column",
|
|
1584
|
-
"description": 'Add a typed column. Sparse by default (written only on rows that have a value \u2014 use for\nmetrics, e.g. `{"name": "metric_mood", "type": "integer", "min": 1, "max": 5, "label":\n"Mood", "aliases": ["mood"], "description": "Mood of the day, 1 = bad, 5 = great"}`).\n`description` is required: what the column holds, for the agents and people who read the schema\n(the engine writes it for `identity` "uuid" / "created" columns).\n`dense: true` in the spec adds it to every row with its `default`. Call `describe_table` first: never add\na column whose meaning an existing column (name/label/aliases/description) already covers.\nColumn names are permanent identifiers; only `rename_column` changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
1619
|
+
"description": 'Add a typed column. Sparse by default (written only on rows that have a value \u2014 use for\nmetrics, e.g. `{"name": "metric_mood", "type": "integer", "min": 1, "max": 5, "label":\n"Mood", "aliases": ["mood"], "description": "Mood of the day, 1 = bad, 5 = great"}`).\n`description` is required: what the column holds, for the agents and people who read the schema\n(the engine writes it for `identity` "uuid" / "created" columns).\n`dense: true` in the spec adds it to every row with its `default`. Call `describe_table` first: never add\na column whose meaning an existing column (name/label/aliases/description) already covers.\nColumn names are permanent identifiers; only `rename_column` changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\nAcyclic links: `acyclic: true` on a link (or list of links) to the table itself refuses every write that closes a cycle, on either side of an `inverse`; refused while existing rows form one (they are listed).\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
1585
1620
|
"inputSchema": {
|
|
1586
1621
|
"additionalProperties": false,
|
|
1587
1622
|
"properties": {
|
|
@@ -1702,6 +1737,10 @@ var OPERATIONS = [
|
|
|
1702
1737
|
"type": "string",
|
|
1703
1738
|
"description": "The CHECK's name (code check)."
|
|
1704
1739
|
},
|
|
1740
|
+
"hint": {
|
|
1741
|
+
"type": "string",
|
|
1742
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
1743
|
+
},
|
|
1705
1744
|
"code": {
|
|
1706
1745
|
"type": "string",
|
|
1707
1746
|
"enum": [
|
|
@@ -2104,6 +2143,10 @@ var OPERATIONS = [
|
|
|
2104
2143
|
"type": "string",
|
|
2105
2144
|
"description": "The CHECK's name (code check)."
|
|
2106
2145
|
},
|
|
2146
|
+
"hint": {
|
|
2147
|
+
"type": "string",
|
|
2148
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
2149
|
+
},
|
|
2107
2150
|
"code": {
|
|
2108
2151
|
"type": "string",
|
|
2109
2152
|
"enum": [
|
|
@@ -2503,6 +2546,10 @@ var OPERATIONS = [
|
|
|
2503
2546
|
"type": "string",
|
|
2504
2547
|
"description": "The CHECK's name (code check)."
|
|
2505
2548
|
},
|
|
2549
|
+
"hint": {
|
|
2550
|
+
"type": "string",
|
|
2551
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
2552
|
+
},
|
|
2506
2553
|
"code": {
|
|
2507
2554
|
"type": "string",
|
|
2508
2555
|
"enum": [
|
|
@@ -2782,7 +2829,7 @@ var OPERATIONS = [
|
|
|
2782
2829
|
},
|
|
2783
2830
|
{
|
|
2784
2831
|
"name": "alter_column",
|
|
2785
|
-
"description": 'Change a column\'s attributes (type, min/max/step, values, required, default, label,\naliases, description, note, `ref_where`, `ref_by` (see list_link_targets); `null` removes an attribute, except\n`description`, which changes but never goes (null or "" is refused); `dense` true/false). Refused with\nthe list of violating rows when existing values do not satisfy the new definition. A\ndifferent scale means a different column: add a new one instead of rescaling. To rename one\nenum value use `rename_value`. Dropping an enum value that a `ref_by` (of any table) allows as a\ntarget level is refused, naming it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
2832
|
+
"description": 'Change a column\'s attributes (type, min/max/step, values, required, default, label,\naliases, 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\n`description`, which changes but never goes (null or "" is refused); `dense` true/false). Refused with\nthe list of violating rows when existing values do not satisfy the new definition. A\ndifferent scale means a different column: add a new one instead of rescaling. To rename one\nenum value use `rename_value`. Dropping an enum value that a `ref_by` (of any table) allows as a\ntarget level is refused, naming it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
2786
2833
|
"inputSchema": {
|
|
2787
2834
|
"additionalProperties": false,
|
|
2788
2835
|
"properties": {
|
|
@@ -2907,6 +2954,10 @@ var OPERATIONS = [
|
|
|
2907
2954
|
"type": "string",
|
|
2908
2955
|
"description": "The CHECK's name (code check)."
|
|
2909
2956
|
},
|
|
2957
|
+
"hint": {
|
|
2958
|
+
"type": "string",
|
|
2959
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
2960
|
+
},
|
|
2910
2961
|
"code": {
|
|
2911
2962
|
"type": "string",
|
|
2912
2963
|
"enum": [
|
|
@@ -3186,7 +3237,7 @@ var OPERATIONS = [
|
|
|
3186
3237
|
},
|
|
3187
3238
|
{
|
|
3188
3239
|
"name": "alter_table",
|
|
3189
|
-
"description": 'Alter a table: move it (`catalog`, `schema`), rename it (`name`), change\n`partition` / `filename` patterns, `description` (changes, never goes: "" is refused), `aliases`,\n`exclude` folders, `row_template`\n("" removes it), `history` (true | false | "default"), `autolink_target`\n(true | false | "default": may automatic links link its rows? default: yes, unless its rows are named by\na date or a time) or `tags` (key/value\nlabels merged into the table\'s, e.g. `{"domain": "health"}`; a `null` value removes that tag;\n`clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those),\n`archive` (folder name inside the table folder) or `fields` (untyped fields, name \u2192 default; a\n`null` value removes one). Rows, archive and transaction log follow; links are updated; renamed\nrows keep their old name in `aliases`. A change of metadata only (tags, description, aliases,\nhistory, autolink_target, row_template, fields) rewrites the table entry alone: no row is moved or rewritten. Refused\nwhen a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows\nlinks, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not\nrewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
3240
|
+
"description": 'Alter a table: move it (`catalog`, `schema`), rename it (`name`), change\n`partition` / `filename` patterns, `description` (changes, never goes: "" is refused), `aliases`,\n`exclude` folders, `row_template`\n("" removes it), `instructions` (how to fill a row, for agents; "" removes them), `history` (true | false | "default"), `autolink_target`\n(true | false | "default": may automatic links link its rows? default: yes, unless its rows are named by\na date or a time) or `tags` (key/value\nlabels merged into the table\'s, e.g. `{"domain": "health"}`; a `null` value removes that tag;\n`clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those),\n`archive` (folder name inside the table folder) or `fields` (untyped fields, name \u2192 default; a\n`null` value removes one). Rows, archive and transaction log follow; links are updated; renamed\nrows keep their old name in `aliases`. A change of metadata only (tags, description, aliases,\nhistory, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused\nwhen a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows\nlinks, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not\nrewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
3190
3241
|
"inputSchema": {
|
|
3191
3242
|
"additionalProperties": false,
|
|
3192
3243
|
"properties": {
|
|
@@ -3336,6 +3387,18 @@ var OPERATIONS = [
|
|
|
3336
3387
|
"default": null,
|
|
3337
3388
|
"description": 'Markdown body of new rows; "" removes it.'
|
|
3338
3389
|
},
|
|
3390
|
+
"instructions": {
|
|
3391
|
+
"anyOf": [
|
|
3392
|
+
{
|
|
3393
|
+
"type": "string"
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
"type": "null"
|
|
3397
|
+
}
|
|
3398
|
+
],
|
|
3399
|
+
"default": null,
|
|
3400
|
+
"description": 'How to fill a row, for agents (Markdown); "" removes them.'
|
|
3401
|
+
},
|
|
3339
3402
|
"tags": {
|
|
3340
3403
|
"anyOf": [
|
|
3341
3404
|
{
|
|
@@ -3496,6 +3559,10 @@ var OPERATIONS = [
|
|
|
3496
3559
|
"type": "string",
|
|
3497
3560
|
"description": "The CHECK's name (code check)."
|
|
3498
3561
|
},
|
|
3562
|
+
"hint": {
|
|
3563
|
+
"type": "string",
|
|
3564
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
3565
|
+
},
|
|
3499
3566
|
"code": {
|
|
3500
3567
|
"type": "string",
|
|
3501
3568
|
"enum": [
|
|
@@ -3952,6 +4019,10 @@ var OPERATIONS = [
|
|
|
3952
4019
|
"type": "string",
|
|
3953
4020
|
"description": "The CHECK's name (code check)."
|
|
3954
4021
|
},
|
|
4022
|
+
"hint": {
|
|
4023
|
+
"type": "string",
|
|
4024
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
4025
|
+
},
|
|
3955
4026
|
"code": {
|
|
3956
4027
|
"type": "string",
|
|
3957
4028
|
"enum": [
|
|
@@ -4353,6 +4424,10 @@ var OPERATIONS = [
|
|
|
4353
4424
|
"type": "string",
|
|
4354
4425
|
"description": "The CHECK's name (code check)."
|
|
4355
4426
|
},
|
|
4427
|
+
"hint": {
|
|
4428
|
+
"type": "string",
|
|
4429
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
4430
|
+
},
|
|
4356
4431
|
"code": {
|
|
4357
4432
|
"type": "string",
|
|
4358
4433
|
"enum": [
|
|
@@ -5415,6 +5490,10 @@ var OPERATIONS = [
|
|
|
5415
5490
|
"type": "string",
|
|
5416
5491
|
"description": "The CHECK's name (code check)."
|
|
5417
5492
|
},
|
|
5493
|
+
"hint": {
|
|
5494
|
+
"type": "string",
|
|
5495
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
5496
|
+
},
|
|
5418
5497
|
"code": {
|
|
5419
5498
|
"type": "string",
|
|
5420
5499
|
"enum": [
|
|
@@ -5821,6 +5900,10 @@ var OPERATIONS = [
|
|
|
5821
5900
|
"type": "string",
|
|
5822
5901
|
"description": "The CHECK's name (code check)."
|
|
5823
5902
|
},
|
|
5903
|
+
"hint": {
|
|
5904
|
+
"type": "string",
|
|
5905
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
5906
|
+
},
|
|
5824
5907
|
"code": {
|
|
5825
5908
|
"type": "string",
|
|
5826
5909
|
"enum": [
|
|
@@ -6100,7 +6183,7 @@ var OPERATIONS = [
|
|
|
6100
6183
|
},
|
|
6101
6184
|
{
|
|
6102
6185
|
"name": "insert_row",
|
|
6103
|
-
"description": "Insert a row (new note). Values are validated against the columns; the note path comes from\nthe table's `path`/`filename` patterns (e.g. an event logged today about last night lands in\nlast night's day folder when you set `occurred_at` to last night). `body` is the note text.\nGenerated / identity columns are computed (do not pass them); CHECK constraints are enforced.\nReturns `migration_id` (undo) and the created path in `planned_creates`.\n`body` links the notes it mentions by name, at their first mention (automatic links; off with\n`autolink: false` or the database's `autolink` setting). `links_added` lists the links made;\n`ambiguous_mentions` lists the mentions left as text with the notes they may name: read those,\nthen link the right one with update_row and `autolink: false`, or leave the text.",
|
|
6186
|
+
"description": "Insert a row (new note). When describe_table gives the table's `instructions`, fill the row as they say. Values are validated against the columns; the note path comes from\nthe table's `path`/`filename` patterns (e.g. an event logged today about last night lands in\nlast night's day folder when you set `occurred_at` to last night). `body` is the note text.\nGenerated / identity columns are computed (do not pass them); CHECK constraints are enforced.\nReturns `migration_id` (undo) and the created path in `planned_creates`.\n`body` links the notes it mentions by name, at their first mention (automatic links; off with\n`autolink: false` or the database's `autolink` setting). `links_added` lists the links made;\n`ambiguous_mentions` lists the mentions left as text with the notes they may name: read those,\nthen link the right one with update_row and `autolink: false`, or leave the text.",
|
|
6104
6187
|
"inputSchema": {
|
|
6105
6188
|
"additionalProperties": false,
|
|
6106
6189
|
"properties": {
|
|
@@ -6255,6 +6338,10 @@ var OPERATIONS = [
|
|
|
6255
6338
|
"type": "string",
|
|
6256
6339
|
"description": "The CHECK's name (code check)."
|
|
6257
6340
|
},
|
|
6341
|
+
"hint": {
|
|
6342
|
+
"type": "string",
|
|
6343
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
6344
|
+
},
|
|
6258
6345
|
"code": {
|
|
6259
6346
|
"type": "string",
|
|
6260
6347
|
"enum": [
|
|
@@ -6693,6 +6780,10 @@ var OPERATIONS = [
|
|
|
6693
6780
|
"type": "string",
|
|
6694
6781
|
"description": "The CHECK's name (code check)."
|
|
6695
6782
|
},
|
|
6783
|
+
"hint": {
|
|
6784
|
+
"type": "string",
|
|
6785
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
6786
|
+
},
|
|
6696
6787
|
"code": {
|
|
6697
6788
|
"type": "string",
|
|
6698
6789
|
"enum": [
|
|
@@ -7206,6 +7297,10 @@ var OPERATIONS = [
|
|
|
7206
7297
|
"type": "string",
|
|
7207
7298
|
"description": "The CHECK's name (code check)."
|
|
7208
7299
|
},
|
|
7300
|
+
"hint": {
|
|
7301
|
+
"type": "string",
|
|
7302
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
7303
|
+
},
|
|
7209
7304
|
"code": {
|
|
7210
7305
|
"type": "string",
|
|
7211
7306
|
"enum": [
|
|
@@ -7637,6 +7732,10 @@ var OPERATIONS = [
|
|
|
7637
7732
|
"type": "string",
|
|
7638
7733
|
"description": "The CHECK's name (code check)."
|
|
7639
7734
|
},
|
|
7735
|
+
"hint": {
|
|
7736
|
+
"type": "string",
|
|
7737
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
7738
|
+
},
|
|
7640
7739
|
"code": {
|
|
7641
7740
|
"type": "string",
|
|
7642
7741
|
"enum": [
|
|
@@ -8085,6 +8184,10 @@ var OPERATIONS = [
|
|
|
8085
8184
|
"type": "string",
|
|
8086
8185
|
"description": "The CHECK's name (code check)."
|
|
8087
8186
|
},
|
|
8187
|
+
"hint": {
|
|
8188
|
+
"type": "string",
|
|
8189
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
8190
|
+
},
|
|
8088
8191
|
"code": {
|
|
8089
8192
|
"type": "string",
|
|
8090
8193
|
"enum": [
|
|
@@ -8545,6 +8648,10 @@ var OPERATIONS = [
|
|
|
8545
8648
|
"type": "string",
|
|
8546
8649
|
"description": "The CHECK's name (code check)."
|
|
8547
8650
|
},
|
|
8651
|
+
"hint": {
|
|
8652
|
+
"type": "string",
|
|
8653
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
8654
|
+
},
|
|
8548
8655
|
"code": {
|
|
8549
8656
|
"type": "string",
|
|
8550
8657
|
"enum": [
|
|
@@ -9053,7 +9160,7 @@ var OPERATIONS = [
|
|
|
9053
9160
|
},
|
|
9054
9161
|
{
|
|
9055
9162
|
"name": "check_table",
|
|
9056
|
-
"description": "Validate every row against the table (required, types, ranges, enums, links, unknown\ncolumns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, 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.)",
|
|
9163
|
+
"description": "Validate every row against the table (required, types, ranges, enums, links, unknown\ncolumns, 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.)",
|
|
9057
9164
|
"inputSchema": {
|
|
9058
9165
|
"additionalProperties": false,
|
|
9059
9166
|
"properties": {
|
|
@@ -9166,6 +9273,10 @@ var OPERATIONS = [
|
|
|
9166
9273
|
"type": "string",
|
|
9167
9274
|
"description": "The CHECK's name (code check)."
|
|
9168
9275
|
},
|
|
9276
|
+
"hint": {
|
|
9277
|
+
"type": "string",
|
|
9278
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
9279
|
+
},
|
|
9169
9280
|
"code": {
|
|
9170
9281
|
"type": "string",
|
|
9171
9282
|
"enum": [
|
|
@@ -9619,6 +9730,10 @@ var OPERATIONS = [
|
|
|
9619
9730
|
"type": "string",
|
|
9620
9731
|
"description": "The CHECK's name (code check)."
|
|
9621
9732
|
},
|
|
9733
|
+
"hint": {
|
|
9734
|
+
"type": "string",
|
|
9735
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
9736
|
+
},
|
|
9622
9737
|
"code": {
|
|
9623
9738
|
"type": "string",
|
|
9624
9739
|
"enum": [
|
|
@@ -10062,6 +10177,10 @@ var OPERATIONS = [
|
|
|
10062
10177
|
"type": "string",
|
|
10063
10178
|
"description": "The CHECK's name (code check)."
|
|
10064
10179
|
},
|
|
10180
|
+
"hint": {
|
|
10181
|
+
"type": "string",
|
|
10182
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
10183
|
+
},
|
|
10065
10184
|
"code": {
|
|
10066
10185
|
"type": "string",
|
|
10067
10186
|
"enum": [
|
|
@@ -11145,6 +11264,10 @@ var OPERATIONS = [
|
|
|
11145
11264
|
"type": "string",
|
|
11146
11265
|
"description": "The CHECK's name (code check)."
|
|
11147
11266
|
},
|
|
11267
|
+
"hint": {
|
|
11268
|
+
"type": "string",
|
|
11269
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
11270
|
+
},
|
|
11148
11271
|
"code": {
|
|
11149
11272
|
"type": "string",
|
|
11150
11273
|
"enum": [
|
|
@@ -12582,6 +12705,10 @@ var OPERATIONS = [
|
|
|
12582
12705
|
"type": "string",
|
|
12583
12706
|
"description": "The CHECK's name (code check)."
|
|
12584
12707
|
},
|
|
12708
|
+
"hint": {
|
|
12709
|
+
"type": "string",
|
|
12710
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
12711
|
+
},
|
|
12585
12712
|
"code": {
|
|
12586
12713
|
"type": "string",
|
|
12587
12714
|
"enum": [
|
|
@@ -12992,6 +13119,10 @@ var OPERATIONS = [
|
|
|
12992
13119
|
"type": "string",
|
|
12993
13120
|
"description": "The CHECK's name (code check)."
|
|
12994
13121
|
},
|
|
13122
|
+
"hint": {
|
|
13123
|
+
"type": "string",
|
|
13124
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
13125
|
+
},
|
|
12995
13126
|
"code": {
|
|
12996
13127
|
"type": "string",
|
|
12997
13128
|
"enum": [
|
|
@@ -13458,7 +13589,7 @@ var OPERATIONS = [
|
|
|
13458
13589
|
},
|
|
13459
13590
|
{
|
|
13460
13591
|
"name": "add_constraint",
|
|
13461
|
-
"description": 'ALTER TABLE ADD CONSTRAINT `name` CHECK: `check` is a where filter every row must match,\ne.g. `{"value": {"gte": 1, "lte": 5}}`. A condition on a column the row leaves empty passes, like SQL;\ninside `or` / `and` / `not` an empty value is tested as it is (`{"exists": true}` there fails).\nA key may follow a link column to the row it names, as in queries: `{"parent.kind": "project"}`\n(further dots follow further links). An empty link passes at the top level and fails inside `or` / `and` /\n`not`; only the first link of a longer path is skipped when empty (`parent.parent.kind` fails for a row\nwhose parent has no parent). A link to a row that does not exist fails; on a list of links every linked\nrow must match. `not` turns that into a pass: `{"not": {"parent.kind": "area"}}` passes a link to a\nmissing row, so add `"parent.kind": {"exists": true}` to require a real one. Links resolve as in the\nvault (by path, from the row\'s note: same-named rows in two folders stay apart); renaming or moving a\nlinked row keeps them (they follow it).\nRefused while existing rows violate it (they are listed); then enforced on every write, by the same rule.\nA write that changes a linked row re-checks the rows that link to it and is refused, listing them, when\nit breaks them, naming the changed row (in a batch, re-link them first: each step is checked on the vault\nthe earlier ones left); the inverse links a write adds, undo_migration and restore_table are checked too.\nrename_column / rename_value follow into CHECKs; drop_column of a column a CHECK reads is refused.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
13592
|
+
"description": 'ALTER TABLE ADD CONSTRAINT `name` CHECK: `check` is a where filter every row must match,\ne.g. `{"value": {"gte": 1, "lte": 5}}`. A condition on a column the row leaves empty passes, like SQL;\ninside `or` / `and` / `not` an empty value is tested as it is (`{"exists": true}` there fails).\nA key may follow a link column to the row it names, as in queries: `{"parent.kind": "project"}`\n(further dots follow further links). An empty link passes at the top level and fails inside `or` / `and` /\n`not`; only the first link of a longer path is skipped when empty (`parent.parent.kind` fails for a row\nwhose parent has no parent). A link to a row that does not exist fails; on a list of links every linked\nrow must match. `not` turns that into a pass: `{"not": {"parent.kind": "area"}}` passes a link to a\nmissing row, so add `"parent.kind": {"exists": true}` to require a real one. Links resolve as in the\nvault (by path, from the row\'s note: same-named rows in two folders stay apart); renaming or moving a\nlinked row keeps them (they follow it).\nRefused while existing rows violate it (they are listed); then enforced on every write, by the same rule.\nA write that changes a linked row re-checks the rows that link to it and is refused, listing them, when\nit breaks them, naming the changed row (in a batch, re-link them first: each step is checked on the vault\nthe earlier ones left); the inverse links a write adds, undo_migration and restore_table are checked too.\nrename_column / rename_value follow into CHECKs; drop_column of a column a CHECK reads is refused.\n`hint`: what to do when a row breaks the rule, in your words; a refused write puts it first in its hint, and each violation of the CHECK carries it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
|
|
13462
13593
|
"inputSchema": {
|
|
13463
13594
|
"additionalProperties": false,
|
|
13464
13595
|
"properties": {
|
|
@@ -13472,6 +13603,18 @@ var OPERATIONS = [
|
|
|
13472
13603
|
"additionalProperties": true,
|
|
13473
13604
|
"type": "object"
|
|
13474
13605
|
},
|
|
13606
|
+
"hint": {
|
|
13607
|
+
"anyOf": [
|
|
13608
|
+
{
|
|
13609
|
+
"type": "string"
|
|
13610
|
+
},
|
|
13611
|
+
{
|
|
13612
|
+
"type": "null"
|
|
13613
|
+
}
|
|
13614
|
+
],
|
|
13615
|
+
"default": null,
|
|
13616
|
+
"description": "What a refused write tells the agent when a row breaks this CHECK: how to fix the row. It comes first in the refusal's hint; describe_table lists it in constraint_hints."
|
|
13617
|
+
},
|
|
13475
13618
|
"dry_run": {
|
|
13476
13619
|
"default": false,
|
|
13477
13620
|
"type": "boolean"
|
|
@@ -13582,6 +13725,10 @@ var OPERATIONS = [
|
|
|
13582
13725
|
"type": "string",
|
|
13583
13726
|
"description": "The CHECK's name (code check)."
|
|
13584
13727
|
},
|
|
13728
|
+
"hint": {
|
|
13729
|
+
"type": "string",
|
|
13730
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
13731
|
+
},
|
|
13585
13732
|
"code": {
|
|
13586
13733
|
"type": "string",
|
|
13587
13734
|
"enum": [
|
|
@@ -13980,6 +14127,10 @@ var OPERATIONS = [
|
|
|
13980
14127
|
"type": "string",
|
|
13981
14128
|
"description": "The CHECK's name (code check)."
|
|
13982
14129
|
},
|
|
14130
|
+
"hint": {
|
|
14131
|
+
"type": "string",
|
|
14132
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
14133
|
+
},
|
|
13983
14134
|
"code": {
|
|
13984
14135
|
"type": "string",
|
|
13985
14136
|
"enum": [
|
|
@@ -14445,6 +14596,10 @@ var OPERATIONS = [
|
|
|
14445
14596
|
"type": "string",
|
|
14446
14597
|
"description": "The CHECK's name (code check)."
|
|
14447
14598
|
},
|
|
14599
|
+
"hint": {
|
|
14600
|
+
"type": "string",
|
|
14601
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
14602
|
+
},
|
|
14448
14603
|
"code": {
|
|
14449
14604
|
"type": "string",
|
|
14450
14605
|
"enum": [
|
|
@@ -14839,6 +14994,10 @@ var OPERATIONS = [
|
|
|
14839
14994
|
"type": "string",
|
|
14840
14995
|
"description": "The CHECK's name (code check)."
|
|
14841
14996
|
},
|
|
14997
|
+
"hint": {
|
|
14998
|
+
"type": "string",
|
|
14999
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
15000
|
+
},
|
|
14842
15001
|
"code": {
|
|
14843
15002
|
"type": "string",
|
|
14844
15003
|
"enum": [
|
|
@@ -15264,6 +15423,10 @@ var OPERATIONS = [
|
|
|
15264
15423
|
"type": "string",
|
|
15265
15424
|
"description": "The CHECK's name (code check)."
|
|
15266
15425
|
},
|
|
15426
|
+
"hint": {
|
|
15427
|
+
"type": "string",
|
|
15428
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
15429
|
+
},
|
|
15267
15430
|
"code": {
|
|
15268
15431
|
"type": "string",
|
|
15269
15432
|
"enum": [
|
|
@@ -15676,6 +15839,10 @@ var OPERATIONS = [
|
|
|
15676
15839
|
"type": "string",
|
|
15677
15840
|
"description": "The CHECK's name (code check)."
|
|
15678
15841
|
},
|
|
15842
|
+
"hint": {
|
|
15843
|
+
"type": "string",
|
|
15844
|
+
"description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
|
|
15845
|
+
},
|
|
15679
15846
|
"code": {
|
|
15680
15847
|
"type": "string",
|
|
15681
15848
|
"enum": [
|