How to count how many records you have in a table? #1034
ReinaldoSergio
started this conversation in
General
Replies: 1 comment 3 replies
-
Counting is explained in the documentation. You can use this: Future<int> rowsIn(TableInfo table) {
final amount = countAll();
final query = selectOnly(table)..addColumns([amount]);
return query.map((row) => row.read(amount)).getSingle();
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using moor_flutter and I don't know how to count how many records are in a table, can someone tell me how to do this?
Beta Was this translation helpful? Give feedback.
All reactions