Search code examples
flutterdartsqflite

Flutter SQFLITE how to remove an entry matching TWO fields


   await _database!.delete(
    "row",
    where: "id = ?",
    whereArgs: [id],
  );

I want to remove an entry based on both ID and DATETIME,

something like this;

      await _database!.delete(
    "row",
    where: "id = ?" && "DateTime = ?", <----- Doesn't actually work
    whereArgs: [id, day],
  );

How do I go about doing this? .delete only accepts a single string.


Solution

  • It seems you just pass the SQL WHERE part of the command there as a single string:

    where: "id = ? AND DateTime = ?"