You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add opt-in INSERT IGNORE support for MySQL via insert_mode option
When using on_conflict: :nothing, the MySQL adapter uses the
ON DUPLICATE KEY UPDATE x = x workaround which always reports
1 affected row regardless of actual insert.
This adds insert_mode: :ignore_errors option for insert_all that
uses INSERT IGNORE instead, providing accurate row counts (0 when
ignored, 1 when inserted).
Usage:
Repo.insert_all(Post, posts,
on_conflict: :nothing,
insert_mode: :ignore_errors)
The Connection behavior is updated to accept opts in insert/8,
allowing adapter-specific options to flow through.
0 commit comments