Hi Steve,
It might be possible to support these data types through a converter. Sql2o converters are so far not documented on the web page, but converters allows sql2o to convert between data from the database and types in your domain model. In this example it would be to convert from java.sql.Array to an ordinary string array.
Something like this:
public class StringArrayConverter implements Converter<String[]> {
@Override
public String[] convert(Object val) throws ConverterException {
// convert from database value (val) to a String[]
// throw a ConverterException if the converter doesn't know how to convert the given value.
}
@Override
public Object toDatabaseParam(String[] val) {
// Convert from a String array to the data type the database expects when adding parameters.
}
}
you register the converter by passing it to the constructor of the PostgresQuirks when creating your Sql2o instance:
Map<Class, Converter> converterMap = new HashMap<Class, Converter>() {{
put(String.class, new StringArrayConverter());
}};
Sql2o sql2o = new Sql2o(myDataSource, new PostgresQuirks(converterMap));
If you get this to work and you don't mind sharing your result, I would very much like to add your converter to the sql2o code base. It would be really awesome if you choose to share the result :)
Regards
Lars Aaberg