-
Notifications
You must be signed in to change notification settings - Fork 962
question: support for data extraction and search for a struct/JSON column #266
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
Comments
The "JSON type predicates support" is part of our roadmap (see #46). We didn't come up with the design yet, and I'll be happy to start the discussion/design about it here. However, we plan to finish eager-loading and hooks before start working on this.
I thought about generating predicates based on the concrete type (if it's known at compile time).
I don't have the answer for this. It's open for discussion. |
I propose to support |
I also encountered the problem of querying json field content when writing crud code. I am very concerned about whether this discussion has a clear answer. Considering that this is already an issue in 2020, is there a more elegant solution that can implement functions like |
It's a great experimental ent feature to be able to store structs as Json in a database table. I have a few questions regarding this feature:
In the meantime, I believe that ent should have the primitives to allow ent users to write those queries even without out-of-the-box support.
Examples for JSON queries:
If I read the documentation right, the way to implement search would be a custom predicate.
I am not sure how a custom select statement with only specific fields can be generated. Is the way to go a custom select
Select(t1.Columns("name", "age")...)
statement? I think the challenge will be to find a good syntax for JSON extraction (specifically for nested fields) and its unclear to me how the mapping to entities should look like.The text was updated successfully, but these errors were encountered: