Rashmi Bidanta
02/03/2021, 4:11 PMYousuf Hasan
02/04/2021, 2:54 AMAndy
02/04/2021, 5:41 AMManthan Mallikarjun
02/04/2021, 8:45 AMwarn @prisma/cli has been renamed to prisma.
Please uninstall @prisma/cli: npm remove @prisma/cli
And install prisma: npm i prisma
tell us to do npm install prisma -D
?Darryl
02/04/2021, 9:19 AM2.15.0
as nothing else has changed. When I say issues, I mean things are either way slower than they normally are or they just don't work at all. Logging in, fetching products, etc. Stuff that's worked without issue for a few months now.
I'm using Sentry and one of the recent issues shown from a client was:
Error: GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a connection from the pool (connection limit: 3, in use: 0))
GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a c...
I've had this setup for a few months, updating the odd thing on the server every now and then, and it's been stable while I've been focusing on the client. Based off that error message alone, can anyone see if I've maybe missed something with the latest Prisma update or if there's anything else you recommend. Thanks! 🙂Joey
02/04/2021, 9:46 AMSébastien Dubois
02/04/2021, 11:02 AMMartïn
02/04/2021, 3:43 PMtokenGenerationCount
that I need to increment +1 every time logic generates the access_token
, but it doesn’t seems to work. Below is the schema:
model userSessionInfo {
id String @id @default(cuid())
userId String @unique
deviceSignature String @unique
...
tokenGenerationCount Int @default(0)
}
And here’s the code to update:
const updateTokenCount = await prisma.userSessionInfo.update({
where: {
id: “sh3883ejJdiwoQ”
},
data: {
tokenGenerationCount: {
increment: 1
}
}
})
It fails to increment tokenGenerationCount
without any error.
The example in the doc only provides sample code for updateMany
method:
const updatePosts = await prisma.post.updateMany({
data: {
views: {
increment: 1,
},
likes: {
increment: 1,
},
},
})
Sébastien Dubois
02/04/2021, 6:12 PMAngelo
02/04/2021, 8:06 PM$transaction
I would like to get the locations that were created but Prisma only returns the main object that was created and not the nested ones
export default {
create: async (prisma, customers) => {
const maincontractors = allData.map((data) => {
const newData = {
...data,
customers: {
connect: customers
.filter((customer) => data.customers.includes(customer.name))
.map((customer) => ({ id: customer.id })),
},
locations: {
create: maincontractorLocationData.get(data.name),
},
};
return prisma.maincontractor.create({ data: newData });
});
return prisma.$transaction(maincontractors);
},
};
Is there a way that I can retrieve the location
that were created?srpies ligeros
02/05/2021, 2:48 AMsrpies ligeros
02/05/2021, 2:49 AMsrpies ligeros
02/05/2021, 2:49 AMSascha
02/05/2021, 12:50 PMordering: { myField: true }
it makes providing an orderBy
mandatory instead of optional.defrex
02/05/2021, 5:31 PMfindUnique
with rejectOnNotFound
set to true
still returns with | null
in the type. Is that going to be fixed, or is there some reason for it?Artur
02/05/2021, 9:28 PMLuke
02/06/2021, 4:10 AMurl = env("POSTGRES_URL")
I keep getting an error because of it
Error starting Prisma Client: {
"message": "Schema Parsing P1012\n\nGet config \nerror: Environment variable not found: POSTGRES_URL.\n -->
Douglas Lassance
02/06/2021, 7:57 PMJack Baude
02/06/2021, 8:17 PMimport {PrismaClient} from "@prisma/client"
^^^^^^
SyntaxError: Cannot use import statement outside a module
I can run this code just fine with ts-node
but as soon as I want to complie my code with tsc
I get this errorAaron Fulkerson
02/06/2021, 10:20 PMAwey
02/06/2021, 10:26 PMmodel Comment {
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
text String
author User? @relation(fields: [authorId], references: [id])
authorId Int? @map("author_id")
post Post? @relation(fields: [postId], references: [id])
postId Int? @map("post_id")
replies Comment[] @relation("CommentToComment")
parent Comment? @relation("CommentToComment", fields: [parentId], references: [id])
parentId Int? @map("parent_id")
@@map("comments")
}
aceix
02/07/2021, 1:10 PMYilmaz Ugurlu
02/07/2021, 1:11 PMCalin Zapan
02/07/2021, 4:29 PMYeonHoPark
02/08/2021, 12:35 AMYeonHoPark
02/08/2021, 12:35 AMYeonHoPark
02/08/2021, 12:37 AMfiltering: true,
above option is not working for me李白字一日
02/08/2021, 2:35 AMSylvain (seel-vahn)
02/08/2021, 5:12 AMawait prisma.post.update({
where: { id: 'xxx' },
data: {
tags: {
disconnect: [
// disconnect tag with uppercase
{ label: "World" }
],
connectOrCreate: [
// connect or create tag full lowercase
{
where: { label: "world" },
create: { label: "world" }
}
]
}
}
})