-
Notifications
You must be signed in to change notification settings - Fork 540
Problem compiling upsert statement #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Happy to make a PR but I'm unsure if the cause is the grouping of the statements or the priority pinning of the trailing (column = expr) pairs. I wasn't able to reproduce with tests in sql-psi alone. It seems to be something about the way the grammar/parser is constructed within SQLDelight. |
are you able to create a failing test in the |
I'll give it a go. Thanks for the hint 😄 ! |
To help with diagnosis of issue sqldelight#2791.
To help with diagnosis of issue sqldelight#2791.
To help with diagnosis of issue #2791.
To help with diagnosis of issue #2791.
* Added failing tests for Postgres INSERT DO UPDATE To help with diagnosis of issue #2791. * Added passing test for Postgres INSERT DO UPDATE To help with diagnosis of issue #2791. * Fix the bug Co-authored-by: andrew <[email protected]>
SQLDelight Version
1.5.3
Operating System
macOS Big Sur 11.6.2
Gradle Version
7.3.1
Kotlin Version
1.6.0
AGP Version
No response
Describe the Bug
I'm trying to implement the upsert query using postgres. Here's a simple example (I also tried using a grouped statement, but in postgres this operation can be done in one statement):
However, compilation fails unless exactly two fields are updated in the query. The stacktrace shows the error I get trying to update all three fields in the table. I get the same error when only the id is updated in the query. When the query contains two fields, it compiles and works as expected.
Stacktrace
Gradle Build Script
No response
The text was updated successfully, but these errors were encountered: