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

Java/jOOQ: Improve documentation #12

Merged
merged 3 commits into from
Feb 6, 2023
Merged

Java/jOOQ: Improve documentation #12

merged 3 commits into from
Feb 6, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Jan 25, 2023

Hi again,

the documentation improvements for the jOOQ example have been split off from GH-11, and are submitted hereby instead.

There has been another round of edits, and a few of them may have some annotations from my side. On others, you may want to have a second look, or also add some comments or questions.

You can directly view the rendered variants of the documents, it is probably more pleasant to read 12.

With kind regards,
Andreas.

Footnotes

  1. https://github.com/crate/cratedb-examples/blob/amo/jooq/improve-docs/by-language/java-jooq/README.rst

  2. https://github.com/crate/cratedb-examples/blob/amo/jooq/improve-docs/by-language/java-jooq/backlog.rst

@amotl amotl force-pushed the amo/jooq/improve-docs branch from cb7958d to 72a8de2 Compare January 25, 2023 15:01
@amotl amotl requested review from mkleen and seut January 25, 2023 15:02
@amotl amotl force-pushed the amo/jooq/improve-docs branch from 72a8de2 to 399da69 Compare January 25, 2023 15:03
@amotl amotl marked this pull request as ready for review January 25, 2023 15:03
Comment on lines +26 to +46
- When jOOQ connects to CrateDB, it displays ``SET SESSION STATEMENT WILL BE
IGNORED: extra_float_digits`` on the server console.
Copy link
Member Author

@amotl amotl Jan 25, 2023

Choose a reason for hiding this comment

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

Do you think this observation should be carried over to the CrateDB repository by creating an issue?

@amotl amotl force-pushed the amo/jooq/improve-docs branch from 399da69 to 0c120e9 Compare January 25, 2023 15:12
Comment on lines 22 to 23
- How to set the default schema name? The ``unqualifiedSchema`` property in
``jooq.gradle`` apparently only accepts ``public`` or ``none``.
Copy link
Member Author

@amotl amotl Jan 25, 2023

Choose a reason for hiding this comment

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

@seut: Coming from #11 (comment), I've added this backlog item.

Copy link
Member Author

@amotl amotl Jan 25, 2023

Choose a reason for hiding this comment

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

When thinking about it a second time, it is probably only applicable when connecting to a real database for the code generation step (GH-10).

I think configuring unqualifiedSchema=none confuses a bit as in the examples, no schema is used. I think this works as the testdrive is passed into the connection string as the database parameter which CrateDB then uses as the default schema name. Maybe rather use testdrive here and not inside the connection string and/or use the schema also in the application?

In this scenario, the corresponding setting is probably jooq.configurations.main.generationTool.generator.database.inputSchema, where I configured to use testdrive the other day.

database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'testdrive'
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Now also documented at CrateDB/jOOQ backlog » Q & A.

IGNORED: extra_float_digits`` on the server console.

- Out of curiosity, validate if, under the hood, the actual abstraction layer
is indeed ``org.hibernate.dialect.PostgreSQL94Dialect``.
Copy link

Choose a reason for hiding this comment

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

Minor: Is there any chance we could use a more up-to-date dialect ? Seems like the most recent on is https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java

Copy link
Member Author

@amotl amotl Jan 25, 2023

Choose a reason for hiding this comment

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

As of jOOQ version 3.17.7, it uses org.hibernate.dialect.PostgreSQL94Dialect 1, and I think there is no way to change that at runtime. I've reflected this detail within the documentation, thanks for asking!

Footnotes

  1. See org.jooq.SQLDialect#L1367-L1368

Copy link
Member Author

Choose a reason for hiding this comment

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

Now also documented at CrateDB/jOOQ backlog » Q & A.

@mkleen mkleen self-requested a review January 25, 2023 15:52
Copy link

@mkleen mkleen left a comment

Choose a reason for hiding this comment

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

Looks good, left a minor comment

@amotl amotl force-pushed the amo/jooq/improve-docs branch 4 times, most recently from badccb8 to c384696 Compare January 25, 2023 17:58
@amotl amotl force-pushed the amo/jooq/improve-docs branch from c384696 to bfadfdc Compare January 25, 2023 18:03
@amotl amotl merged commit 748bbb5 into main Feb 6, 2023
@amotl amotl deleted the amo/jooq/improve-docs branch February 6, 2023 15:20
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.

2 participants