-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
Introduce concept of a database route
, separate from its name
#1668
Comments
The datasette/datasette/database.py Lines 29 to 50 in 6141938
So need a different name for the path-that-is-used-in-the-URL. |
Options:
I like |
Worth noting that the Lines 397 to 413 in 6141938
|
Implementing this is a little tricky because there's a whole lot of code that expects the The datasette/datasette/views/base.py Lines 383 to 555 in 6141938
All the more reason to get rid of that |
Marking this as blocked until #1660 is done. |
Right now if a database has a
But the output on |
The output of
So that's a problem already: having |
I'm inclined to redefine |
The docs do currently describe Good thing I'm not at 1.0 yet so I can change that! |
Pretty sure changing it will break some existing plugins though, including likely Datasette Desktop. |
I'm going to keep |
I'm trying to think if there's any reason not to use Decision made: I'm going with |
route
, separate from its name
I think I've got this working but I need to write a test for it that covers the rare case when the route is not the same thing as the database name. I'll do that with a new test. |
Need to update documentation in a few places - e.g. https://docs.datasette.io/en/stable/internals.html#remove-database-name
|
Also need to update the Need to add tests that check the links in the HTML and can confirm this is working correctly. |
I'd like to have a live demo of this up on |
I'm going to add a |
Building this plugin instantly revealed that all of the links - on the homepage and the database page and so on - are incorrect: from datasette import hookimpl
@hookimpl
def startup(datasette):
db = datasette.get_database("fixtures2")
db.route = "alternative-route" |
I'm going to release this as a 0.61 alpha so I can more easily depend on it from |
Some issues came up in the new
datasette-hashed-urls
plugin relating to the way it renames databases on startup to achieve unique URLs that depend on the database SHA-256 content:All three of these could be addressed by making the "path" concept for a database (the
/foo
bit where it is served) work independently of the database's name, which would be used for default display and also as the alias when configuring cross-database aliases.The text was updated successfully, but these errors were encountered: