go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.52k stars 118 forks source link

VALUES clause support #233

Open v-byte-cpu opened 1 year ago

v-byte-cpu commented 1 year ago

Is your feature request related to a problem? Please describe.

Hi there! It looks like Jet doesn't support VALUES clause. My personal use case is batch update statements, for instance

UPDATE public.some_table
SET name = (d.v)::text
FROM (
         VALUES (1, 'name1'), (2, 'name2')
     ) AS d(id, v)
WHERE some_table.id = (d.id)::bigint;

or

WITH d(id, v) AS (VALUES (1, 'name1'), (2, 'name2'))
UPDATE public.some_table
SET name = (d.v)::text
FROM d where some_table.id = (d.id)::bigint;

Describe the solution you'd like

Public API support for VALUES clause.

go-jet commented 1 year ago

Hi @v-byte-cpu. VALUES is not supported currently. You can use this workaround for now.