Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merge Query joins WhenNodes with comma which causes a syntax error #939

Closed
gittgott opened this issue Apr 6, 2024 · 0 comments · Fixed by #940
Closed

Merge Query joins WhenNodes with comma which causes a syntax error #939

gittgott opened this issue Apr 6, 2024 · 0 comments · Fixed by #940

Comments

@gittgott
Copy link
Contributor

gittgott commented Apr 6, 2024

When you have multiple whens within a merge query, the WhenNodes are joined with a comma. A minimal example of this can be seen in the following kysely playground: https://kyse.link/A9Ndr

The affected lines are as follows (with the comma after @1):

UPDATE SET
  "first_name" = @1,
WHEN NOT MATCHED THEN

I know that this causes a syntax error within mssql, but am not as sure about the other dialects that kysely includes.

I'll make a draft PR shortly in attempt to fix this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant