Mischa
09/29/2021, 3:44 PMENOENT: no such file or directory, open '/var/task/schema.prisma'
Can I at least tell it what path my schema.prisma file is at somehow? I couldn’t find anything in the docs
I commented on https://github.com/prisma/prisma/issues/9435Phong Ho
09/30/2021, 6:59 AMMischa
09/30/2021, 7:04 AMPrismaClient? in prisma 3 constructing the client now tries to load the schema.prisma file which I don’t have in my lambda functions that don’t use prisma (but do happen to import the file that constructs the client)Mischa
09/30/2021, 2:26 PMprisma.tenant.findMany() which seems like a while. It's a lambda function in a VPC talking to an aurora serverless pg database, I would expect it to be a bit faster than that.
Just wanted to share in case this is useful information for someone.Mischa
09/30/2021, 4:08 PMkoufatzis
10/02/2021, 3:02 PMCHECK constraints ?Mischa
10/03/2021, 10:23 AMPRISMA_APPSYNC_GENERATED_CONFIG.”
Prisma client loads just fine for all my other lambdas, only prisma-appsync seems to have the problemRidhwaan Shakeel
10/03/2021, 9:03 PMconst album = {
...result,
songs: {
connectOrCreate: result.songs.map(s => ({
create: {
...s,
artists: {
connectOrCreate: s.artists.map(a => ({
create: a,
where: { spotify_id: a.spotify_id }
}))
},
where: { spotify_id: s.spotify_id }
}))
}
}
schema:
model Album {
artists Artist[]
songs Song[]
}
model Artist {
albums Album[]
songs Song[]
}
model Song {
album Album @relation(fields: [album_spotify_id], references: [spotify_id], onDelete: Cascade)
artists Artist[]
}james tan
10/04/2021, 6:30 AMDanny Nemer
10/05/2021, 3:21 AMgit pull, they must then run prisma generate to update their local environment for any schema changes others may have made.
I’m surprised this is the default expectation because it is a hassle.
We could create a git-hook to automatically regenerate on every pull, but it would be simpler to check-in the generated-client-code and add a CI check that ensures the client-code is up-to-date.Torrino
10/05/2021, 11:09 AMAlready 10 Prisma Clients are actively running. showing up in my terminal where I've ran prisma studio after a few minutes.
I'm only instantiating the PrismaClient once when my app launches. This has been the case in the past year but I've only recently started getting this warning so I can't pinpoint the cause. Any help would be gladly appreciatedGautam Paranjape
10/08/2021, 5:27 AMenum MemberRole {
Owner
Viewer
Editor
Unauthorized
}
model Member {
id String @id @default(uuid())
role MemberRole @default(Unauthorized)
pending Boolean? @default(true)
user User @relation(fields: [userId], references: [id])
userId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
And using prisma client, I’m trying to create a new Member like the image attached. For some reason, the role property isn’t showing up even though I tried running generate, and db push multiple times. Am I doing something wrong?Marco Schweizer
10/08/2021, 7:39 AMqb.andWhere(
'("Appointment"."start_date", "Appointment"."end_date") OVERLAPS (:startDate, :endDate)',
{ startDate: startDate, endDate: endDate }
);
Is there any way to make use of OVERLAPS in prisma without having to build the whole query yourself?Nditah Samweld
10/10/2021, 5:46 AMnpx prisma migrate dev
Error: P3014
Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at <https://pris.ly/d/migrate-shadow>
Original error:
db error: ERROR: permission denied to create database
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:354
1: migration_core::api::DevDiagnostic
at migration-engine/core/src/api.rs:108
The postgres database connects wellHugo Marques
10/10/2021, 2:04 PMMischa
10/12/2021, 5:56 AMMischa
10/12/2021, 10:34 AM"migrate:init": "npx prisma migrate dev --name init" - why the --name init bit?Mischa
10/12/2021, 2:17 PMinterface TableNameQueryResult {
tablename: string
}
export async function truncateAllTables() {
const qres = await prisma.$queryRaw<
TableNameQueryResult[]
>`SELECT tablename FROM pg_tables WHERE schemaname='public'`
for (const { tablename } of qres) {
if (tablename !== "_prisma_migrations") {
// try {
await prisma.$queryRaw`TRUNCATE TABLE "public"."${tablename}" CASCADE;`
// } catch (error) {
// console.log({ error })
// }
}
}
}
It gives me this error:
Invalid `prisma.queryRaw()` invocation:
Your raw query had an incorrect number of parameters. Expected: `0`, actual: `1`.
81 | if (tablename !== "_prisma_migrations") {
82 | // try {
> 83 | await prisma.$queryRaw`TRUNCATE TABLE "public"."${tablename}" CASCADE;`
| ^Rony Fhebrian
10/12/2021, 5:54 PMMischa
10/13/2021, 10:17 AMError: P3006
Migration `20211013101052_candidate_id_shouldnt_be_unique` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: ALTER TYPE ... ADD cannot run inside a transaction block
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:354
1: sql_migration_connector::validate_migrations
at migration-engine/connectors/sql-migration-connector/src/lib.rs:342
2: migration_core::api::DevDiagnostic
at migration-engine/core/src/api.rs:108
trying to run ALTER TYPE "CandidateSource" ADD VALUE 'OTHER';Mischa
10/13/2021, 1:20 PMHector
10/13/2021, 3:46 PMinclude API to automatically return all relational fields without specifying them?Mischa
10/13/2021, 6:26 PMinclude? Like return my objects even if the relation doesn’t exist, like a LEFT JOIN situation?koufatzis
10/14/2021, 7:10 AMSELECT FOR UPDATE statements ?Antoine Esteve
10/14/2021, 3:21 PMPaul T
10/14/2021, 10:27 PMprisma.model.findMany(...) ?Paul T
10/14/2021, 10:28 PMDanny Nemer
10/15/2021, 12:32 AMprisma generate say it is using a different version of Prisma Client than it has installed? Consequently, it wrongly warns about version mismatch. Thank you!Mischa
10/15/2021, 12:16 PMTero Kujala
10/19/2021, 1:14 PMUser and PhoneNumber . Phone number can be assigned to only one User. When creating new User I need to assign a phone number, which is coming in request, for created user. The request must fail if phone number is already in use and I also need to take into account possible concurrent requests. My problem is that how I can check that phone number is not already in use? Is the Interactive transactions only way to achieve this?