JOIN ... ON conditions inside UPDATE ... FROM and DELETE ... USING are not validated in strict mode:
StrictRow<DB, 'update users set name = $1 from orders o join refunds r on r.nope = o.id where users.id = o.user_id'>
// Record<string, never> - r.nope accepted silently
Same with delete from users using orders o join refunds r on r.nope = o.id .... The joined sources themselves are registered (returning r.id works in the valid variant), it is only the ON expressions that go unchecked. The README says strict mode checks JOIN ... ON conditions and makes no carve-out for write statements.
Root cause: the UPDATE and DELETE branches hardcode fromText: '' (src/parse.ts:324 and 334), so ApplyWhereCheck's ExtractJoinOnText (src/parse.ts:922-938) never sees their join text. Passing the real FROM/USING clause text through instead of the empty string should close it.
JOIN ... ON conditions inside
UPDATE ... FROMandDELETE ... USINGare not validated in strict mode:Same with
delete from users using orders o join refunds r on r.nope = o.id .... The joined sources themselves are registered (returningr.idworks in the valid variant), it is only the ON expressions that go unchecked. The README says strict mode checks JOIN ... ON conditions and makes no carve-out for write statements.Root cause: the UPDATE and DELETE branches hardcode
fromText: ''(src/parse.ts:324 and 334), soApplyWhereCheck'sExtractJoinOnText(src/parse.ts:922-938) never sees their join text. Passing the real FROM/USING clause text through instead of the empty string should close it.