-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Dedicated Dev UI interface to execute HQL (Hibernate ORM) queries #46728
Conversation
/cc @gsmet (hibernate-orm) |
This comment has been minimized.
This comment has been minimized.
🎊 PR Preview 13ccd68 has been successfully built and deployed to https://quarkus-pr-main-46728-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
I like the input at the top. I think we should change the JDBC one to work/look the same |
+1. Also, I was wondering if these consoles would be worth a direct link in the "main menu" on the left? Is that possible @phillip-kruger ? |
@yrodiere any link on a card can be dragged to the menu and then it will be there as a shortcut |
Wow, that's convenient. But I meant as a default, to ensure the consoles are more visible. I suspect most people won't care at all about the list of entities, but they will very much care about SQL/HQL consoles, so we probably want all developers to be aware these consoles exist. |
Yes you can also add that there always. Rather than a Card builder you will use a Menu Builder. The rest is the same |
Created #46759 |
Also created #46760 to address the inconsistent structure of Hibernate Dev UI (which is a pre-existing problem I think, so not strictly related to this PR) |
If we want this to be consistent with the existing Hibernate ORM views, i.e. persistence unit selection in a tabsheet instead of a combo box, that's a pretty easy change. I felt the drop-down would be a bit nicer / less intrusive, but I don't have a strong opinion on it. |
Yes I also think your solution is better, that's why I'd rather we merge it and fix the consistency later :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sure looks great! Thank you.
I have a few security concerns, and added a few more minor remarks. See below.
extensions/hibernate-orm/deployment/src/main/resources/dev-ui/hibernate-orm-hql-console.js
Outdated
Show resolved
Hide resolved
extensions/hibernate-orm/deployment/src/main/resources/dev-ui/hibernate-orm-hql-console.js
Show resolved
Hide resolved
extensions/hibernate-orm/deployment/src/main/resources/dev-ui/hibernate-orm-hql-console.js
Outdated
Show resolved
Hide resolved
extensions/hibernate-orm/deployment/src/main/resources/dev-ui/hibernate-orm-hql-console.js
Show resolved
Hide resolved
...ate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java
Outdated
Show resolved
Hide resolved
...deployment/src/test/java/io/quarkus/hibernate/orm/dev/HibernateOrmDevJsonRpcServiceTest.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevJsonRpcService.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevJsonRpcService.java
Outdated
Show resolved
Hide resolved
c5f8f80
to
0386150
Compare
This comment has been minimized.
This comment has been minimized.
0386150
to
79361b3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
30ef609
to
cec80d9
Compare
This comment has been minimized.
This comment has been minimized.
...untime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevJsonRpcService.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevJsonRpcService.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
@yrodiere thanks for the heads up, I did see that test failing enough times to guess it was just flaky. I might try to reproduce it as well, though seeing your several attempts without much success doesn't give me much hope 😅 |
Yeah I'll gladly let someone else take that one, but if you do, be warned it might take a few days... |
cec80d9
to
303f3fe
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM, we can merge any time you want IMO.
I have a suggestion for error handling, but I'll let you judge if it's necessary.
Maybe @phillip-kruger will want to have a look at the serialization part, too.
...ons/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java
Outdated
Show resolved
Hide resolved
...ons/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java
Show resolved
Hide resolved
...untime/src/main/java/io/quarkus/hibernate/orm/runtime/dev/HibernateOrmDevJsonRpcService.java
Show resolved
Hide resolved
303f3fe
to
a22c985
Compare
extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/jsonrpc/JsonRpcCodec.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Status for workflow
|
Status for workflow
|
Fixes #39584, allowing execution of arbitrary HQL queries in the current Hibernate ORM context.
The UI is very similar to the existing Agroal (SQL) database view (many thanks to @phillip-kruger for the inspiration 🙏) but allows selecting Hibernate persistence units and their entities, displaying existing data and executing custom HQL queries.
Data is rendered using native marshalling for now; this is ok for basic result types or simple entities, but it will not do for more complex models (e.g. circular associations, laziness, et.al.). I'm also working on a custom Hibernate tool that allows transforming query results to a textual (JSON) format and account for these complexities - I will update this interface to use that once it's available.