-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ability to use parameterized queries, including with textareas #7
Comments
Actually I can use the That's in a (currently undocumented) utility function It was added in 0.59 simonw/datasette@fc48468 so it's safe to use. I should document it in Datasette though to make sure it's part of the documented stable API. |
This syntax does not work in Python 3.8:
|
This would have been useful for inserting a big blob of JSON data as seen in this TIL: https://til.simonwillison.net/sqlite/geopoly
I had to manually replace
'
with''
in order to get the import to work.It would have been better if I could have done this:
And had it detect the parameter and use it to add a textarea to the page.
Might have to detect it with JavaScript here since unlike GET read-only queries it's not safe to submit the query first.
Thought I could detect incoming POST that was missing those params and redirect to a ?sql= GET page that prepopulates the form and adds the form fields.
Need protection against clickjacking attacks if I do that though: prevent framing and add a short countdown before the submit button can be pressed.
The text was updated successfully, but these errors were encountered: