Database.get_outbound_foreign_keys() refactor

Following this, the only module that ever makes calls to the low-level
execute_against_connection_in_thread() method is datasette/database.py
This commit is contained in:
Simon Willison 2019-05-27 11:41:44 -07:00
commit edb36629e7
3 changed files with 13 additions and 16 deletions

View file

@ -205,6 +205,11 @@ class Database:
self.name, get_all_foreign_keys
)
async def get_outbound_foreign_keys(self, table):
return await self.ds.execute_against_connection_in_thread(
self.name, lambda conn: get_outbound_foreign_keys(conn, table)
)
async def get_table_definition(self, table, type_="table"):
table_definition_rows = list(
await self.ds.execute(