insertOrIgnore method

  1. @override
Statement insertOrIgnore(
  1. QualifiedTablename table,
  2. List<String> columns,
  3. List<Object?> values
)
override

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

Implementation

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