-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Milestone
Description
See #419: if Datasette is going to work against mutable SQLite files it can no longer assume that the .inspect() method will have cached the correct schema for all tables in all attached databases.
So everywhere in the code at the moment that relies on .inspect() data needs to be modified to use live introspection of the schema instead.
From a comment later on: here are the uses I need to fix as a checklist:
-
table_exists() -
info["file"]in.execute() -
resolve_db_name() -
.database_url(database) -
DatabaseDownloadfile path -
sortable_columns_for_table()uses it to find the columns in a table -
expandable_columns()uses it to find foreign keys -
expand_foreign_keys()uses it to find foreign keys -
display_columns_and_rows()uses it to find primary keys and foreign keys... but also has access to a cursor.description which it uses to list the columns -
TableView.datauses it to lookup columns and primary keys and the table_rows_count (used if the thing isn't a view) and probably a few more things, this method is huge! -
RowView.datauses it for primary keys -
foreign_key_tables()uses it for foreign keys -
DatabaseViewlist of tables -
IndexView
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels