-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(sql): Add JSON support #3972
base: main
Are you sure you want to change the base?
Conversation
}); | ||
} | ||
|
||
private static boolean isPotentiallyJsonColumn(int columnType, Object value) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we need to remove the unused parameter value
from the method isPotentiallyJsonColumn
. This involves updating the method signature to exclude the value
parameter and ensuring that any calls to this method are updated accordingly. Since the provided code does not show any calls to this method, we will assume that the method is only used internally within the same file.
-
Copy modified line R23 -
Copy modified line R39
@@ -22,3 +22,3 @@ | ||
Object value = rs.getObject(i); | ||
if (isPotentiallyJsonColumn(rs.getMetaData().getColumnType(i), value)) { | ||
if (isPotentiallyJsonColumn(rs.getMetaData().getColumnType(i))) { | ||
try { | ||
@@ -38,3 +38,3 @@ | ||
|
||
private static boolean isPotentiallyJsonColumn(int columnType, Object value) { | ||
private static boolean isPotentiallyJsonColumn(int columnType) { | ||
Set<Integer> jsonCompatibleTypes = |
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) { | ||
String columnName = rs.getMetaData().getColumnLabel(i); | ||
Object value = rs.getObject(i); | ||
if (isPotentiallyJsonColumn(rs.getMetaData().getColumnType(i), value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try using rs.getMetaData().getColumnTypeName
?
It might be more useful as it returns the
type name used by the database. If the column type is a user-defined type, then a fully-qualified type name is returned.
Instead of the JDBC type returned by getColumnType
.
Description
Added JSON parsing for string columns.
Added Uni Tests for all sql specific json columns
Related issues
closes #3895
Checklist
no milestone
label.