antares-sql / antares

A modern, fast and productivity driven SQL client with a focus in UX
https://antares-sql.app
MIT License
1.86k stars 128 forks source link

JSONB content wrongly escaped, leads to DB error on PostgreSQL #850

Closed f-jacobi closed 2 months ago

f-jacobi commented 2 months ago

Describe the bug When pasting a JSON string in a table field of type JSONB on a PostgreSQL DMBS, Antares adds additional escape characters that result in an invalid input syntax for type json error.

To Reproduce Steps to reproduce the behavior:

  1. Have PostgreSQL table with a field of type JSONB, and at least one row/dataset.
  2. Edit this table with Antares GUI.
  3. Paste the following string in a JSONB field: [{"foo":"bar"}]. Note that it does not matter if you use " or ' for embedded strings.
  4. See how Antares replaces " with \" in the console: UPDATE "public"."project" SET "goals" = '[{\"foo\":\"bar\"}]' WHERE "id" = 3
  5. See the error message invalid input syntax for type json.

Expected behavior The edited field contains the content [{"foo":"bar"}]

Screenshots

image

Application (please complete the following information):

Environment (please complete the following information):

OS is based on Ubuntu 22.04, KDE plasma 5.27.10

Additional context n/a

Fabio286 commented 2 months ago

Hi @f-jacobi, The fix is currently on beta and should be available in next stable release.