jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

jaguar_query_sqljocky-2.2.4/adapter.dart - find(Find st) method returns wrong type

Open Adenosperma1 opened this issue 4 years ago • 0 comments

Method: Future<List<Map>> find(Find st) Error: A value of type 'StreamedResults' can't be assigned to a variable of type 'Results'.

Fix?:

Future<List<Map>> find(Find st) async { String stStr = composeFind(st);

sj.StreamedResults streamedResults = await _connection.execute(stStr);

List<sj.Row> rows = await streamedResults.toList();
List<sj.Field> fields = streamedResults.fields;

var theKey, theValue;
var mapList = <Map>[];

for (var arow in rows) {
  var mapData = Map();
  for (int i = 0; i < fields.length; i++) {
    theKey = fields[i].name;
    theValue = arow[i];
    mapData[theKey] = theValue;
  }
  mapList.add(mapData);
}
return mapList;

}

Adenosperma1 avatar Mar 31 '20 06:03 Adenosperma1