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

Submitting SQL on hide page is broken #425

Closed
simonw opened this issue Apr 7, 2019 · 2 comments
Closed

Submitting SQL on hide page is broken #425

simonw opened this issue Apr 7, 2019 · 2 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Apr 7, 2019

Clicking the submit button here doesn't work correctly: https://3a208a4.datasette.io/fixtures?sql=select+%2A+from+compound_three_primary_keys+order+by+pk1%2C+pk2%2C+pk3+limit+101&_hide_sql=1

@simonw simonw added the bug label Apr 7, 2019
@simonw
Copy link
Owner Author

simonw commented Apr 7, 2019

Here's the problem:

{% if not hide_sql %}
{% if editable and config.allow_sql %}
<p><textarea name="sql">{% if query and query.sql %}{{ query.sql }}{% else %}select * from {{ tables[0].name|escape_sqlite }}{% endif %}</textarea></p>
{% else %}
<pre>{% if query %}{{ query.sql }}{% endif %}</pre>
{% endif %}
{% endif %}

Need an else block here that adds the SQL as a hidden form field.

@simonw simonw closed this as completed in e11cb4c Apr 12, 2019
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