joao.santos
07/10/2021, 6:46 AMkhareta
07/10/2021, 9:39 AM`ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1461, message: "Can\\'t create more than max_prepared_stmt_count statements (current value: 16382)", state: "42000" })) })`,
I read here https://github.com/prisma/prisma/issues/6872 that it was fixed in v2.25(although it isn't mentioned in the release notes).
But unfortunately, I have to stay at v2.19 for a month or two until next major release(breaking changes). So, what values do you recommend for that parameter?
max_prepared_stmt_count
currently the default is 16k something.BlackFeather97
07/10/2021, 10:50 AMBa Thien Tran
07/10/2021, 10:51 AMMarco Moi
07/10/2021, 10:56 AMSlackbot
07/10/2021, 3:26 PMRidhwaan Shakeel
07/11/2021, 2:00 AMnull
& undefined
in orderBy and sort them at the bottom or does it omit fetching them?Gelo
07/11/2021, 3:02 AMjasci
07/11/2021, 10:29 AMonDelete
and onUpdate
behaviour.
We’ve got 3 types of relations: 1-1, 1-n, n-n with 3 possible ways to set up.
Wanted to clarify how to properly add cascading deletes/updates to all of them.
Please correct me if I’m wrong.
1. n-n relations
If I delete Profile, all User records that are related are deleted too.
model User {
id String @id
profiles Profile[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
users User[]
}
If I delete User, all Profile records that are related are deleted too.
model User {
id String @id
profiles Profile[]
}
model Profile {
id String @id
users User[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
If I delete User, all Profile records that are related are deleted too. And the other way around.
model User {
id String @id
profiles Profile[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
users User[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
2. 1-n relations
If I delete a User, all Profile records that are related are deleted too.
model User {
id String @id
profiles Profile[]
}
model Profile {
id String @id
userId string
user User @relation(fields: [userId], onDelete: Cascade, onUpdate: Cascade)
}
If I delete a Profile, the User record that is related is deleted too.
model User {
id String @id
profiles Profile[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
userId string
user User
}
Combination of the previous 2 actions.
model User {
id String @id
profiles Profile[] @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
userId string
user User @relation(fields: [userId], onDelete: Cascade, onUpdate: Cascade)
}
1. 1-1 relations
If I delete a User, the Profile record that is related is deleted too.
model User {
id String @id
profile Profile?
}
model Profile {
id String @id
userId string
user User @relation(fields: [userId], onDelete: Cascade, onUpdate: Cascade)
}
If I delete a Profile, the User record that is related is deleted too.
model User {
id String @id
profile Profile? @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
userId string
user User
}
Combination of the previous 2 actions.
model User {
id String @id
profile Profile? @relation(onDelete: Cascade, onUpdate: Cascade)
}
model Profile {
id String @id
userId string
user User @relation(fields: [userId], onDelete: Cascade, onUpdate: Cascade)
}
Thank you.Dog
07/11/2021, 4:18 PMDog
07/11/2021, 4:18 PMTarik Brat
07/12/2021, 12:34 PMTarik Brat
07/12/2021, 12:35 PMLuis Kuper
07/12/2021, 1:51 PMjustinhandley
07/12/2021, 2:52 PMMischa
07/12/2021, 3:33 PMmigrate deploy
programmatically?
Looks like maybe I want to use https://github.com/prisma/prisma/blob/master/src/packages/migrate/src/Migrate.ts ?manuel
07/12/2021, 3:34 PMResult:
but in the db everything shows up... ?!?RoMay
07/12/2021, 4:24 PM@updatedAt
- it seems the timestamp gets updated on every update of the record, even when the new dataset is exactly the same as the origin one.
Is there any way to exclude empty updates on Prisma/ORM level, so the updatedAt considers only real delta in the update scenario? I guess, this would give us less redundancy and additional a performance bonus.Adam
07/12/2021, 4:52 PMprisma
a postgres connection string with a schema that doesn't exist, it should create it correct?Gelo
07/12/2021, 5:16 PMWill
07/12/2021, 6:10 PMWill
07/12/2021, 6:13 PMEthan Zoller
07/12/2021, 8:04 PMMarco Moi
07/12/2021, 8:54 PMWill
07/12/2021, 9:06 PM.env
from ./prisma/.env
to ./.env
- any idea why this is?Seungsu Kim
07/13/2021, 1:21 AMmodel User
in schema.prisma
, I want the name of generated type to be UserModel
Gelo
07/13/2021, 7:00 AMGelo
07/13/2021, 7:00 AMMikastark
07/13/2021, 8:38 AMIan
07/13/2021, 8:52 AMmodel User {
id String @default(cuid())
@@id([id])
}
model Group {
id String @default(cuid())
@@id([id])
}
model Member {
group Group @relation(fields: [groupId], references: [id])
groupId String
user User @relation(fields: [id], references: [id])
id String
@@id([groupId, id])
}
When creating user only it works fine, no problem with the default generation value of cuid()
But
When creating group only it doesn't work it says Null constraint error for id both from API and PRISMA studio
Why does my default cuid doesnt work?
Current workaround use cuid npm package