neosync icon indicating copy to clipboard operation
neosync copied to clipboard

[NEOS-1396] Add support for double quotes in schema and tables for Postgres

Open nickzelei opened this issue 5 months ago • 0 comments

We have support for special characters, however, this breaks down when building many of our queries because double quotes need to be escaped properly, which is done by adding an extra double quote.

CREATE TABLE "user""s_data@" (id TEXT NOT NULL PRIMARY key);

This creates a table called user"s_data@

Goqu only knows how to wrap tables in the correct delimiter (for Postgres, it is a double quote), but in order for the statement to be valid, we have to add in an extra " wherever we find one.

This change will have to be made anywhere that we are using Goqu.

Well known places:

  • sqlmanager_postgres
  • querybuilder2

Keep an eye out for:

Add support for escaping double quotes in Postgres Identifiers · Issue #428 · doug-martin/goqu

From SyncLinear.com | NEOS-1396

nickzelei avatar Sep 03 '24 21:09 nickzelei