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

feat: basic json column support #1007

Merged
merged 7 commits into from
Oct 24, 2024
Merged

Conversation

orecus
Copy link
Contributor

@orecus orecus commented Oct 21, 2024

This is a basic implementation, seems to work as expected for the base case. This could solve #359.

But ideally these two things should be sorted before merging, but opening it for early feedback by @ppetzold , i'm not quite sure yet of the best approach to solve these two, so very much open for pointers or assistance.

  • The logic seems to break if you use relation.jsonField.data for instance, from my limited understanding we probably need to add an check somewhere as it seems to think jsonField is a related entity, which when using json it is not.
    "missing FROM-clause entry for table \"__root_relation_rel_jsonField_rel\""
  • Some more operators than $eq, from reading the implementation PR this seems like a limitation in TypeOrm, if I am understanding things correctly.

Copy link
Owner

@ppetzold ppetzold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are keen to get this released, I am okay with merging this way of basic jsonb support.

just add a jsonb README section and highlight that relations and other operators (other than FilterOperator.EQ) are not yet supported.

@orecus
Copy link
Contributor Author

orecus commented Oct 22, 2024

I was just about to push this when you wrote. :) I've added a test that shows the error for relationships, I would like to have this fixed before releasing it, but I've updated the ReadMe as per your note.

I'm not quite sure where to look for a solution to this, perhaps somewhere in fixColumnAlias() but I'm not sure.

@orecus orecus requested a review from ppetzold October 22, 2024 12:16
@ppetzold
Copy link
Owner

I was just about to push this when you wrote. :) I've added a test that shows the error for relationships, I would like to have this fixed before releasing it, but I've updated the ReadMe as per your note.

I'm not quite sure where to look for a solution to this, perhaps somewhere in fixColumnAlias() but I'm not sure.

Good stuff.. umm, the case handling should be similar to the one for embedded entities. try check all occurrences of checkIsEmbedded

@orecus
Copy link
Contributor Author

orecus commented Oct 23, 2024

This issue mentioned above is now fixed, the issue was actually that the isJson check returned false so the json logic was never used for the failing test, I fixed it by passing the full column into the check and all tests now go trough.

@ppetzold
Copy link
Owner

This issue mentioned above is now fixed, the issue was actually that the isJson check returned false so the json logic was never used for the failing test, I fixed it by passing the full column into the check and all tests now go trough.

good stuff, if you think this PR is ready to go ... please mark as ready for review.

@orecus orecus marked this pull request as ready for review October 24, 2024 09:44
@ppetzold ppetzold merged commit 858be33 into ppetzold:master Oct 24, 2024
3 checks passed
@ppetzold
Copy link
Owner

🎉 This PR is included in version 9.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants