Repository navigation
Re-add missing public APIs in NpgsqlCommand and NpgsqlTransaction - #2608
Conversation
There was a problem hiding this comment.
This change was because the overload was ambiguous between the no-parameter and default-parameter members of the same name.
|
The |
6080cf1 to
62d007e
Compare
|
Done, thanks for the reminder. |
YohDeadfall
left a comment
There was a problem hiding this comment.
Looks good to me, but would you mind to run an utility tool to check public API compatibility at all? Can't remember what I have used previously, but the first thing that I found now is BitDiffer. Otherwise, I'll do it, but a bit later.
|
I used SynVer.Lib and the following F# script to diff the surface area of the two dlls: #I "/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.0.0-preview9-19423-09"
#r "netstandard"
#r "/Users/chethusk/.nuget/packages/synver.lib/0.0.8/lib/netstandard2.0/SynVer.Lib.dll"
open System.Reflection
open SynVer
let previewPath = "/Users/chethusk/.nuget/packages/npgsql/4.1.0-preview2/lib/netcoreapp3.0/Npgsql.dll"
let oldPath = "/Users/chethusk/.nuget/packages/npgsql/4.0.9/lib/netstandard2.0/Npgsql.dll"
let preview = Assembly.LoadFile previewPath |> SurfaceArea.ofAssembly
let old = Assembly.LoadFile oldPath |> SurfaceArea.ofAssembly
let diffs = SurfaceArea.diff old preview
System.IO.File.WriteAllLines("/Users/chethusk/oss/foobar/diff.txt", diffs)The full report is attached, I haven't gone over it 100% yet. |
|
From that report, the list of missing or changed members:
|
|
No problem for bringing back parameter-less ExecuteReader, but NpgsqlTransaction.IsCompleted is a bit complicated... this was done as part of #2416, where we started recycling the NpgsqlTransaction instance. The logic of removing/hiding IsCompleted was that since the transaction instance will be revived, IsCompleted will switch from true to false, leading to potential confusion/dangerous behavior. Therefore, it is up to the user to track whether a transaction is in progress or not (which is the way ADO.NET works - IsCompleted has always been an Npgsql extension). I'll have to investigate this a bit. Currently it is not required to actually dispose an NpgsqlTransaction before starting a new transaction - the only thing that matters is whether the transaction has completed on the PostgreSQL side. I'm not sure that's the desirable behavior. Depending on that, it may still make sense to have a public IsCompleted, with a contract that once the instance has been disposed, all bets are off. Give me a couple days to look at this. |
62d007e to
0a646da
Compare
|
Done, and I reworked the name of the commit to reflect the smaller scope |
|
Thanks @baronfel! |
|
Should I log an issue with the remaining changed members to be reverted in the release/4.1 branch? I know that the TypeHandling changes have been somewhat changed, I'm speaking specifically of |
|
@baronfel yes please! It makes sense to add back the no-cancellation-token overloads, but it looks like we may keep most of the other changes listed. BTW which tool are you using to detect these changes? |
|
I'm using SynVer (per #2608 (comment)) and a short script. There's also a standalone windows executable for it, and I'm working on a PR for the tool to allow for usage as a dotnet SDK global tool, so you could do |
Fixes #2607 by adding the two APIs that were altered there. Prospectively opening this MR to get checks started.