I have a query for my Sqlite/Brite databse that takes two conditions. One to check for a selected quarter, and another to make sure an action attribute isn't "delete". When I only have the WHERE clause to check for the selected quarter, I get all the data I want. When I add the WHERE clause to check to make sure it doesn't have a "deleted" attribute, nothing comes back. Nothing should have a deleted attribute so all the same data should come back, but it isn't. Why is this?
Heres the function that's causing me the issues
Stream<List<dynamic>> getTransaction() async* {
List _transaction = [];
final sessionData = await getSession();
final db = await initDatabase();
yield* db.createQuery(
"transactions",
where: 'action != "delete" AND transaction_quarter = ? ',
whereArgs: [sessionData['selected_quarter']]
).mapToList((row) => TransModel.Transaction.fromMap(row));
}
it looks like you have
"delete"
in your SQL. I think you'll need'delete'
. They are definitely not the same.