Closed curiousleo closed 3 years ago
Thanks for the SQL file. I could replicate this bug locally like so:
wget https://github.com/simonw/datasette-graphql/files/7360568/EinheitenSolar.sql.txt
sqlite3 einheit.db < EinheitenSolar.sql.txt
datasette einheit.db
OK, I see what is happening here. There's only one table in that file, but it's CREATE TABLE
refers to other tables which don't currently exist.
I'm a little surprised that Datasette doesn't throw errors there to be honest - good that it doesn't!
I think I can fix this in the introspect_tables()
function:
Error message
Full stack trace: traceback.txt
SQL schema
This happens when I try to open the page of a table "EinheitenSolar". It relates to the table "Katalogwerte" (mentioned in the traceback) in that the "EinheitenSolar" table contains columns which reference "Katalogwerte":
Note that without the GraphQL plugin, Datasette recognises the
references
declarations and displays thelabel_column
as expected. So the tables themselves seem to have a structure that Datasette can generally work with, it's just this plugin that is unhappy.Full SQL for "EinheitenSolar": EinheitenSolar.sql.txt
Screenshot
Versions