Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

.count() returns null for empty tables #253

Closed
sdnts opened this issue Oct 10, 2019 · 1 comment
Closed

.count() returns null for empty tables #253

sdnts opened this issue Oct 10, 2019 · 1 comment
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Milestone

Comments

@sdnts
Copy link
Contributor

sdnts commented Oct 10, 2019

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
@divyenduz divyenduz added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. labels Oct 11, 2019
@divyenduz divyenduz added the process/candidate Candidate for next Milestone. label Oct 11, 2019
@janpio janpio added this to the Preview 15 milestone Oct 11, 2019
@janpio janpio removed the process/candidate Candidate for next Milestone. label Oct 11, 2019
@timsuchanek
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

4 participants