mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Sometimes sort tables by number of relationships, closes #460
This commit is contained in:
parent
689cf9c139
commit
faf33515b2
4 changed files with 36 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue