-
-
Notifications
You must be signed in to change notification settings - Fork 772
Description
Because of https://github.com/simonw/datasette/blob/main/datasette/views/index.py#L63, the tables
dict built does not include invisible tables; however, if https://github.com/simonw/datasette/blob/main/datasette/views/index.py#L80 is reached (because table_counts was not successfully initialized, e.g. due to a very large database) then as db.get_all_foreign_keys() returns ALL tables, a KeyError will be raised.
This error can be recreated with the fixtures.db if any table is hidden, e.g. by adding something like "foreign_key_references": { "allow": {} }
to fixtures-metadata.json and deleting or not table_counts
from https://github.com/simonw/datasette/blob/main/datasette/views/index.py#L77.
I'm not sure how to fix this error; perhaps by testing if the table is in the aforementions tables
dict.