-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
On conflict do nothing for MySQL #1790
Comments
darkmmon
added a commit
to darkmmon/sea-orm
that referenced
this issue
Aug 18, 2023
tyt2y3
pushed a commit
that referenced
this issue
Aug 18, 2023
* adds find_with_linked test * WIP(related test) * mock related test done * complete relation test * loader update * find_with/also_related missing test case for empty from other side * comments fixup * revert loader test * related select test done * find with/also linked test cases * removed due to it being functionally same as the new one * fmt, remove excess import * improved model generation * issue related test case #1790 * added loader test cases and slight improvement to find_related/linked * miscellaneous changes * added empty insert, merge load_one test case * completed loader many to many test case, fmt * removed empty_insert test case for now * commented insert_test * added Cargo.toml for issue 1790's folder * buffed salvo version for ci(0.49 yanked) * revert version for salvo example
I don't think Since SeaORM do know the PK of the entities, we are looking for ways to make it transparent. |
4 tasks
tyt2y3
changed the title
On conflict do nothing for MySQL
Sep 8, 2023
OnConflict::do_nothing()
is broken under MySQL
3 tasks
Now it's released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
OnConflict::do_nothing()
generates a syntactically incorrect query for MySQL/MariaDB:returns something like:
which is not correct in MySQL/MariaDB. The correct syntax would be:
(cf. https://dev.mysql.com/doc/refman/8.1/en/insert.html and https://mariadb.com/kb/en/insert/)
Workarounds
Update the unique key on conflict:
Versions
0.12.1
The text was updated successfully, but these errors were encountered: