firstAsMap method

Future<Map<String, dynamic>?> firstAsMap()

Implementation

Future<Map<String, dynamic>?> firstAsMap() async {
  if (!currentQuery.isQuery()) {
    throw Exception('Dblayer@firstAsMap Is nessesary query');
  }

  final rows = await executor.getAsMap(currentQuery.toSql(isFirst: true),
      substitutionValues: currentQuery.buildSubstitutionValues());

  //if (rows != null) {
  if (rows.isNotEmpty) {
    return rows[0];
  } else {
    return null;
  }
  /*} else {
    return null;
  }*/
}