khareta
03/11/2021, 2:40 PMSimão Cruz
03/11/2021, 4:58 PMDaniell
03/11/2021, 11:08 PMuzu
03/11/2021, 11:20 PMRobert
03/12/2021, 9:40 AM<URL>/pool?sslmode=require&pgbouncer=true
However this causes me a lot of trouble. I very often get an Error: P1002
during build time on Vercel (while running prisma migrate deploy --preview-feature
) and when using my app often get hit with a
Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (<https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#connection-pool>). Current limit: 5.
Granted I execute quite a few queries, but nothing crazy... and this is only 1 user! What if I have 10 active users? Or 100?
I thought setting pgbouncer=true
should be enough? Should I set connection limit to 11? Or to 5000? I'm very confused! What am I doing wrong? 😅Darryl
03/12/2021, 9:53 AMdescription
, notes
, etc. Right now, those things are simply stored as (English) strings – or lists of strings in the case of notes
– but I've recently been thinking about translations. My app has the ability to provide translations for in-app strings but everything from the database, at least right now, will be in English. I'm wondering what'd be a smart way to include translations for these things straight from the database. Just thinking out loud, maybe I could store things like description
as JSON
(I'm using PostgreSQL) instead of a string and then structure that by "en", "de", etc. Then, the user's locale could be passed via query parameter. Anyway, I'm kind of new to all this and learning as I go so I'd be happy to hear some suggestions. Thanks, everyone! Have a great day.Matheus Assis
03/12/2021, 12:03 PMSzymon Polom
03/13/2021, 12:07 PMCan't reach database server at
with the error code P1001
- is there a way to increase the time limit for the connection handling (besides of DB_POOL_TIMEOUT
)? My use case is a serverless DB in AWS which needs a bit of startup time. I digged a bit through the code, but couldn't find anything.Ryan Byrne
03/13/2021, 6:04 PMschema.prisma
file? Trying to see if there is any way of having a single source of truth to generate DB schema/graphql schema/ and some types - maybe a pipe dream though 🙂: Edit - I think typegraphql-prisma
may be what I am looking forAaron Gerber
03/13/2021, 10:37 PMconst introduction = `
type HellowWorld {
Person: Aaron`;
Ville
03/14/2021, 2:10 PMGeorge / გიორგი
03/14/2021, 2:29 PMconst upsert = await prisma.analytics.upsert({
where: { date: new Date(body.date) },
update: {
viewers: body.viewers,
},
create: {
date: new Date(body.date),
country: body.country,
viewers: body.viewers,
}
})
res.status(204).json(upsert)
Manish
03/15/2021, 2:40 AMMitchell
03/15/2021, 4:14 PMwarn(prisma) @prisma/cli has been renamed to prisma.
Please uninstall @prisma/cli: npm remove @prisma/cli
And install prisma: npm i --save-dev prisma
Stephen Jensen
03/16/2021, 3:49 AMUser
model where it can have friends who are also users.
About 5 months ago I saw a nice explanation by @Ryan where he said we could use the following model:
model User {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
friends Relationship[]
}
model Relationship {
id String @id @default(cuid())
user User? @relation(fields: [userId], references: [id])
userId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
I think the thing that would clear this up for me would be to see example prisma create commands that would show how to take 2 users and first create a relation from user1 -> user2
and then how to do the back relation. I'll start- thanks so much!
const user1 = await prisma.user.create({ data: { id: "1" } })
const user2 = await prisma.user.create({ data: { id: "2" } })
const relationship1To2 = await prisma.relationship.create({ //?? })
const relationship2To1 = await prisma.relationship.create({ //?? })
(My confusion stems from the fact that it seems like if we create a relationship where we set user1.id
to userId
, we will establish the relationship between user1->friendship
but not back to user2
.)nikolasburk
Mitchell
03/16/2021, 5:44 PMnpx prisma migrate dev --preview-feature
I see this message in the console:
migrate dev is not a prisma command.
▸ Perhaps you meant generate
Sequential
03/16/2021, 5:51 PMMartïn
03/16/2021, 6:06 PMPhilipp Rajah Moura Srivastava
03/16/2021, 6:36 PMANISH AGGARWAL
03/16/2021, 10:54 PMgraphql-yoga
but due to update in Chrome, it doesn't allow to persist cookie
by sameSite
which can be fixed by https://github.com/prisma-labs/graphql-yoga/issues/623
I would be happy to contribute to fix it if the mentor aggrees, and community is active.
Thanks!🙂Yilmaz Ugurlu
03/17/2021, 10:46 AMRalf Vogler
03/17/2021, 4:26 PMprisma db push
so far, now prisma migrate dev
wants to reset the database but I already have data in it. How can I keep it or easily copy it?Daniel Snell
03/17/2021, 4:34 PMMike Cavaliere
03/17/2021, 4:45 PMDmitry Petrov
03/17/2021, 5:28 PM"ts-node": "ts-node --compiler-options '{\"module\":\"CommonJS\"}'"
to package.json/scripts
to allow it to run. Prior to 1.18.0 I was using the workaround suggested in this GitHub issue by elkevinwolf. All was working fine on my local dev environment, but I’m getting errors when I try to do this as part of a Vercel build. The seed.ts
file references other lib files in our codebase, almost all of which are ES6 modules. We also have baseUrl set to .
in tsconfig.json
– though I think I’ve been able to work around that. I feel that this is a result of my knowledge gap in how modules and compilers function – but since I reference ES6 modules and they have import statements, etc. all with absolute imports utilizing the basePath, things break as those functions get invoked. I’m sorry if this is somewhat vague, happy to provide code examples/errors/etc. – just want to make sure I provide what’s useful.Mike Cavaliere
03/17/2021, 5:29 PMpackage.json
to toggle migration commands when deploying? I.e. to run prisma migrate dev
vs prisma migrate deploy
dependent on environment (preview vs prod)?Mitchell
03/17/2021, 5:53 PM“code”: “INTERNAL_SERVER_ERROR”
“Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.\n”Looks like it’s a problem in:
/@prisma/client/runtime/index.js:32448:19
Mitchell
03/17/2021, 10:05 PMUnhandled Rejection (Error): Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.I’m guessing this because you need to be logged in before you can post? Is it possible to modify the server code to allow
postedById
to be undefined or null?