-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(dbal): insert ignore conflict method for MySQL and SQLite #45655
Conversation
Actually, there is a different behaviour with PostgreSQL…
I see two solutions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On conflict this ones updates the row while pgsql implementation will not touch it, no?
Yep, see above comment :) |
Can this be an option? |
For me it ignores too many errors. I would prefer to avoid this. |
5894248
to
115abb5
Compare
bc95813
to
330d35b
Compare
Finally, it seems From MySQL documentation
The other way is to update all fields instead of ignore them but I failed to achieve this with Oracle. It's sad because it could make sense when we launch an update after the |
@nickvergessen Do you think it is a correct solution given the risks of ignoring other errors? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A unit test would be nice
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
330d35b
to
b724368
Compare
Summary
Add ignore conflicts method for MySQL
Similar to PgSQL: https://github.com/nextcloud/server/blob/master/lib/private/DB/AdapterPgSql.php#L26-L37
Checklist