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

Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... #2363

Merged
merged 7 commits into from
Jul 15, 2024

Conversation

asg017
Copy link
Collaborator

@asg017 asg017 commented Jul 3, 2024

refs #2360

This PR adds a new dedicated endpoint to querying a database in Datasette with SQL. Previously, one would use the /dbname?sql=select... convention to do this, but it shared the same endpoints as normal database. So this PR adds a dedicated /dbname/-/query?sql=... route specifically for this task.

Old URLs that use the previous /dbname?sql=... endpoint will still work - we internally just redirect that to the new URL.


📚 Documentation preview 📚: https://datasette--2363.org.readthedocs.build/en/2363/

@asg017 asg017 marked this pull request as ready for review July 9, 2024 16:11
@simonw
Copy link
Owner

simonw commented Jul 15, 2024

Spotted that the form on this page:

CleanShot 2024-07-15 at 09 57 06@2x

Still targets /content which then redirects. I'll push a fix for that.

<form class="sql" action="{{ urls.database(database) }}" method="get">

docs/pages.rst Outdated Show resolved Hide resolved
@simonw simonw merged commit a23c2ae into simonw:main Jul 15, 2024
19 checks passed
@simonw
Copy link
Owner

simonw commented Jul 15, 2024

That test failure was the same intermittent failure we've seen on 3.8 in a few other places:

@simonw simonw mentioned this pull request Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants