asDeleteCommand method

String asDeleteCommand({
  1. required String tableName,
  2. bool nullAsBlank = false,
  3. dynamic quoteChar,
  4. String dataBaseProvider = "",
})

Generates a DELETE command for the given table name.

The tableName parameter specifies the name of the table to delete from. The nullAsBlank parameter determines whether null values should be treated as blank strings. The quoteChar parameter specifies the character used for quoting identifiers. The dataBaseProvider parameter specifies the database provider.

Returns the generated DELETE command as a string.

Implementation

String asDeleteCommand({
  required String tableName,
  bool nullAsBlank = false,
  dynamic quoteChar,
  String dataBaseProvider = "",
}) {
  String whereClause = asWhereClausule(
    nullAsBlank: nullAsBlank,
    quoteChar: quoteChar,
    dataBaseProvider: dataBaseProvider,
  );
  return 'DELETE FROM ${SqlUtil.wrap(tableName, quoteChar, dataBaseProvider)} WHERE $whereClause;';
}