insert method

  1. @override
Future<int?> insert(
  1. String fromAtSign,
  2. String verbName, {
  3. String? lookupKey,
})
override

Creates a new entry with fromAtSign, verbName and optional parameter lookupKey for lookup and plookup verbs. @param fromAtSign : The another user atsign @param verbName : The verb performed by the atsign user @param lookupKey : The optional parameter to hold lookup key when performing lookup or plookup verb.

Implementation

@override
Future<int?> insert(String fromAtSign, String verbName,
    {String? lookupKey}) async {
  int? result;
  var entry = AccessLogEntry(fromAtSign, DateTime.now(), verbName, lookupKey);
  try {
    result = await _accessLogKeyStore.add(entry);
  } on Exception catch (e) {
    throw DataStoreException(
        'Exception adding to access log:${e.toString()}');
  } on HiveError catch (e) {
    throw DataStoreException(
        'Hive error adding to access log:${e.toString()}');
  }
  return result;
}