-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add support for SQL script file being picked up at Hibernate ORM start time #511
Comments
Right we plan to default to a unique name for the import script. Although I'd not mind using the existing de facto standard in Hibernate: I suspect the reason to call it |
I'm fine with |
I wouldn't put it into META-INF, as it has never been there in the past. So, unless you have strong reasons to move it? Either way, I quickly tested an |
Proposal
|
It's just where it was in
I think for frequent settings we should shorten it. Now, if we want to support any setting, we could say that any setting starting with |
We floated such idea at the meeting, remember? The big problem is it kills any possibility to spot typos, usage of abandoned properties, etc.. In my experience that's a big deal. Lots of trouble with Hibernate users over the years because we couldn't 100% validate the config props - for various similar reasons. I'd really like to be able to validate all options are consumed as intended, be able to (at least) warn otherwise. |
OK, fine :) |
You'd probably want to use a different script for dev/prod/whatever, and having a single value to change (or set some property) is usually the least annoying way to achieve that. Alternatives? |
If that's the case then we can look for |
I like that direction, in principle... but when they are the same you expect people to maintain copies? |
the advantage of |
no when they are the same, they just go for |
@emmanuelbernard so which one is it going to be?
Incidentally, don't think of it as "loading data" eclusively. I used to have scripts and table admin steps in there too; it's more accurate to state that we just import the SQL which is in there - whatever it is. |
In JPA for table admin stuff you have the create and drop options. Or are you talking about something else. Frankly, we should look at the JPA doc to see why they have then separated. |
There's far more in a database than what's defined by the JPA annotations.. I'd really need it to run additional SQL. |
@Sanne you don't get me, JPA defines three lifecycles to alter the DB with SQL. create, drop and load. I forgot why and we need to look again. |
Isn't this really only a dev time type solution? Do we really want production deployments with |
The multi container is a point. That would require a whole infrastructure. to propose that. |
Thinking about this one vs multiple files, I think we could decide to go for a single file for now as it suits Hibernate ORM quite well. in which case we could reuse |
I believe they would yes |
say I want to test the app on two different databases, I'll need to be able to switch between two different scripts. |
To me that reinforces this is purely a dev only concern. Could it be something that's only active/available when |
sure it absolutely is a dev concern. Still, having the option to switch among files among various stages of dev is very useful; having to replace the file/resource with build tools is just not as user friendly as being able to pick one. |
What are you arguing for then @Sanne ? |
Note that multi database support is not the 90% use case. |
That taking away the flexibility of not being able to choose the resource script to import is not user friendly at all. Sure users will find their way around it, but no other solution is as simple as allowing to set the name. Which is what I said at #511 (comment) . I totally get it that we want to limit the options, but IMO it's good to e.g. not allow people to choose among a dozen different implementation pools, but removal of this one goess directly against day to day usability. |
You can use |
hum ok fine by me. I thought we'd generally want to discourage persistence.xml even for non-toy applications. N.B. I'm still pretty sure I'd need multiple files even when working on a single database type, this is just such an extremely common need. BTW following this line of thought wouldn't you remove connection pool sizes as well? That's definitely just "final prod tuning" |
Let's pick up the phone tomorrow because you see it as toy only limitation and I don't. |
I really didn't see it as a toy. But when I challenged that this is very useful for day to day dev, your answer was "you can use the persistence.xml" which seems to imply I'll always need a persistence.xml for serious development. |
…uarkusio#506) (quarkusio#511) * docs: Clarify that .jsh are not cached and no native support (fixes quarkusio#506) * Update readme.adoc Co-authored-by: Max Rydahl Andersen <max.andersen@gmail.com>
I'm missing at least the ability to set
javax.persistence.sql-load-script-source
to remove mypersistence.xml
and set it in the config file. Though frankly I suspect that it could default toMETA-INF/load.sql
if present, no?Also, is there any reason why the property
shamrock.hibernate.schema-generation.database.action
is named this long? Can'tshamrock.hibernate.schema-generation
do the job?WDYT?
The text was updated successfully, but these errors were encountered: