Validate every row against the table (required, types, ranges, enums, links, unknown
const url = 'https://example.com/datanotes/operations/check_table/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"table":null,"limit":500,"offset":0}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/datanotes/operations/check_table/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "table": null, "limit": 500, "offset": 0 }'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.) warnings lists what is unwise in a table’s layout, though allowed (pack_partition: a partition wider than the periods of its packs), each with a hint and a docs link.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Owner only, on reads only (an operation that only reads, tokens/me/, extensions/, the change stream): the request runs with this named token’s permissions and read scope, and the token’s last_seen does not change. A named token sending it gets 403; a request that is not a read gets 400.
Request Body
Section titled “Request Body”Responses
Section titled “Responses”Done.
object
Qualified table; null when every table was checked.
Rows checked.
Tables checked (when every table was checked).
Rows breaking the rules in all (violations is the page from offset).
Tables that could not be checked (when every table was checked), with the reason.
object
Rows breaking the table’s rules (this page of them).
A row breaking the rules, with its table when every table was checked.
object
Row note path.
The row’s qualified table (when every table was checked).
What is wrong with this row.
object
The column the violation is about (every code but check and unreadable).
The item of a list column that breaks the rule, from 0.
The CHECK’s name (code check).
The CHECK’s own hint (code check), when the constraint has one: how to fix the row.
Kind of violation.
Agent-readable explanation.
The offending value, when there is one.
What is unwise in a table’s layout, though allowed: a partition wider than the periods of the table’s packs (create_table, alter_table; check_table lists them for the tables it checks). Present when there is one.
object
Kind of warning.
The table, catalog.schema.table.
What is unwise, and why.
How to fix it.
Where to read more (a Markdown page of the docs, with its anchor).
Example
{ "violations": [ { "violations": [ { "code": "required" } ] } ], "warnings": [ { "code": "pack_partition" } ]}Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Missing or wrong bearer token.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}A named token whose read patterns do not cover the table, view or note the request names (such as token cook may not read personal.health.weight). Sets it did not name (listings, bases, search, the graph, the change feed) are filtered instead.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unknown table, view, migration, note or folder.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Ambiguous table name: it matches several tables (paths or tables lists them).
object
The tables’ folders the name matches.
The qualified tables the name matches.
Example generated
{ "error": "example", "paths": [ "example" ], "tables": [ "example" ]}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}