user
09/13/2021, 10:57 AMYErii
09/13/2021, 10:58 AMXx_WhereInput_
XxWhereUniqueInput
Xx_OrderByInput_
… without using t.crud.xxs()
?YErii
09/13/2021, 11:00 AMMohammed Alrea
09/13/2021, 5:55 PMzayed islam
09/13/2021, 7:21 PMHarsha MV
09/14/2021, 2:01 AMproject
hasMany projectImages
when running a create how can we loop and connect n create those new records for projectImages
Harsha MV
09/14/2021, 2:02 AMYErii
09/14/2021, 3:13 AMXxOrderByInput
to XxOrderByWithRelationInput
?YuukiKanasugi
09/14/2021, 3:48 AMkailoon
09/14/2021, 7:39 AMnpx prisma studio
Prisma Studio is up on <http://localhost:5555>
warn(prisma-client) Already 10 Prisma Clients are actively running.
I did use the workaround
import { PrismaClient } from "@prisma/client"
const prisma = global.prisma || new PrismaClient()
if (process.env.NODE_ENV === "development") global.prisma = prisma
export default prisma
Is this normal? Or these are not related?kailoon
09/14/2021, 7:42 AMMaisnam Raju
09/14/2021, 9:10 AM1631610606
instead of the default datetime format ?Russell Ormes
09/14/2021, 9:11 AMlinux-musl
to my binaryTargets
in my schema. I added native (not sure if it is necessary) for the local build, on Ubuntu 18.04.
datasource db {
provider = "postgresql"
binaryTargets = ["native", "linux-musl"]
url = env("DATABASE_URL")
}
OK, so my assumption it that on running the client generation script, the binary should get downloaded into the output directory. The only engine binary that is copied to the output directory is libquery_engine-debian-openssl-1.1.x.so.node
which satisfies the native
option, but nothing for linux-musl
. Checking the directory node_modules/@prisma/engines/
I also see that only the *-debian-*
engines are present.
I guess my question is, how do I get the client generator to download the binaries required by the biaryTargets
array? Or is there something I am missing here?
I have searched here for a solution but no-one appears to have the same issue.Mischa
09/14/2021, 9:16 AMRene Nielsen
09/14/2021, 9:18 AMmodel Instructor {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
slug String @unique
}
const instructorSlug = slug(instructorInput.name);
await this._dbClient.instructor.create({
data: {
slug: instructorSlug,
}
}
Vladi Stevanovic
Mohammed Alrea
09/14/2021, 10:56 AMshadowDatabaseUrl
datasource attribute.
Read the docs page for more details: https://pris.ly/d/migrate-shadowPatrick
09/14/2021, 11:09 AMMohammed Alrea
09/14/2021, 11:15 AMDaniell
09/14/2021, 11:16 AMEric Kidd
09/14/2021, 12:57 PMFOREIGN KEY
constraints. But in practice, it's very hard to make them work.
Is there any way to use things like db pull
and Prisma joins without actually having FOREIGN KEY
constraints? For example, could db pull
be convinced to ignore manually-added relations? Or is this basically hopeless? Thank you for any advice you can provide!Harsha MV
09/14/2021, 1:27 PMBhavesh Gohel
09/14/2021, 1:38 PMHarsha MV
09/14/2021, 2:13 PM2021-09-14T14:11:16.473Z 7d2b4b8b-a60a-4d0e-9752-bd5a29000b57 ERROR PrismaClientValidationError: Unknown arg `views` in data.views for type ProjectUpdateInput. Did you mean `id`?
at Document.validate (/var/task/node_modules/@prisma/client/runtime/index.js:35604:19)
at PrismaClient._executeRequest (/var/task/node_modules/@prisma/client/runtime/index.js:37991:17)
at consumer (/var/task/node_modules/@prisma/client/runtime/index.js:37936:23)
at /var/task/node_modules/@prisma/client/runtime/index.js:37938:47
at AsyncResource.runInAsyncScope (async_hooks.js:197:9)
at PrismaClient._request (/var/task/node_modules/@prisma/client/runtime/index.js:37938:25)
at request (/var/task/node_modules/@prisma/client/runtime/index.js:38041:77)
at _callback (/var/task/node_modules/@prisma/client/runtime/index.js:38246:14)
at PrismaPromise.then (/var/task/node_modules/@prisma/client/runtime/index.js:38253:23) {
clientVersion: '3.0.2'
}
RequestId: 7d2b4b8b-a60a-4d0e-9752-bd5a29000b57 Error: Runtime exited with error: exit status 1
Runtime.ExitError
Harsha MV
09/14/2021, 2:13 PMawait prisma.project.update({
where: { id: project.id },
data: {
views: {
increment: 1,
},
},
});
Harsha MV
09/14/2021, 2:14 PMDaniel Sieradski
09/14/2021, 2:59 PMmessage": "\nInvalid `prisma.schedule.delete()` invocation:\n\n\n The change you are trying to make would violate the required relation 'ScheduleTotimeSlot' between the `Schedule` and `timeSlot` models.",
How do I get Prisma to understand Postgres is cascading on delete?Daniel Sieradski
09/14/2021, 3:01 PMHenry Wu
09/14/2021, 8:07 PMJonathan
09/14/2021, 8:57 PM