Skip to content

How to SELECT COUNT(*) with drizzle? #489

Answered by jschwindt
jschwindt asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind, I figured it out:

const dbUsers = await db.select({ totalUsers: sql`COUNT(*)` }).from(users)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by jschwindt
Comment options

You must be logged in to vote
2 replies
@jschwindt
Comment options

@Senbonzakura1234
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants