Convert Double Quotes

TablePlus Plugin by

Tags:

,

The Convert Double Quotes plugin for TablePlus does a very simple thing – it converts all instances of a double quote in your SQL query to a single quote.

TablePlus Plugin - Convert Double Quotes

So, this query:

SELECT *
FROM table_name
WHERE table_name.some_key = "test";Code language: SQL (Structured Query Language) (sql)

will be converted to this:

SELECT *
FROM table_name
WHERE table_name.some_key = 'test';Code language: SQL (Structured Query Language) (sql)

Please beware, the plugin does NOT check where exactly those double quotes are used, so if you have them inside your values you are querying for – they will also be replaced. And that potentially can break your SQL query.

For example, a valid SQL query like this:

SELECT *
FROM table_name
WHERE table_name.some_value = 'te"s"t';Code language: SQL (Structured Query Language) (sql)

will become broken after applying the plugin conversion:

SELECT *
FROM table_name
WHERE table_name.some_key = 'te's't';Code language: SQL (Structured Query Language) (sql)

How to install the Convert Double Quotes plugin

Unfortunately, the plugin author does not provide a ready-made plugin file that you can download and install by simply running it, so you will need to first build it.

  1. Open the repository and clone it locally (or download the whole zip)
  2. Inside the repo directory locally run the npm ci command
  3. After that, run the npm run build command,
  4. This will generate a file needed for the plugin to work
  5. Now your ConvertDoubleQuotes.tableplusplugin plugin (which in UI of your operating system will be marked with a TablePlus logo as being recognized as a plugin) is ready to be installed – double-click the plugin.
  6. TablePlus will ask you to allow the plugin installation.

How to use the plugin

  1. Open/write/generate the SQL query and put it into the SQL Editor (CMD+E).
  2. Go to the TablePlus top-level Plugins menu, and click the “Convert Double Quotes” menu item
  3. Or press the Control + D shortcut while inside the SQL Editor.
  4. The query will be instantly updated inside the SQL Editor.

TablePlus Build (min)

200

Category

Leave a Reply

Your email address will not be published. Required fields are marked *