dart-drivers / mysql

MySQL Connector for Dart
Other
98 stars 38 forks source link

Expose row names on Row object #59

Closed emilniklas closed 9 years ago

emilniklas commented 9 years ago

For automated flows, being able to dynamically access the row fields in a hashmap fashion would be a huge help, and what I can gather from the source, it's certainly can't be impossible?

To be clear, this is what I would like to be able to do:

var res = await connection.query('select * from table');

await for (Row row in res)
  print('The fields are ${row.fields}');
// [id, name, other_field]
emilniklas commented 9 years ago

Looking at the code, I see that the Result object contains a field property. That will do it!