A question about the SqliteException: too many SQL variables #2763
-
Hi,
Where After searching about this I found out that SQLite has a limited number of variables in SQL query.
And it works. But I have 2 questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can use But I don't recommend running these huge statements - since you're already using a batch, you could delete a single row at a time: await batch((batch) {
for (final id in serverIds) {
batch.deleteWhere(visitsTable, (tbl) => tbl.serverId.isNotNull() & tbl.serverId.equals(id));
}
}); Since these all generate the same SQL (with different values being bound to the variable), that might be better for the database. |
Beta Was this translation helpful? Give feedback.
You can use
isNotInExp([for (final id in serverIds) Constant(id)])
.But I don't recommend running these huge statements - since you're already using a batch, you could delete a single row at a time:
Since these all generate the same SQL (with different values being bound to the variable), that might be better for the database.