You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble replicating this bug. In particular, I don't understand what you mean by "these are then rendered in the datasette query box using single quotes" - since canned queries aren't displayed in a textarea. Do you have an example database / metadata.json I can use to investigate this further?
If a SQLite table column name contains spaces, they are usually referred to in double quotes:
SELECT * FROM mytable WHERE "gappy column name"="my value";
In the JSON metadata file, this is passed by escaping the double quotes:
"queries": {"my query": "SELECT * FROM mytable WHERE \"gappy column name\"=\"my value\";"}
When specifying a custom query in
metadata.json
using double quotes, these are then rendered in the datasette query box using single quotes:SELECT * FROM mytable WHERE 'gappy column name'='my value';
which does not work.
Alternatively, a valid custom query can be passed using backticks (`) to quote the column name and single (unescaped) quotes for the matched value:
"queries": {"my query": "SELECT * FROM mytable WHERE `gappy column name`='my value';"}
The text was updated successfully, but these errors were encountered: