mysql-net / MySqlConnector

MySQL Connector for .NET
https://mysqlconnector.net
MIT License
1.39k stars 336 forks source link

MySqlBulkCopy Conflict Option "Update" #1476

Closed InvincibleDRT closed 6 months ago

InvincibleDRT commented 6 months ago

Is your feature request related to a problem? Please describe. When a unique key constraint is triggered for duplicate inserts, BulkCopy is changing primary key with "Replace" option

Describe the solution you'd like Another Conflict Option like Update which will keep the primary key same and updates values

bgrainger commented 6 months ago

MySqlBulkCopy is simply implemented with the LOAD DATA statement. It offers REPLACE and IGNORE options: https://dev.mysql.com/doc/refman/8.0/en/load-data.html#load-data-error-handling.