-
Notifications
You must be signed in to change notification settings - Fork 317
Merge | SqlCommand The Mop Up #3738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…lbak, CancelIgnoreFailure
…cachedMetaData, _reconnectionCompletionSource, _intrnalEndExecuteInitiated, CachingQueryMetadataPostponed, IsProviderRetriable, ProcParamsColIndex, PreSql2008ProcParamsNames, Sql2008ProcParamsNames, MetaData
…d renamed synchronous isSynchronous)
…ctionClosed (rewritten as ?.), NotifyDependency (rewritten as ?.)
…ion with Span<string>)
…and GetParameterCount
…g), GetResetOptionsString (made static, renamed to GetOptionsResetString), GetCommandText
… remove boolean "found" flag and just return directly)
…Notification, and netfx-only SqlNotificationContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates SqlCommand platform-specific code by removing separate SqlCommand.netfx.cs and SqlCommand.netcore.cs files and moving shared implementation into the main SqlCommand.cs file. The changes also create a new SqlCommand.Batch.cs partial file for batch-related functionality and update method signatures for consistency.
Key Changes:
- Eliminated platform-specific SqlCommand partial files (netfx and netcore)
- Consolidated shared implementation into main SqlCommand.cs
- Created SqlCommand.Batch.cs for batch RPC operations
- Renamed parameter
synchronoustoisSynchronousin WriteEndExecuteEvent calls
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| SqlCommand.cs | Added consolidated implementation including AsyncState, batch fields, and helper methods previously split across platform files |
| SqlCommand.Batch.cs | New partial containing batch RPC mode methods |
| SqlCommand.Xml.cs | Updated parameter name from synchronous to isSynchronous |
| SqlCommand.Scalar.cs | Updated parameter name from synchronous to isSynchronous |
| SqlCommand.Reader.cs | Updated parameter name and added explicit parameter for GetRPCObject and BuildParamList calls |
| SqlCommand.NonQuery.cs | Updated parameter name from synchronous to isSynchronous |
| SqlCommand.Encryption.cs | Added explicit forSpDescribeParameterEncryption parameter to GetRPCObject call |
| SqlCommand.netfx.cs | File deleted - content moved to shared files |
| SqlCommand.netcore.cs | File deleted - content moved to shared files |
| Microsoft.Data.SqlClient.csproj (both) | Removed references to deleted platform files, added reference to SqlCommand.Batch.cs |
| SqlUtil.cs | Added TODO comment for PendingBeginXXXExists method |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
* fAddSeparation => fAddSeparator * revert order or scale/precision * value => val * FIX BUG numChars GetActualScale => GetActualSize
…e made - will annotate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding annotations for bug fixes
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.netfx.cs
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3738 +/- ##
==========================================
- Coverage 76.78% 76.60% -0.19%
==========================================
Files 273 272 -1
Lines 44914 44189 -725
==========================================
- Hits 34487 33849 -638
+ Misses 10427 10340 -87
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
In the final installment of merging the SqlCommand class, I've mopped up the remaining methods and whatnot into the main SqlCommand partial and a new partial for batch RPC methods (not convinced this is the right idea, but otherwise the main partial becomes way too big, imo). This PR completes the SqlCommand merge (and leaves one class left to merge). As with the other PRs as part of this series, each commit merges a small collection of members. It is recommended to step through the commits one at a time to review.
This PR merges the following members:
Issues
More work towards #1261
Testing
CI should validate 😬