Pasting SQL commands from code editor causes syntax error?
When pasting an SQL command from your code editor to your SQL editor you might run into syntax error even though you’re sure it’s correct. The common reason is that you have some unprintable characters in your code, especially some special whitespace characters.
For example, pasting SQL code with tabs from VSCode, the tabs and spaces might be converted to non-breaking spaces and causes the error:
ERROR: type " " does not exist
TablePlus doesn’t auto sanitize these unprintable characters because we respect the user’s input. The app should run with the code you input and return the error message when there’s an issue. That’s better than automatically sanitizing things under the hood and doesn’t let you know. Then it would appear to run fine on your SQL editor but fail to run on your production application, and that’s sure hard to debug.
To avoid syntax error from the case above, you can use the beautifier feature in TablePlus.
Before using the code copying from an external source, choose to beautify the code and TablePlus will reformat it, remove all those special characters and make your code clean.
New to TablePlus? TablePlus is a modern, native tool with elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.
Sounds good? Download TablePlus for Mac.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS