vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

Support XML Type on Postgres

Open mauravan opened this issue 3 years ago • 2 comments

Describe the feature

Postgres supports the storage of valid xml documents with the XMLType. https://www.postgresql.org/docs/9.3/datatype-xml.html I think it would make sense to Map it to a Java String

Use cases

From the link above:

The xml data type can be used to store XML data. Its advantage over storing XML data in a text field is that it checks the input values for well-formedness, and there are support functions to perform type-safe operations on it

Contribution

I would like to implement this but would probably need a few pointers.

I already looked at these classes (DataType.java, DataTypeCodec.java, PreparedStatementTestBase.java, RowImpl.java) and added a class to wrap the xml data which i think might be a bit redundant in the end as we could just use the String class i think. Anyway a quick talk about how a satisfactory solution could look like and what you guys think would be needed to get this going would be appreciated.

Kind regards

mauravan avatar Dec 20 '21 22:12 mauravan

please provide a PR, I think a wrapper will be necessary for XML

vietj avatar Dec 21 '21 09:12 vietj

Hi @vietj, thanks for your response. Here is the PR: https://github.com/eclipse-vertx/vertx-sql-client/pull/1112

mauravan avatar Dec 21 '21 21:12 mauravan