Hi,
I have a question regarding the generic type conversion for JDBC Array
types.
The java examples I've seen do a further getArray call on the object
returned by resultset.getArray(column)
java.sql.Array array = rs.getArray(columnIndex);
if (array == null) {
return true;
}
Object o = array.getArray();
It looks like the postgres jdbc adapter does the correct thing.
# Return PostgreSQL array types as ruby Arrays instead of
# JDBC PostgreSQL driver-specific array type. Only used if the
# database does not have a conversion proc for the type.
ARRAY_METHOD = Object.new
def ARRAY_METHOD.call(r, i)
if v = r.getArray(i)
v.array.to_ary
end
end
However, it looks like the generic jdbc adapter only calls getArray(column)
%w'Object Array String Time Date Timestamp BigDecimal Blob Bytes Clob'
.each do |meth|
x = convertors[meth.to_sym] = Object.new
class_eval("def x.call(r, i) r.get#{meth}(i) end", __FILE__,
__LINE__)
end
Before I create an issue in github, I wanted to check if there is a reason
for not making the postgres specific handling the default for all of JDBC.
Thanks,
Guy Boertje
Elastic/Logstash
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/5fef5f58-8f7c-4cc3-bc51-292d43f1c583%40googlegroups.com.