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
MySQL Upsert on_duplicate_key_update #4483
Comments
here are the 1.2 docs: the single dictionary form is new in 1.3 |
Hi, thanks for the quick answer. Should I describe every column that I want to update? The think is, my dict varies according to the parameters that are passed, so not all the columns go to the dict. |
are you looking for Python star syntax?
|
Hi zzzeek, not quite sure what you mean? |
I'm trying to answer your question "how can I handle this dynamically?" the usage you have attempted at the top of this question needs only the modification of using **kwargs syntax. can you please just try this and let me know it solves your problem, thanks. |
Hi, ok, now I understood, thanks. Closing this topic. Bruno |
Hi,
I'm trying to upsert a table that has a column named "id" (primary key) and a column named "name" (unique key).
The var "value" is a dict, and the following code gives me:
TypeError: on_duplicate_key_update() takes exactly 1 argument (2 given)
What am I doing wrong?
Thanks,
Bruno
The text was updated successfully, but these errors were encountered: