insertOrReplace method

  1. @override
Statement insertOrReplace(
  1. QualifiedTablename table,
  2. List<String> columns,
  3. List<Object?> values,
  4. List<String> conflictCols,
  5. List<String> updateCols,
)
override

Insert a row into a table, replacing it if it already exists.

Implementation

@override
Statement insertOrReplace(
  QualifiedTablename table,
  List<String> columns,
  List<Object?> values,
  List<String> conflictCols,
  List<String> updateCols,
) {
  return Statement(
    '''
      INSERT OR REPLACE INTO $table (${columns.join(', ')})
      VALUES (${columns.map((_) => '?').join(', ')})
    ''',
    values,
  );
}