executeUpsert method

Future<SQLResponseOf<void>> executeUpsert({
  1. required String tableName,
  2. required JsonRow values,
  3. JsonRow where = const {},
  4. bool nullAsBlank = false,
})

Executes an SQL UPSERT query and returns the result as a SQLResponseOf object.

The tableName parameter specifies the name of the table to upsert into. The values parameter is a JsonRow object representing the values to upsert. The where parameter is a JsonRow object representing the WHERE clause. The nullAsBlank parameter specifies whether to treat null values as blank.

Implementation

Future<SQLResponseOf<void>> executeUpsert({
  required String tableName,
  required JsonRow values,
  JsonRow where = const {},
  bool nullAsBlank = false,
}) {
  return executeSQL(
    dataSetType: "table",
    sql: values.asUpsertCommand(
      tableName: tableName,
      where: where,
      nullAsBlank: nullAsBlank,
      quoteChar: quoteChar,
      dataBaseProvider: dataBaseProvider,
    ),
  );
}