Jacob Lloyd
05/16/2022, 4:27 AMJacob Lloyd
05/16/2022, 4:28 AMJacob Lloyd
05/16/2022, 4:28 AMSecre
05/16/2022, 6:32 AM.env db with prisma methods. All works fine until today, and now prisma giving error
"Authentication failed against database server at localhost, the provided database credentials for postgres are not valid"
But yesterday all works fine. Why this can happen? I check db with psql tool and seems like db is up and running, because I can make requests to it, but nor from prisma.user
05/16/2022, 8:01 AMajay satish
05/16/2022, 8:53 AMMartin Pinnau
05/16/2022, 1:31 PMNathan Lands
05/16/2022, 4:11 PMJason Kleinberg
05/16/2022, 4:55 PMprisma.$disconnect() it’s taking around 30 seconds to a minute.Jacob Lloyd
05/16/2022, 5:34 PMJacob Lloyd
05/16/2022, 5:34 PMAlex Vilchis
05/16/2022, 5:37 PMPatty Harris
05/16/2022, 6:32 PMBruno Orosco
05/16/2022, 6:52 PMAnnie Tsai
05/16/2022, 7:23 PMupsert method with a multi-column unique constraint, e.g.:
// schema.prisma
model X {
id ...
...
email String
subdomain String
@@unique([email, subdomain])
}
// api
const upsertX = async params => {
const { email, subdomain } = params;
const upsertedX = await prisma.x.upsert({
where: { email_subdomain: { email, subdomain } },
update: { ... },
create: { email, subdomain, ... },
});
};
for some reason, the upsert call always runs for a long time and times out. I tried using prisma.x.findMany({ where: { email, subdomain } }) instead and that seems to work fine… but shouldn’t the unique constraint make querying by email_subdomain faster (or at the very least, it shouldn’t time out). am I missing something?Jacob Lloyd
05/16/2022, 10:03 PMJacob Lloyd
05/16/2022, 10:37 PMJacob Lloyd
05/16/2022, 10:37 PMJacob Lloyd
05/16/2022, 10:37 PMJacob Lloyd
05/16/2022, 10:53 PMThePoutineGuy
05/17/2022, 1:37 AMMischa
05/17/2022, 2:53 AM@@unique(...) with a COALESCE(field, 'value-if-null') field? (like on this - https://stackoverflow.com/a/8289327/4167590)Demian N
05/17/2022, 4:57 AMIbrahim
05/17/2022, 5:28 AMManuel Galván
05/17/2022, 5:41 AMManuel Galván
05/17/2022, 5:41 AMVladi Stevanovic
Dominik Jašek
05/17/2022, 10:10 AMMatt Fysh
05/17/2022, 11:55 AMnpm install i get an ERESOLVE error. Any ideas?Mattia Romeo
05/17/2022, 12:02 PM