mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
foreign_key_tables no longer uses inspect, refs #420
This commit is contained in:
parent
f23120a964
commit
db02311ebf
1 changed files with 5 additions and 5 deletions
|
|
@ -14,6 +14,7 @@ from datasette.utils import (
|
||||||
detect_primary_keys,
|
detect_primary_keys,
|
||||||
escape_sqlite,
|
escape_sqlite,
|
||||||
filters_should_redirect,
|
filters_should_redirect,
|
||||||
|
get_all_foreign_keys,
|
||||||
is_url,
|
is_url,
|
||||||
path_from_row_pks,
|
path_from_row_pks,
|
||||||
path_with_added_args,
|
path_with_added_args,
|
||||||
|
|
@ -884,11 +885,10 @@ class RowView(RowTableShared):
|
||||||
if len(pk_values) != 1:
|
if len(pk_values) != 1:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
table_info = self.ds.inspect()[database]["tables"].get(table)
|
all_foreign_keys = await self.ds.execute_against_connection_in_thread(
|
||||||
if not table_info:
|
database, get_all_foreign_keys
|
||||||
return []
|
)
|
||||||
|
foreign_keys = all_foreign_keys[table]["incoming"]
|
||||||
foreign_keys = table_info["foreign_keys"]["incoming"]
|
|
||||||
if len(foreign_keys) == 0:
|
if len(foreign_keys) == 0:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue