Find rows that break the schema
check_table checks the rows a table holds now against its columns and CHECK constraints, and lists the ones that break a rule. Use it after hand edits, after a sync, or before you tighten a rule. Without table, it checks every table, page by page. It writes nothing.
Find rows that break the schema
Section titled “Find rows that break the schema”The engine can’t refuse a hand edit, so a note you edit by hand can break the schema. check_table validates every row against these rules:
- Values: types, ranges and enums
- Presence: required columns and unknown keys
- Relations and rules: links and constraints
You edit datanotes/main/public/film/His Girl Friday.md by hand, outside the engine. The note now reads:
---table: main.public.filmid: 01a0f000-0000-7000-8000-0000000000bbtitle: His Girl Fridayyear: 1940status: finishedrating: 6format: Blu-ray---check_table
{ "table": "film" }Answer:
{ "table": "film", "rows_checked": 3, "total": 1, "violations": [ { "path": "datanotes/main/public/film/His Girl Friday.md", "violations": [ { "column": "status", "code": "enum", "message": "must be one of: to watch; watched", "value": "finished" }, { "column": "rating", "code": "max", "message": "must be <= 5", "value": 6 }, { "column": "format", "code": "unknown_column", "message": "is not a column of table \"film\"", "value": "Blu-ray" } ] } ]}