delete method

Future<void> delete(
  1. IpAddress ip, {
  2. String? language,
})

Deletes the IpGeoLocation identified by the provided ip from the database.

Implementation

Future<void> delete(IpAddress ip, {String? language}) async {
  data.remove((ip, language));

  await safe((db) async {
    final stmt = db.delete(db.geoLocations);

    stmt.where((u) => u.ip.equals(ip.val));
    if (language != null) {
      stmt.where((u) => u.language.equals(language));
    }

    await stmt.go();
  });
}