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

refactor(repository): use native SQL for history #558

Merged

Conversation

vkrizan
Copy link
Contributor

@vkrizan vkrizan commented Jul 17, 2023

Refactors PoliciesHistoryRepository to use native SQL to support Postgresql-specific queries (like JSON lookups).

RHINENG-1191

@gwenneg
Copy link
Member

gwenneg commented Jul 17, 2023

Quarkus 3 comes with Hibernate ORM 6 which supports the JSONB type. That may be something to consider instead of transforming the queries to native SQL.

@vkrizan
Copy link
Contributor Author

vkrizan commented Jul 17, 2023

@gwenneg does Hibernate 6 support JSONB lookups in HQL? What I've found is that there is no support for it in HQL. It complains about @> operator in HQL ver. 5.

Upgrading to Quarkus 3 might be a heavier lift than changing to native SQL, which most of our team "speak".

@gwenneg
Copy link
Member

gwenneg commented Jul 17, 2023

I haven't tried Hibernate 6 yet but it should support JSONB in HQL AFAIK.

Regarding Quarkus 3, that bump will be mandatory sooner or later anyway because Quarkus 2 won't be supported/maintained forever 😃

@vkrizan
Copy link
Contributor Author

vkrizan commented Jul 18, 2023

@gwenneg Per discussion, this would be a much heavier lift at the moment. Would you have time to review this refactoring. Thank you!

Refactors PoliciesHistoryRepository to use native SQL to support
Postgresql-specific queries (like JSON lookups).

RHINENG-1191
Copy link
Member

@josejulio josejulio left a comment

Choose a reason for hiding this comment

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

lgtm

@vkrizan vkrizan merged commit 683774d into RedHatInsights:master Jul 19, 2023
3 checks passed
@vkrizan vkrizan deleted the refactor-history-repository-1191 branch July 19, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants