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

JSON POCO support #981

Closed
roji opened this issue Aug 15, 2019 · 2 comments
Closed

JSON POCO support #981

roji opened this issue Aug 15, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@roji
Copy link
Member

@roji roji commented Aug 15, 2019

.NET Core now has a built-in, high-perf JSON API, and Npgsql uses that to read and write arbitrary user POCOs to PostgreSQL json/jsonb columns.

We can build on top of that, allowing EF Core users to have arbitrary POCOs as entity properties, and even to translate LINQ queries which traverse into those POCOs into PostgreSQL search operators.

This does not include:

  • Calling JSON functions and operators which don't match well with a static POCO approach (e.g. check whether a JSON document contains a fragment)
  • Mapping to non-POCO, JSON DOM types (npgsql/npgsql#2572)
  • PostgreSQL 12 JSONPATH support

Documentation and/or a blog post will explain the functionality implemented.

This issue supercedes #334. See also previous discussion in #926.

@roji roji added the enhancement label Aug 15, 2019
@roji roji added this to the 3.0.0 milestone Aug 15, 2019
@roji roji self-assigned this Aug 15, 2019
roji added a commit that referenced this issue Aug 15, 2019
Closes #981
This was referenced Aug 15, 2019
@roji roji closed this in #982 Aug 15, 2019
roji added a commit that referenced this issue Aug 15, 2019
Closes #981
@roji roji changed the title JSON support JSON POCO support Aug 28, 2019
roji added a commit that referenced this issue Aug 29, 2019
Continues #981
roji added a commit that referenced this issue Aug 29, 2019
Continues #981
roji added a commit that referenced this issue Aug 29, 2019
Issue #981 enabled mapping arbitrary user POCOs to PG JON.
This adds support for mapping the System.Text.Json DOM types
JsonDocument and JsonElement, which are more relevant for
unstructured scenarios.. Traversal is implemented as well
as some of the PG JSON operators.

Closes #1002
roji added a commit that referenced this issue Aug 29, 2019
Issue #981 enabled mapping arbitrary user POCOs to PG JON.
This adds support for mapping the System.Text.Json DOM types
JsonDocument and JsonElement, which are more relevant for
unstructured scenarios. Traversal is implemented as well
as some of the PG JSON operators.

Closes #1002
roji added a commit that referenced this issue Aug 30, 2019
Issue #981 enabled mapping arbitrary user POCOs to PG JON.
This adds support for mapping the System.Text.Json DOM types
JsonDocument and JsonElement, which are more relevant for
unstructured scenarios. Traversal is implemented as well
as some of the PG JSON operators.

Closes #1002
roji added a commit that referenced this issue Sep 2, 2019
Issue #981 enabled mapping arbitrary user POCOs to PG JON.
This adds support for mapping the System.Text.Json DOM types
JsonDocument and JsonElement, which are more relevant for
unstructured scenarios. Traversal is implemented as well
as some of the PG JSON operators.

Closes #1002
@weitzhandler

This comment has been minimized.

Copy link

@weitzhandler weitzhandler commented Mar 23, 2020

WOW this is awesome!
Gonna switch to PGS.
It's a bit unclear to me what's possible and what not. What I'm trying to do is have an extensible table that we can add column dynamically via JSON. My question is if those columns will be able to accommodate for full-text search with EF Core. Please see this.

@roji

This comment has been minimized.

Copy link
Member Author

@roji roji commented Mar 26, 2020

@weitzhandler great to see enthusiasm for this feature :)

I personally have never tried to mix JSON and full-text search, but this does seem to be supported by PostgreSQL, at least to some extent. I imagine you'd set up a TsVector over your JSON column(s), and then query against that - I don't think there's anything needed specifically from the EF Core provider on this. Give it a try and please open a new issue if you get blocked on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.