insertOrIgnore method
Statement
insertOrIgnore(
- QualifiedTablename table,
- List<
String> columns, - 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 INTO $table (${columns.map(quote).join(', ')})
VALUES (${columns.mapIndexed((i, _) => '\$${i + 1}').join(', ')})
ON CONFLICT DO NOTHING;
''',
values,
);
}