Prisma-client-js: `.count()` returns `null` for empty tables

Created on 10 Oct 2019  路  1Comment  路  Source: prisma/prisma-client-js

To reproduce:

  1. Create a blank project with prisma2 init
  2. Without seeding the database, create a script with these contents:
import { Photon } from "@generated/photon";

const photon = new Photon();
async function main() {
  console.log(await photon.users.count());
}

main()
  1. The query logs null instead of 0
bu2-confirmed kinbug

Most helpful comment

Fixed in latest alpha.
You can try it out with npm i -g prisma2@alpha.

>All comments

Fixed in latest alpha.
You can try it out with npm i -g prisma2@alpha.

Was this page helpful?
0 / 5 - 0 ratings