79111262

Date: 2024-10-21 18:14:04
Score: 1
Natty:
Report link

With drizzle-orm ^34.1.0 you can get result using $count. In you query, you can including playersCount in extras.

 const players = await trx.query.playerTable.findMany({
      with: {
       posts:true
      },
      extras: {
        playersCount: db.$count(playerTable),
      },
    })
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: rukundo