-
Notifications
You must be signed in to change notification settings - Fork 92
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
schema update or validation #536
Comments
Right, there's nothing like the JDBC metadata API in Vert.x currently so this would have to be done by queries against the information schema. So it's probably a fair bit of work. OTOH if you do have a JDBC driver, it should happily just use it. |
We should document this in limitations. |
So for this issue we need to provide a partial implementation of either the JDBC metadata API, or of whatever abstraction Hibernate core has of the JDBC metadata (I forget and I have not checked), for each of the dialects we support, by directly querying the information schema. (Well, we don't need to support all 3 dialects initially, we would start with postgres.) Note that it doesn't actually need to be non-blocking, but it does need to use the Vert.x client to execute the SQL. @DavideD would you like to take a stab at that work? |
Ok
…On Wed, 24 Feb 2021, 12:57 Gavin King, ***@***.***> wrote:
So for this issue we need to provide a partial implementation of either
the JDBC metadata API, or of whatever abstraction Hibernate core has of the
JDBC metadata (I forget and I have not checked), for each of the dialects
we support, by directly querying the information schema.
(Well, we don't need to support all 3 dialects initially, we would start
with postgres.)
Note that it doesn't actually need to be non-blocking, but it *does* need
to use the Vert.x client to execute the SQL.
@DavideD <https://github.com/DavideD> would you like to take a stab at
that work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#536 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEIQ5MQYNJC66XM664DYATTATZSXANCNFSM4XCMBLQA>
.
|
@gavinking, I am able to query sequence metadata using PostgreSQL, but the results are not processed properly. Hibernate ORM uses SequenceInformationExtractorLegacyImpl to process the metadata. It uses Currently, the values for those columns in the In the debugger using ORM, I can see that these column values are arrays of ASCII values. The JDBC driver knows how to convert an array to a Where would you consider the bug to be? In |
How are those columns defined in the database schema itself? |
Oh, I see, it's the schema itself that's wrong:
|
So I know the Vert.x guys don't want to do type conversions in the driver, so we need to do the conversion at a higher level. So I guess either subclass |
@gavinking, thanks for the feedback. I think, for now, that I will subclass |
Hi - I just wanted to see if there was any progress on this? |
|
@edeandrea, yes, there has been good progress for PostgreSQL. @DavideD has looked at a draft, and I am incorporating his recommendations. If nothing else gets in the way, I will have a PR by the end of the week. |
Thanks @gbadner for the update! Would this issue not be considered complete until support for all the relational databases is available? |
Great! 👍 |
I mean eventually we would want to support all databases, but IMO that shouldn't block merging of the Postgres support. Furthermore, my bet is it will be pretty straightforward to add additional databases once we have it working for one of them. |
Sweet! Postgres is my current target so that's good news to me :) I don't want to be greedy though! |
I believe it will be straightforward, at least for those dialects that support I've read that DB2 doesn't support |
I mean as far as I know it's part of the definition of being an RDBMS that you have the schema reified as a meta-schema (forget the correct term for that). |
I think it does, but it also has |
@gavinking , @edeandrea , in case you didn't see, I'm just letting you know that I posted a draft PR for this: #903 |
Oops, meant to delete my previous comment, not close the issue... |
@gavinking, I just read over comments and noticed:
Currently, that will not happen. It will always use Vert.X. I'll have to think about this some more. |
@gbadner I don't think that's important. I mean, it was useful before your work, but now I can't think of a strong reason anyone would prefer to use JDBC. |
Done by #903. |
See quarkusio/quarkus#14264 (comment)
Whenever one sets
hibernate.hbm2ddl.auto
tovalidate
orupdate
, the schema management tool apparently tries to get a JDBC connection and ultimately fails with an error like this:Everything works fine with other modes that only rely on
GenerationTarget
and only push "write" commands, because Hibernate Reactive uses aReactiveGenerationTarget
to redirect the commands to the reactive driver.But
validate
andupdate
need to read the database schema, and that code doesn't rely on theGenerationTarget
, but on SQL commands sent through JDBC directly.I believe we need another abstraction in the schema management tool to make it use the reactive driver instead of JDBC?
The text was updated successfully, but these errors were encountered: