Mark
02/23/2025, 5:43 AMUPDATE
that returns the original values being replaced. It seems RETURNING
is the way to go but sqldelight won’t allow the WITH
table columns to be referenced like this. Is this a limitation of sqldelight or have I got the syntax wrong?
WITH old_values AS (
SELECT id, date FROM history
WHERE date NOT GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
)
UPDATE history
SET date = '1970-01-01'
WHERE id IN (SELECT id FROM old_values)
RETURNING old_values.date; // compilation error