Skip to content
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

Block new EF JSON support #2452

Closed
roji opened this issue Jul 27, 2022 · 11 comments · Fixed by #2532
Closed

Block new EF JSON support #2452

roji opened this issue Jul 27, 2022 · 11 comments · Fixed by #2532
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@roji
Copy link
Member

roji commented Jul 27, 2022

EF 7.0 is introducing JSON support (dotnet/efcore#4021), but the Npgsql provider has had its own support for a long time. While the EF support is based on owned entities (and will therefore unlock partial updates in the future), the Npgsql support is based on simple type mapping instead.

The EF 7.0 feature won't support everything that Npgsql currently supports (e.g. weakly-typed mapping via JsonDocument). As a result, we won't be porting the Npgsql support to use the standard 7.0 feature - that will likely happen for 8.0. In the meantime, we should block the EF JSON support in model validation.

@vigouredelaruse
Copy link

apologies for the google fail but i'm trying to locate a 'convergence' roadmap for this efcore provider that identifies whether or not efcore ToJson() support will cause the deprecation of weak typing with JsonDocument

the concern is whether or not this provider will graduate to the lowest common json implementation denominator or not

please advise

@roji
Copy link
Member Author

roji commented Dec 16, 2022

@vigouredelaruse things aren't completely clear yet, but I don't intend to deprecate/de-support any major use-cases currently supported by this provider. Adding weakly-typed JsonDocument support is also on the roadmap for EF 8.0, but even if it isn't done, we'll likely add the new EF 7.0 strongly-typed ToJson() support alongside it.

@vigouredelaruse
Copy link

without treating this as a product announcement or anything i'm hearing

  • that the base efcore is trending towards exposing 'document' store capability via JsonDocument
  • that the provider under discussion here will merge with or supplement any base efcore support for weak typing
    thanks

@SavoInfostream
Copy link

So, no support for EF 7 JSON columns until .NET 8? A full year after the release...

@roji
Copy link
Member Author

roji commented Feb 13, 2023

@SavoInfostream The PG provider has its own support for JSON (and has had it for years) - what exactly are you trying to do that's not working for you?

@SavoInfostream
Copy link

I was thinking about trying out PostgreSQL for something new but I don't want to complicate things with the alternative syntax.

@roji
Copy link
Member Author

roji commented Feb 15, 2023

Which alternative syntax are you referring to?

@SavoInfostream
Copy link

SavoInfostream commented Feb 15, 2023

Well, my mistake, I assumed there was something different between the pre-EF7 json support and the one planned for EF8.

@Bram1903
Copy link

Hello, since the .NET8 previews are starting to roll out I was wondering if EF JSON is still on the roadmap, and if so, when can we expect a first preview including EF JSON support?

@roji
Copy link
Member Author

roji commented Apr 24, 2023

I definitely hope to get around to for 8.0, but I can't say for sure which preview it will land on. In the meantime note that the PG provider already supports JSON (in a different way) and has done so for a very long time.

@Bram1903
Copy link

Thank you for your quick response! I know the provider already has support for JSON, but I am asking for the new EF JSON version because of compatibility. Some public projects are making use of the new EF JSON method, and since I'm building on top of one of these projects, I don't have the option to use your provider (PG) since it obviously works slightly differently. Of course, I much prefer to use PostgreSQL, then something like MSQL ;-) Adding support for EF JSON would be really great! Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants