Dapper
Dapper copied to clipboard
Support for DbBatch
Some providers don't support pipelining multiple concurrent requests on the same connection but do support sending multiple commands using the new System.Data.Common.DbBatch. I have in mind npgsql (see documentation).
It would be nice to utilize this for the Dapper overloads that accept IEnumerable command parameters (e.g. Execute(...) and ExecuteAsync(...)) to cut down the round trip time. As a bonus, expose some way in the API of grouping commands/parameters to be sent in the same batch. Something like CommandDefinition but with a collection of command text/parameter definitions perhaps?