sqlInsertNewsUnqiueValues method

MapEntry<int, List<T>> sqlInsertNewsUnqiueValues(
  1. List<T> data,
  2. List<DatabaseColumn> selectors, {
  3. bool returnAdded = false,
  4. bool returnFulls = false,
})

insert dart T objects, which not founded in table return in MapEntry.key - count of added rows

  • selectors - columns where need to search haved data
  • returnAdded - if this true returns all copies of data added to table after insert, else return only added rows of data
  • returnFulls - if this true returns all copies of data contained in table after insert, else return only added rows of data return in MapEntry.key - count of added rows

Implementation

MapEntry<int, List<T>> sqlInsertNewsUnqiueValues(
  List<T> data,
  List<DatabaseColumn> selectors, {
  bool returnAdded = false,
  bool returnFulls = false,
}) {
  final m = sqlInsertNewsUnqiueValuesRaw(
    data.map(dartDecodeRaw).toList(),
    selectors,
    returnAdded: returnAdded,
    returnFulls: returnFulls,
  );
  return MapEntry(m.key, m.value.map(dartEncodeRaw).toList());
}