Replies: 1 comment 2 replies
-
You need to add the aggregate expression explicitly: final count = countAll();
final stmt = selectOnly(myTable)..addColumns([count]);
int cnt = await stmt.map((row) => row.read(count)!).getSingle();
That's a fair question, I think we should have an API for this since it's fairly common. I'll add add extension allowing you to write |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Flutter drift 2.11 How to count records in the table?
Why I can't do :
int cnt = select(myTable).count();
Beta Was this translation helpful? Give feedback.
All reactions