sole method

Future<Map<String, dynamic>> sole()

Execute the query and get the first result if it's the sole matching record.

Implementation

Future<Map<String, dynamic>> sole() async {
  _setStatement(Operator.get);
  _buildSql();
  var results = await db.select(_sql);
  if (results.isNotEmpty && results.length == 1) {
    return results[0];
  } else {
    return Map.of({});
  }
}