marten icon indicating copy to clipboard operation
marten copied to clipboard

Use `insert .. on conflict` for bulk import operations

Open elexisvenator opened this issue 7 months ago • 3 comments

Updates the behaviour of BulkInsertMode.OverwriteExisting to use insert ... on conflict do update. This is one less db statement than before and a less prone to constraint issues. Also updates the behaviour of BulkInsertMode.IgnoreDuplicates to use insert ... on conflict do nothing.

(Wasn't going to create this so soon but ran into an issue where spamming some seed data resulted in unique constraint violations when using OverwriteExisting)

Tests pass but I had to delete the checked in generated code files. I am not sure what the correct way to regenerate these files is - can this be added to the doco somewhere so I can fix the issue myself next time 🙇 .

elexisvenator avatar Jul 09 '24 12:07 elexisvenator