insert method
Append a new entry recording that fromAtSign performed
verbName (optionally against lookupKey) at the current
instant. Returns the assigned entry id, or null on failure.
Implementation
@override
Future<int?> insert(String fromAtSign, String verbName,
{String? lookupKey}) async {
return _db.runInTransaction(() {
_db.raw.execute(
'INSERT INTO access_log (from_atsign, request_at, verb_name, lookup_key) '
'VALUES (?, ?, ?, ?);',
[
fromAtSign,
DateTime.now().toUtc().millisecondsSinceEpoch,
verbName,
lookupKey
],
);
return _db.raw.select('SELECT last_insert_rowid() r;').first['r'] as int;
});
}