Regarding the handling of bulk_create when encountering a unique constraint #1437
WaldenWong
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I would like to ask
ormarhow to update the record instead of throwing an error when encountering a violation of the unique constraint when usingbulk_create().Or when encountering a violation of the unique constraint, skip the record instead of updating, what method should be used.
Alternatively, what method of
ormarcan be used to run SQLalchemy native statements, such asinsert (users). values (name='Alice '). onnConflict.do_nothing()to achieve the above situation.Thank you to the experts for answering your questions!
Beta Was this translation helpful? Give feedback.
All reactions