Conversation
There was a problem hiding this comment.
I wonder: wouldn't it be even more useful to return a LinkedHashMap<String,Object> where keys would be the parameter name and values the corresponding value? Implementation-wise the name is retrievable via metadata().getName(i); I'm suggesting LinkedHashMap to preserve the order in which parameters appear in the statement.
There was a problem hiding this comment.
Also: would it make sense to declare this method at GettableData interface level? An implementation in AbstractGettableData seems feasible and would benefit to the Row interface too.
There was a problem hiding this comment.
Yes, both very good points. I need to check how names work when the query uses positional parameters, but IIRC they get generated.
There was a problem hiding this comment.
From my experience positional parameters use original column names as parameter names - but indeed this detail needs to be double-checked.
There was a problem hiding this comment.
True, but a column can also appear twice, which is where this is going to get complicated.
|
@adutra I've moved getValues to the GettableData interface. It's still a list because of the potential duplicate identifiers, if clients need more details they can downcast to Row or BoundStatement to get the ColumnDefinitions. |
|
@olim7t Awesome! |
Backport
BoundStatement.get<Type>()from 2.1, and add a globalgetValues().This is depended upon by JAVA-646 -- slow query logger (not for the feature itself, but for
DataType#formatthat I also backported from 2.1).