Merge | Port SqlBatch support to netfx #3926
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is perhaps only tangentially related to merging the netfx and netcore projects, but it merges functionality.
The SQL client driver has had support for server-side batching of SQL statements for a long time, starting with SqlCommandSet. The introduction of the DbBatch abstraction in netcore provided an opportunity to expose this using SqlBatch types in #1825 and #2223.
Although the goal in the original PR was to expose these APIs to both netcore and netfx, at this stage we were still building all of SqlClient using netstandard2.0. This generated various build issues, so the types weren't included.
Since we're now only building the ref assemblies using netstandard2.0, we can port (most of) the SqlBatch surface area to netfx. This harmonises more of the API surface between targets. It also means that in the future, we'll be able to remove the internal SqlCommandSet type, since this duplicates the SqlBatch functionality.
There are now five APIs which were already present present in netcore, but which I haven't ported to netfx. This is because they have a return type of DbBatch* types. Changing them to expose SqlBatch* types will be a breaking change on netcore, and if the method has a different return type in netcore to netfx/netstandard2.0, client applications referencing intermediary netstandard2.0-based libraries won't be able to bind to the method. I don't think this is a problem - the APIs aren't necessary to use SqlBatch functionality.
These APIs are:
Issues
None.
Testing
I've enabled the batching tests on both netcore and netfx. Both pass.