-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve RowMetadata for presence/absence check of columns #56
Comments
@mp911de Can you please elaborate on this a little? |
Databases typically implement their own rules how they compare field names (case-sensitive, case-insensitive) and they allow modifiers to (like escape chars) to enforce the former or the latter comparison method. By using an appropriate |
Understood. I'm good with this proposal then and am OK merging #58. |
Replace Stream with forEach replace foreach with for loop remove unused import
Replace Stream with forEach replace foreach with for loop remove unused import change to Collection
Replace Stream with forEach replace foreach with for loop remove unused import change to Collection Change to LinkedHashSet
Replace Stream with forEach replace foreach with for loop remove unused import change to Collection Change to LinkedHashSet update jave doc
RowMetadata
currently exposesgetColumnMetadata(…)
andgetColumnMetadatas()
. If a client wants to check if a column is part of the result, then it has to obtaingetColumnMetadatas()
and iterate overColumnMetadata
.For a discovery-based client, that does not know the structure of a result, this mapping causes a significant overhead as the client cannot cache a previous metadata object.
getColumnMetadata(…)
on the other hand, throws an exception of the column atidentifier
(e.g. name of the column) is absent.How about introducing a
SortedSet<String> getColumnNames()
as short-cut? This would solve at least three issues:getColumnNames().contains(…)
to check whether a column exists.A nice side effect is that drivers can implement naming rules themselves (e.g. via
TreeSet
and aCollation
) and drivers can cache the result metadata based on vendor-specific rules.See also spring-projects/spring-data-r2dbc#69 for a use-case.
The text was updated successfully, but these errors were encountered: