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

Add jooq module with maven #11107

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Add jooq module with maven #11107

merged 2 commits into from
Nov 14, 2024

Conversation

fabienpuissant
Copy link
Collaborator

@fabienpuissant fabienpuissant commented Oct 12, 2024

ci test not relevant because need a database up to install with this jooq plugin, cannot test on mssql. Error to connect due to url error.

See #9235

@fabienpuissant fabienpuissant marked this pull request as draft October 12, 2024 23:05
@fabienpuissant fabienpuissant force-pushed the jooq-module branch 4 times, most recently from bed27c6 to b9a7721 Compare October 30, 2024 21:51
@fabienpuissant fabienpuissant changed the title [WIP] Add jooq module Add jooq module Oct 30, 2024
@fabienpuissant fabienpuissant marked this pull request as ready for review October 30, 2024 21:52
@pascalgrimaud
Copy link
Member

for the CI test, you can create a new dedicated config with what you need to test jooq

Another idea would be to add it to mariadb, it should work: https://github.com/jhipster/jhipster-lite/blob/main/tests-ci/generate.sh#L232-L239

@fabienpuissant
Copy link
Collaborator Author

fabienpuissant commented Oct 31, 2024

for the CI test, you can create a new dedicated config with what you need to test jooq

Another idea would be to add it to mariadb, it should work: https://github.com/jhipster/jhipster-lite/blob/main/tests-ci/generate.sh#L232-L239

But the plugin connects to a database to introspect schema and generate classes depending on what tables exists.
Is it possible in the test ci to have a docker container up with a database ready to be connected to ?

@pascalgrimaud
Copy link
Member

Here some steps in the GitHub CI:

@fabienpuissant
Copy link
Collaborator Author

Here some steps in the GitHub CI:

I started to investigate on it but in fact the db needs to be up at compile time not when we start the app, so on step "Test: verify: " Regarding the workflow, I don't think we have this use case and I don't find a proper way to do it

Here an example : https://github.com/fabienpuissant/jhipster-lite/actions/runs/11622943610/job/32369374084

@fabienpuissant fabienpuissant force-pushed the jooq-module branch 2 times, most recently from cd0a545 to 771dfef Compare November 10, 2024 21:00
@@ -0,0 +1,140 @@
package tech.jhipster.lite.module.domain.jooqplugin;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't thinks this should be in module/domain, this is too specif.
How about moving that in the jooq/domain? (and remove the addition in JHipsterModule)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep + solve deplicate issue about database enum

.build()
)
.and()
.mavenPlugins()
Copy link
Contributor

Choose a reason for hiding this comment

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

NB : gradle should be supported too, by configuration the gradle plugin. See https://www.jooq.org/doc/latest/manual/code-generation/codegen-gradle/
But this must be done in a second PR. Meanwhile you can require maven as a dependency of all jooq module in JooqModuleConfiguration to prevent them from being used with gradle.

<inputSchema>%s</inputSchema>
</database>
<target>
<packageName>org.jooq.codegen</packageName>
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this should rather be the packageName from properties (e.g. generates classes to com.my.company rather than org.jooq.codegen)

| mariadb.md |
And I should have files in "src/main/docker"
| mariadb.yml |
And I should have files in "src/main/resources/config"
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is already created by the spring-boot module, so I guess you want have a finer-grained assertion like

Suggested change
And I should have files in "src/main/resources/config"
And I should have "jdbc:mariadb://localhost:3306/" in "src/main/resources/config/application.yml"

@fabienpuissant fabienpuissant changed the title Add jooq module Add jooq module on maven Nov 10, 2024
@fabienpuissant fabienpuissant changed the title Add jooq module on maven Add jooq module with maven Nov 10, 2024
@fabienpuissant fabienpuissant force-pushed the jooq-module branch 3 times, most recently from b6fac3e to de6b01b Compare November 11, 2024 00:15
@murdos murdos enabled auto-merge November 14, 2024 06:08
murdos
murdos previously approved these changes Nov 14, 2024
@murdos
Copy link
Contributor

murdos commented Nov 14, 2024

LGTM. @fabienpuissant : could you rebase the branch to fix conflicts?

auto-merge was automatically disabled November 14, 2024 06:15

Head branch was pushed to by a user without write access

@murdos murdos merged commit ee8c881 into jhipster:main Nov 14, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants