upsert method

Future<void> upsert({
  1. required String table,
  2. required DbRow row,
  3. List<String> preserveColumns = const [],
  4. String? indexColumn,
  5. bool verbose = false,
})

Insert a row if it does not exist or update it

It is highly recommended to use an unique index for the table to upsert into

Implementation

Future<void> upsert(
    {required String table,
    required DbRow row,
    //@required List<String> columns,
    List<String> preserveColumns = const [],
    String? indexColumn,
    bool verbose = false}) async {
  try {
    await _db.upsert(table: table, row: row.toStringsMap(), verbose: verbose);
  } catch (e) {
    rethrow;
  }
}