sqlpage / SQLPage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.57k stars 89 forks source link

[Postgres] Multi-column update seems not supported #500

Closed anayrat closed 2 months ago

anayrat commented 2 months ago

Introduction

Postgres supports multi-column update:

https://www.postgresql.org/docs/current/sql-update.html

Use the alternative column-list syntax to do the same update: UPDATE weather SET (temp_lo, temp_hi, prcp) = (temp_lo+1, temp_lo+15, DEFAULT) WHERE city = 'San Francisco' AND date = '2003-07-03';

To Reproduce

UPDATE toto SET (c1,c2) =(42,42);

Is wrongly translated by :

UPDATE toto SET c1.c2 = (42, 42);

Version information

anayrat commented 2 months ago

It is even worse, even a simple UPDATE do not work:

UPDATE toto SET set c1 = 42;

Results in:

Failed to execute SQL statement:
UPDATE toto SET set.c1 = 42;
                 ⬆️
line 1, character 17
anayrat commented 2 months ago

Oh, it seems duplicate of https://github.com/lovasoa/SQLpage/issues/403

lovasoa commented 2 months ago

Yes! You can try the latest builds for the yet unreleased v0.25 (on docker hub for instance), and everything should be working fine.