joshua
09/09/2021, 11:57 PMschema.prisma
file:
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
can this be used is production say if i deploy to vercel, or is it only for development?
thanks 🙂Marx Low
09/10/2021, 8:04 AM// prisma.schema
Table Post { likes [], ... }
Table User { likes [], ... }
Table Like { userId, postId, ...}
Is there a way for me to create a new likedByUser
Boolean field (Not part of the Post Schema) like this:
prisma.post.findMany({
where: {..}
select: {
likedByUser: { // New annotated field
where: {
likes: [
{ userId: { equals: 2 } },
]
}
}
}
});
Daniell
09/10/2021, 8:38 AMprocess.env.DATABASE_URL
before creating a Prisma client instance like process.env.DATABASE_URL = ...
but unfortunately this results in
error: Environment variable not found: DATABASE_URL.
--> schema.prisma:11
|
10 | provider = "mysql"
11 | url = env("DATABASE_URL")
|
Any idea what I can do?Anirudh Nimmagadda
09/10/2021, 8:59 AMcreateMany
call.
I'm creating 20k user records with prisma.user.createMany({data: records, skipDuplicates: true})
. Each record looks like
{
email:'<mailto:Dariana_Cronin@example.net|Dariana_Cronin@example.net>',
emailVerified:true,
firstName:'Arnoldo',
lastName:'Brakus',
username:'Jabari.Schmeler'
}
This call results in
RangeError: Maximum call stack size exceeded
at Arg.collectErrors (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34906:14)
at valueToArg (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35224:47)
at /mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35468:17
at Array.reduce (<anonymous>)
at objectToArgs (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35445:28)
at /mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34989:48
at Array.reduce (<anonymous>)
at selectionToFields (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34948:36)
at makeDocument (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34940:20)
at PrismaClient._executeRequest (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:36972:23) {clientVersion: '2.29.0', stack: 'RangeError: Maximum call stack size exceeded
…les/@prisma/client/runtime/index.js:36972:23)', message: 'Maximum call stack size exceeded'}
Has anyone encountered anything like this before?gustav
09/10/2021, 1:46 PMJulia Cassemiro
09/10/2021, 2:17 PMHalvor
09/10/2021, 3:15 PMPerry Raskin
09/10/2021, 7:26 PMprisma.$disconnect()
method on all api endpoints, so i’m confused as to why this is an issue
Edit: I read some of the docs, and I set a global prisma
client, and removed all of the $disconnect
calls. It still seems to eat up the connections quickly, though.Hector
09/10/2021, 9:27 PMprisma format
?Calvin
09/10/2021, 9:37 PMRon Arts
09/10/2021, 9:55 PMinlightmedia
09/11/2021, 5:28 AMRon Arts
09/11/2021, 12:29 PMFeralheart
09/11/2021, 3:52 PMVilke
09/11/2021, 4:03 PMBenny
09/11/2021, 7:53 PMBenny
09/11/2021, 7:55 PMBenny
09/11/2021, 8:21 PMRamon Pans
09/11/2021, 9:11 PMPerry Raskin
09/12/2021, 3:24 AMHector
09/12/2021, 4:43 AMThomas Morice
09/12/2021, 5:19 PMJohn Kelly
09/12/2021, 8:53 PMfindUnique
using the primary key?Brook MG
09/12/2021, 10:41 PMjoshua
09/13/2021, 2:16 AMgetUserByAccount is not a function
error when using the PrismaAdapter with next-auth
?Jonathan
09/13/2021, 8:49 AMObject { message: "Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 5)", locations: […], path: […], … } -
I had to redeploy the container we had our API deployed on to fix this (the database connection stayed down until then). Obviously something is going wrong with our connections on prisma, but I can’t tell since we only have a single prisma client
we init in a module. Any potential ways of troubleshooting this? Should I do the ill-advised prisma.$disconnect
?Mohammed Alrea
09/13/2021, 9:55 AMMohammed Alrea
09/13/2021, 9:56 AMuser
09/13/2021, 10:57 AMuser
09/13/2021, 10:57 AM