Web SQL Query Client Errors
Using the Web Query Client for Vercel Storage, in the Data section, I cannot run any SQL queries. At first, I thought it may be the syntax of the queries as the (very short) error message suggests, although the queries were generated with a SQL dump tool.
That doesn't appear to be the case, as I ran the SQL query through several online SQL validators, all of which claimed that the query is valid SQL for Postgres. Now, I am by no means experienced in Postgres, so perhaps there is something I am missing, but as it stands, I don't understand why the query won't work. The tables exist, as can be seen in the 'Browse' tab.
Here's a screenshot:
And here's an example query that doesn't work:
INSERT INTO `Block`(`id`,`moduleId`,`type`,`content`,`link`,`imgPublicId`,`linkLabel`) VALUES
(23,15,0,"Congrats on completing the introduction to custom keyboards! You should now be ranked as a \"Rookie\". See the rest of our paths for more specific journeys!","",NULL,"Click Here"),
(24,14,0,"Custom Keys are one of the main reasons that people choose to make a custom keyboard. See these few links to learn about the main types of custom keys: MX Cherrys, and Chocos","",NULL,"Click Here"),
(25,14,1,"","https://www.cherrymx.de/en",NULL,"Click Here");
I tried taking out the tick marks, as the error suggests, and still no dice. Perhaps there is something special about this SQL client?
Hey @fullnelson14 here's a query that will work for you (AI fixed!):
INSERT INTO Block (id, moduleId, type, content, link, imgPublicId, linkLabel) VALUES
(23, 15, 0, 'Congrats on completing the introduction to custom keyboards! You should now be ranked as a \"Rookie\". See the rest of our paths for more specific journeys!', '', NULL, 'Click Here'),
(24, 14, 0, 'Custom Keys are one of the main reasons that people choose to make a custom keyboard. See these few links to learn about the main types of custom keys: MX Cherrys, and Chocos', '', NULL, 'Click Here'),
(25, 14, 1, '', 'https://www.cherrymx.de/en', NULL, 'Click Here');
Thanks for the direction!
For anyone that may need it: This doesn't actually work still, although its a step in the right direction.
- All of the backtick marks needed to be removed.
- Change all of the double quotes within the data to be single quotes.
- The table name needed to be surrounded in double quotes (in this case "Block").
- Any capital lettering found in a column name meant that that specific column name needed to be surrounded in double quotes (in this case: id, "moduleId", type, content, link, "imgPublicId", "linkLabel").
While I don't know the ins and outs of SQL, it looks like any word with capital letters in it needed to be surrounded by double quotes. I'm not sure if this is a SQL thing, a PostgreSQL thing, a Vercel thing, or a mix of all of them. Anyway, it is finally working to put in data on the web console.
Hey @fullnelson14 thanks for the detailed answer here. For some reason you said This doesn't actually work still but I was able to make it work with the exact query I sent in the issue answer. Example:
https://github.com/user-attachments/assets/8bc1ce19-8425-4f7d-be4c-abe0035f0755
Perhaps something else broke on your side? Thanks 👍