-
Notifications
You must be signed in to change notification settings - Fork 564
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
Helidon CLI - database sample does not work with MySQL due to case sensitivity #4187
Comments
Hello; to make sure I'm understanding fully, you are effectively suggesting changing these lines in the Helidon SE database archetype, where various Is that correct? |
Furthermore, indeed MySQL identifiers are stored and processed on disk as lowercase. Offhand this seems like a reasonable change. I'm not familiar with this code but I'll see what I can do. |
(And then of course the archetype should ideally work on all databases on all platforms. Maybe changing these identifiers to lower case will work on MySQL but I don't know enough to know if that will work on other databases. Researching.) |
Hello! I think that as a low-hanging fruit, the sample code can be changed to follow the one from the example directory here: Additionally, updating the JavaDoc for the DbRow.column() method for the time being with a caveat on case-sensitivity would be useful, especially for newcomers to the Helidon project. :) As a longer-term goal, yup, ideally DbClient should work across all databases universally as much as possible without having to create/configure settings for most use cases. |
…database archetype to fix issue helidon-io#4187 Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
…fix issue helidon-io#4187 Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
Environment Details
Problem Description
The database quickstart code generated by Helidon CLI fails to run if the MySQL JDBC connector is used. It appears to have hung with no detailed debug logs/output, even when starting
helidon dev
with the--verbose
argument. It turns out that the generated quickstart code callsrow.column()
with uppercase column names (e.g.ID_TYPE
inPokemonMapperProvider.java
), which causes this issue.Steps to reproduce
helidon init
, select thedatabase
quickstart samplehelidon dev --verbose
. Observe that accessing http://localhost:8080/pokemon works as expected. Terminate the Helidon process with^C
Confirm that the MySQL container is up and running by using a MySQL client to connect to it using MySQL Workbench,
mysql
CLI client, DBeaver, etc.5. Add the MySQL JDBC connector to
pom.xml
:db
prop inapplication.yaml
:helidon dev --verbose
again. Observe that accessing http://localhost:8080/pokemon times out, despite the fact that Helidon has already started up withWEB server is up! http://localhost:8080/pokemon
being the last line logged to the console. Verify that the tables have already been created at this point in time via the MySQL client. Terminate the Helidon processdb.column
calls to use lowercase names, e.g.ID_TYPE
toid_type
inPokemonMapper.read()
.helidon dev --verbose
, and access http://localhost:8080/pokemon. This should work as per normal.The text was updated successfully, but these errors were encountered: