Sometimes sort tables by number of relationships, closes #460

This commit is contained in:
Simon Willison 2019-05-15 20:23:33 -07:00
commit faf33515b2
4 changed files with 36 additions and 4 deletions

View file

@ -30,6 +30,7 @@ from .utils import (
detect_spatialite,
escape_css_string,
escape_sqlite,
get_all_foreign_keys,
get_outbound_foreign_keys,
get_plugins,
module_from_path,
@ -261,6 +262,11 @@ class ConnectedDatabase:
)
return [r[0] for r in results.rows]
async def get_all_foreign_keys(self):
return await self.ds.execute_against_connection_in_thread(
self.name, get_all_foreign_keys
)
def __repr__(self):
tags = []
if self.is_mutable: