Conversation
|
@mauravan you can look at the existing tests of other PG specific data type and add tests in their location |
|
I'm curious, did you try using a string ? |
|
that's why im looking for an integration test - i suspect we might be able to use a String as long as we pass it as UTF8. Then we could just remove the wrapper class. i did not have a lot of time to look into it, but i will have some time soon and will dig a bit deeper |
fd24b1a to
228cc41
Compare
Signed-off-by: Meier Roman <roman.meier.rm@gmail.com>
228cc41 to
37a791e
Compare
|
Hi @vietj, So turns out we might as well use String. Or do you think there is value in an extra class like the PgSQLXML i added? otherwise i will happily remove it. Also what needs to happen next to get this merged? Thanks for your help, EDIT: I just tried this with quarkus and i think it's really unhandy to have to use an extra class for this when we could be using String - will change this EDIT2: So i did it using String now and it works just fine i think - one problem i encountered was the mapping in the DataType.java because there is already a mapping for String to Varchar
Which seems to be only important in case of a PrepareStatementCommand with parameterTypes which the test i'm executing are apparently not using. Maybe you have some more insight into that? |
Signed-off-by: Roman Meier <roman.meier.rm@gmail.com>
|
this needs to be reviewed to be merged |
| encodingTypeToDataType.put(Circle.class, CIRCLE); | ||
| encodingTypeToDataType.put(Circle[].class, CIRCLE_ARRAY); | ||
|
|
||
| // encodingTypeToDataType.put(String.class, XML); |
There was a problem hiding this comment.
See the Comment from the 22. of Dec:
So i did it using String now and it works just fine i think - one problem i encountered was the mapping in the DataType.java because there is already a mapping for String to Varchar
encodingTypeToDataType.put(String.class, VARCHAR); encodingTypeToDataType.put(String[].class, VARCHAR_ARRAY); encodingTypeToDataType.put(String.class, XML); encodingTypeToDataType.put(String[].class, XML_ARRAY);
Which seems to be only important in case of a PrepareStatementCommand with parameterTypes which the test i'm executing are apparently not using. Maybe you have some more insight into that?
|
this PR changes a lot of things that should not be changed (like reformatting), can you keep only to the essential changes ? |
Signed-off-by: Roman Meier <roman.meier.rm@gmail.com>
Signed-off-by: Roman Meier <roman.meier.rm@gmail.com>
Hi @vietj, thanks for the feedback - i reverted all the changes. The one big Problem with the One solution i could think of is to use a wrapper class for XML which would then just hold the String. Do you have any other ideas? |
|
why is it an issue ? |
|
There is these 2 cases for the Map: Where for the valueOf Method we have a mapping for each oid for the lookup i think there can only be a mapping per type. So either the Mapping is
Or it is |
| } | ||
| encodingTypeToDataType.put(String.class, VARCHAR); | ||
| encodingTypeToDataType.put(String[].class, VARCHAR_ARRAY); | ||
| // encodingTypeToDataType.put(String.class, VARCHAR); |
There was a problem hiding this comment.
As far as I understand it, there can only be one mapping per class to a Type. This is the Problem i was talking about in the other comments which we need to solve here - so either there will be a need for a wrapper class or someone can come up with a better solution for this
There was a problem hiding this comment.
you are totally right, this is because we cannot specify which database type to use in a tuple for a given java type
There was a problem hiding this comment.
So there will be something like a new Class like PgXMLType which just holds a String. Would you agree to that?
Motivation:
see #1111
I'm looking for a little guidance on this.
thanks
R