Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma studio creates too many clients #799

Closed
samrxth opened this issue Oct 16, 2021 · 4 comments
Closed

Prisma studio creates too many clients #799

samrxth opened this issue Oct 16, 2021 · 4 comments

Comments

@samrxth
Copy link

samrxth commented Oct 16, 2021

Bug description

When I run yarn run prisma studio I get a warning after a bit saying warn(prisma-client) Already 10 Prisma Clients are actively running..

How to reproduce

Expected behavior

One instance of the prisma client

Prisma information

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

generator docs {
  provider = "node node_modules/prisma-docs-generator"
  output   = "../../docs"
}

// --------------------------------------

enum JobType {
  PART_TIME
  FULL_TIME
}

enum Role {
  ADMINISTRATOR
  EMPLOYER
  INTERN
  STANDARD
}

// --------------------------------------

model User {
  id              Int              @id @default(autoincrement())
  email           String           @unique
  password        String
  username        String           @unique
  role            Role
  name            String?
  picture         String
  jobApplications JobApplication[]

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

model JobApplication {
  id          Int    @id @default(autoincrement())
  description String

  internId          Int
  internInformation User @relation(fields: [internId], references: [id])

  jobId Int
  job   Job @relation(fields: [jobId], references: [id])
}

model Job {
  id             Int       @id @default(autoincrement())
  position       String
  description    String
  industry       String
  jobType        JobType
  skillsRequired String[]
  numOfOpenings  Int       @default(1)
  expirationData DateTime?
  duration       String
  postedAt       DateTime  @default(now())

  applications JobApplication[]

  companyId Int
  Company   Company @relation(fields: [companyId], references: [id])
}

model Company {
  id          Int     @id @default(autoincrement())
  name        String  @unique
  description String
  logo        String?
  website     String?
  industry    String
  foundedYear Int
  jobs        Job[]
}

Environment & setup

  • OS: Mac OS
  • Database: PostgreSQL
  • Node.js version: v16.6.0

Prisma Version

Environment variables loaded from .env
prisma                  : 3.2.1
@prisma/client          : 3.2.1
Current platform        : darwin-arm64
Query Engine (Node-API) : libquery-engine b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at ../../../.nvm/versions/node/v16.6.0/lib/node_modules/prisma/node_mod
ules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine        : migration-engine-cli b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at ../../../.nvm/versions/node/v16.6.0/lib/node_modules/prisma/nod
e_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine    : introspection-core b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at ../../../.nvm/versions/node/v16.6.0/lib/node_modules/prisma/node_
modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary           : prisma-fmt b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at ../../../.nvm/versions/node/v16.6.0/lib/node_modules/prisma/node_modules/
@prisma/engines/prisma-fmt-darwin-arm64)
Default Engines Hash    : b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c
Studio                  : 0.435.0
@yunfan

This comment has been minimized.

@gaFregatto

This comment has been minimized.

@yunfan

This comment has been minimized.

@janpio janpio transferred this issue from prisma/prisma Nov 8, 2021
@sdnts
Copy link
Contributor

sdnts commented Jan 6, 2022

Hey, this looks like the same issue as #800, so I'm closing this one.

FWIW, that issue is also resolved in the latest dev version of the Prisma CLI. My comment on there has more details.

@sdnts sdnts closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants