efcore.pg icon indicating copy to clipboard operation
efcore.pg copied to clipboard

Block new EF JSON support

Open roji opened this issue 4 years ago • 11 comments

EF 7.0 is introducing JSON support (https://github.com/dotnet/efcore/issues/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.

roji avatar Jul 27 '22 20:07 roji

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

vigouredelaruse avatar Dec 16 '22 19:12 vigouredelaruse

@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.

roji avatar Dec 16 '22 23:12 roji

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

vigouredelaruse avatar Dec 17 '22 18:12 vigouredelaruse

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

ghost avatar Feb 04 '23 13:02 ghost

@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?

roji avatar Feb 13 '23 10:02 roji

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

ghost avatar Feb 13 '23 11:02 ghost

Which alternative syntax are you referring to?

roji avatar Feb 15 '23 09:02 roji

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

ghost avatar Feb 15 '23 18:02 ghost

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?

Bram1903 avatar Apr 24 '23 14:04 Bram1903

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.

roji avatar Apr 24 '23 14:04 roji

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!

Bram1903 avatar Apr 24 '23 14:04 Bram1903