Closed alexanderlz closed 8 years ago
Unfortunately we can't ship this change as is. The reason we don't do this is for performance. This library is used to iterate over massive result sets (in the millions of rows) and thus we need to avoid doing things like the following:
So in the case of lowercasing each lookup and all the field names, thats a no go unfortunately.
As for the field type lookup - in order to not mess with the carefully tuned performance of issue (2) add a separate list of field types to the SelectResult class (so an array that maps the field index to field type). And don't store the field types as strings in the SelectResult class, just store the field type enum value. There is already a field type module in our MySQLDB dependency which I would like you to use rather than copying in the field enum values. Then add a function to SelectResult which either returns the field name for a given column or a { field_name: field_type }.
@carlsverre - Thanks for the comments! I'll close this PR and create a fresh one, It should be cleaner that way, WDYT?
consists of two small features: