-
Notifications
You must be signed in to change notification settings - Fork 294
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
SqlDataReader.GetFieldValue{,Async}() should work for Stream and TextReader #27
Comments
/cc @Wraith2 @divega @ajcvickers @saurabh500 @bricelam @bgrainger @saurabh500 do you see any issue/objection with this? |
@bgrainger has pointed out in one of the linked issues elsewhere that there is some slightly unexpected (but deliberate) behaviour when using the current sync stream methods, Should I think it is up to the developer to ensure that their queries return sensible data and that if null can be present in the return from a query it should be explicitly handled by the consumer and not hidden by the ADO library. I'm in favour of throwing an exception if a stream over null data is requested through |
As recently announced in the .NET Blog, focus on new SqlClient features an improvements is moving to the new Microsoft.Data.SqlClient package. For this reason, we are moving this issue to the new repo at https://github.com/dotnet/SqlClient. We will still use https://github.com/dotnet/corefx to track issues on other providers like System.Data.Odbc and System.Data.OleDB, and general ADO.NET and .NET data access issues. |
@roji i've got this working on netcore but because of the different netcore and netfx codebases it's more difficult to get it working on netfx. Since this would primarily be useful from EF and as far as a know modern EF only works on core or net5 onwards is there a need to implement on netfx immediately? It will eventually be implemented through the merging of the codebases. |
(sorry for the slow response, back from vacation) I don't see any particular problem with deferring this for netfx (apart from the general undesirability of having a behavior discrepancy between the versions of the driver); this just adds a new capability which didn't exist before, and it's unlikely anyone's going to be porting new code using it from netcore to netfx... |
Looking at how it's all structured a related question occurred to me. What should happen for |
Yeah, |
streams strings and any other reference type such as UDT's wouldn't work out at all. As you say. |
Following #30958, where @Wraith2 added the ability to retrieve an XmlReader via
SqlDataReader.GetFieldValue()
and its async counterpart, we should do the same for Stream and TextReader. These can already be retrieved viaGetStream()
andGetTextReader()
respectively.The main motivation behind this would be to allow getting Reader/TextReader asynchronously without introducing new
GetReaderAsync()
andGetTextReaderAsync()
methods. See https://github.com/dotnet/corefx/issues/35012#issuecomment-484440830 and below for previous discussion.The text was updated successfully, but these errors were encountered: