-
Notifications
You must be signed in to change notification settings - Fork 346
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
Question; [PostgreSQL] on_conflict with more than one column #586
Comments
Thanks for the report. That should be fixed. @matthijs might know better, but looking at the code it seems that it would be relatively easy to allow more than one column? I am currently a bit pre-occupied with other work. Do you want to give it a try (at least as a local workaround)? Storing zero or more columns in a tuple and then use interpret_tuple for serialization? Alternatively, you could also hack a pseudo-column that serializes as the two columns you need (that sounds more ugly than I thought it would before writing it down :-) ). Note that sqlpp11 does not know about constraints as of today. Choosing the correct columns is on you. |
I'll take a look next week. |
Wouldn't it make sense to tackle this problem after the support for |
I have a table like this in PostgreSQL:
In SQL I can run the following query to insert or update the value:
It appears that the
on_conlict
only supports one columns, is this correct?If so, any suggestions on how to work around this limitation?
Related: A random related SO answer also mentions this:
The hypothetical code to support this would be something like:
The runtime error I get when I only add one column is:
And I get a compile time error when I supply no columns:
Would it be possible to inject a string into the
on_conflict()
perhaps?The text was updated successfully, but these errors were encountered: