fix: correct DatabaseMetaData.getTableTypes() to return table type names#162
Open
KaviarasuSakthivadivel wants to merge 1 commit intomainfrom
Open
fix: correct DatabaseMetaData.getTableTypes() to return table type names#162KaviarasuSakthivadivel wants to merge 1 commit intomainfrom
KaviarasuSakthivadivel wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
=========================================
Coverage 82.79% 82.79%
Complexity 1347 1347
=========================================
Files 111 111
Lines 4058 4058
Branches 413 413
=========================================
Hits 3360 3360
Misses 508 508
Partials 190 190
🚀 New features to boost your workflow:
|
mkaufmann
approved these changes
Mar 9, 2026
Bug: getTableTypes() was returning Map.toString() output instead of
table type names, violating the JDBC specification.
Root Cause: QueryMetadataUtil.constructTableTypesData() was using
entry.getValue() (Map<String,String>) instead of entry.getKey() (String).
Changes:
- Fix QueryMetadataUtil.java:320 - changed entry.getValue() to entry.getKey()
- Add test testGetTableTypesReturnsActualData() to verify correct behavior
Before fix:
getString("TABLE_TYPE") returned:
"{SCHEMAS=c.relkind = 'r' AND..., NOSCHEMAS=...}"
After fix:
getString("TABLE_TYPE") returns:
"TABLE", "VIEW", "INDEX", etc.
Impact:
- Fixes JDBC specification compliance
- Enables proper database tool integration (DBeaver, IntelliJ, etc.)
- Makes metadata introspection usable
Discovered during PR #136 review.
4a7def1 to
840fafa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: getTableTypes() was returning Map.toString() output instead of table type names, violating the JDBC specification.
Problem
DatabaseMetaData.getTableTypes()returns Map objects instead of table type names.Current:
{SCHEMAS=c.relkind = 'r'..., NOSCHEMAS=...}Expected:
TABLE,VIEW,INDEXFix
Changed
entry.getValue()toentry.getKey()inQueryMetadataUtil.java:320Added test to prevent regression.