RowView.data() no longer uses inspect refs #420

This commit is contained in:
Simon Willison 2019-04-06 20:17:47 -07:00
commit f23120a964

View file

@ -803,9 +803,9 @@ class RowView(RowTableShared):
async def data(self, request, database, hash, table, pk_path, default_labels=False): async def data(self, request, database, hash, table, pk_path, default_labels=False):
pk_values = urlsafe_components(pk_path) pk_values = urlsafe_components(pk_path)
info = self.ds.inspect()[database] pks = await self.ds.execute_against_connection_in_thread(
table_info = info["tables"].get(table) or {} database, lambda conn: detect_primary_keys(conn, table)
pks = table_info.get("primary_keys") or [] )
use_rowid = not pks use_rowid = not pks
select = "*" select = "*"
if use_rowid: if use_rowid: