-
Notifications
You must be signed in to change notification settings - Fork 293
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
API Proposal: SqlJson class design to support JSON datatype #2665
Comments
Assume this will be .NET 8+ only, or?? |
We will support netfx and all the runtime versions. |
Just pointing out that SqlDbType.Json isn't necessary for making read work, and and should also not be necessary for making write work with JsonDocument. Even for writing strings as JSON, there's the possibility of the user hardcodIng the numeric enum value - this is ugly and hacky, but it would allow people to use JSON without forcing them to upgrade to .net 9. So I'm just wondering if the plan is to only enable JSON support for 9. |
@roji Reply was edited 🥳 |
The namespace should be |
@David-Engel what is the guidance about the docs for public APIs? |
@saurabh500 I have been working on converting the docs to a more modern style to address issue #2013. However, this is a big job, and it will take some more time for me to complete as I am doing it alongside my scheduled tasks. When it is done, I need to request a sample published test from the documentation team to ensure everything works as expected, so that will take some time. So far, I have noticed a few issues with the documentation contents inside the CDATA block, which have not been marked by the compiler as it reads them as a text block. So, I think for now we need to continue the old style as the job needs to be done in a separate PR, but I will wait for @David-Engel 's comment on this. |
Thanks @JRahnama for the inputs. |
To add more on this, I have found out below:
|
We should have a stream constructor so that people don't have to go through string to load data. |
@Wraith2 For the SqlTypes i.e. This is because these types need to validate the datatype before sending it out to the server. For JSON, the stream will need to be parsed till the end to validate if the JSON is valid, and will diminish the value of stream on SqlJson However streaming is needed with Also this will be interesting when we use |
Background:
As part of enhancing support in SqlClient for JSON datatype for Sql Server as mentioned in #2622, SqlDbType needed to be enhanced with enum called
Json
and introduction of aSqlType
class for JSON type was needed.An enum called
Json
with value35
inSqlDbType
was recently added in the runtime repo through issue #103925The next follow up item is to provide a
SqlType
class to work with the JSON data. This proposal talks about the design ofSqlJson
class which aims to represent the JSON data stored in or retrieved from a server.API Proposal
Additionally, SqlDataReader will be enhanced with addition of API for returning
SqlJson
typeThe text was updated successfully, but these errors were encountered: