simonw / simonw/datasette

Question: Access to immutable database-path

Open
#758 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement small
Dominant language
Python
Stars
11.5k
Forks
904
Avg merge
4d 17h
Merged PRs (30d)
18

Description

Hi Simon

Is there anywhere in the app-context where one can access the hashed urlpath of the database? Currently it's included in the template-context (databases[0]["path") when rendering urls of the database (eg. /db-44b06v9/cases...), but where can I find the hashed url when rendering the index-page? I'm trying to avoid redirects. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the app-context and template-context used when rendering the index page, then compare them with the databases[0]["path"] value available while rendering database URLs. Determine how the immutable database path could be exposed on the index page without a redirect; done means the hashed path is available in the relevant rendering context and covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.