- Notifications
You must be signed in to change notification settings - Fork102
Closed
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched theDocs, GitHubDiscussions, andDiscord.
Describe the bug
ON CONFLICT .. DO UPDATE
queries are improperly flagged as invalid syntax, and the LSP Is interpreting it as 2 separate statements (2nd starting with "UPDATE"). Putting the same syntax inside a CTE is considered valid by the LSP.
To Reproduce
write this query and observe the squiggles; it's interpreting it as two separate statements, first one ending onDO
(inclusive)
INSERT INTOfoo.bar ( pk)VALUES ( $1)ON CONFLICT (pk) DOUPDATESET date_deleted= DEFAULT, date_created= DEFAULT;
Now put this same thing inside a CTE and observe that the LSP does not complain
WITH asdfAS (INSERT INTOfoo.bar ( pk )VALUES ( $1 )ON CONFLICT (pk) DOUPDATESET date_deleted= DEFAULT, date_created= DEFAULT)SELECT1;
Expected behavior
Recognize valid syntax when usingON CONFLICT .. DO UPDATE
in any context
System information
- OS: macos
Additional context
- IDE: vscode w/ postgrestools extension
- used default/suggested configwith the db section removed so that it's all LSP / not using db connection
Add any other context about the problem here.