doesntExist method

  1. @override
Future<bool> doesntExist()
inherited

Implementation

@override
Future<bool> doesntExist() async {
  try {
    String sql = "SELECT NOT EXISTS(SELECT 1 FROM $getTable";
    if (conditions.isNotEmpty) {
      sql += " WHERE ${conditions.join('')}";
    }
    sql += ") as `exists`";
    final bindings = getBindings();
    var result = await dbConnection!.select(sql, bindings);

    return (int.tryParse(result.first["exists"].toString()) == 1);
  } catch (e) {
    rethrow;
  }
}