insert method

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

Insert a new record in the passed table based on the map object and return the new id

Implementation

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