save method

  1. @override
Future<int> save(
  1. Map<String, dynamic> map,
  2. String table, {
  3. List<String>? keys,
  4. String? dbName = defaultDBName,
  5. dynamic tryToLogOperation = true,
})
override

Perform an INSERT or an UPDATE depending on the record state (UPSERT)

Implementation

@override
Future<int> save(Map<String, dynamic> map, String table,
    {List<String>? keys,
    String? dbName = defaultDBName,
    tryToLogOperation = true}) async {
  final res = await super.save(map, table, keys: keys, dbName: dbName);
  if (tryToLogOperation && !_isSystemTable(table)) {
    await logOperation(table, Operation.update, map[_getKeyField(table)],
        dbName: dbName!);
  }
  return res;
}