Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/-/databases should reflect connection order, not alphabetical order #1216

Closed
simonw opened this issue Feb 3, 2021 · 1 comment
Closed
Labels

Comments

@simonw
Copy link
Owner

simonw commented Feb 3, 2021

The order in which databases are attached to Datasette matters - it affects the homepage, and it's beginning to influence how certain plugins work (see simonw/datasette-tiles#8).

Two years ago in cccea85 I made /-/databases return things in alphabetical order, to fix a test failure in Python 3.5.

Python 3.5 is no longer supported, so this is no longer necessary - and this behaviour should now be treated as a bug.

@simonw simonw added the bug label Feb 3, 2021
@simonw
Copy link
Owner Author

simonw commented Feb 3, 2021

Relevant code:

datasette/datasette/app.py

Lines 620 to 632 in 1600d2a

def _connected_databases(self):
return [
{
"name": d.name,
"path": d.path,
"size": d.size,
"is_mutable": d.is_mutable,
"is_memory": d.is_memory,
"hash": d.hash,
}
for name, d in sorted(self.databases.items(), key=lambda p: p[1].name)
if name != "_internal"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant