Promote SQL Server bulk insert logic to relational ReaderModificationCommandBatch
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
SqlServerModificationCommandBatch has a bulk insert logic, where multiple insertions are coalesced into a single, efficient MERGE statement. We should promote the infrastructure for coalescing multiple modification commands into a single SQL statement to relational:
* It would allow other providers to more easily implement bulk insert etc.
* It's currently a bit tricky to implement the logic only in SqlServerModificationCommandBatch, without ReaderModificationCommandBatch knowing anything about it (e.g. [this](https://github.com/dotnet/efcore/issues/29539#issuecomment-1325572271)). Adding the proper hooks in ReaderModificationCommandBatch would simplify this.
* We should make this support non-insertion as well (e.g. #27550).
Contributor guide
Assessment
This issue has not been assessed yet.