-
I'm just starting with drizzle-orm and I can't figure out how to do a simple "SELECT COUNT(*) FROM someTable". |
Beta Was this translation helpful? Give feedback.
Answered by
jschwindt
Apr 20, 2023
Replies: 2 comments 2 replies
-
Never mind, I figured it out: const dbUsers = await db.select({ totalUsers: sql`COUNT(*)` }).from(users) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jschwindt
-
@jschwindt if i do limit and skip for pagination and i want to get the count before limit and skip to get the total record, does this work for my problem? |
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
Never mind, I figured it out: