Yassine
04/17/2021, 5:11 PM@Metadata({
generate: true
})
model Product {
id String @id @default(cuid())
name String
}
I want to build a custom generator, that helps me generate crud services, and react components, based on my prisma schema, so i wonder if something like this, is possible.Benjamin
04/18/2021, 2:08 AMimport { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
const nodes = await prisma.node.createMany({
data: [
]
})
I'm using prisma client 2.21.2. And when I specify it as a preview feature in schema.prisma it just tells me not to.
The error I'm getting is Property 'createMany' does not exist on type 'NodeDelegate<RejectOnNotFound | RejectPerOperation | undefined>'
김폴빈
04/18/2021, 5:12 PMRigantona Mårtensson
04/18/2021, 10:03 PMJosé da Mata
04/19/2021, 5:24 PMtry {
prisma.$executeRaw("BEGIN")
code code code
code
prisma.$executeRaw("COMMIT")
} catch(e) {
prisma.$executeRaw("ROLLBACK")
throw e;
}
José da Mata
04/19/2021, 5:26 PMJosé da Mata
04/19/2021, 5:27 PMJosé da Mata
04/19/2021, 5:28 PMJosé da Mata
04/19/2021, 5:29 PMJosé da Mata
04/19/2021, 5:30 PMprisma.$transaction(() => {
code code code
code
});
José da Mata
04/19/2021, 5:30 PMEthan Zoller
04/20/2021, 3:06 AMJoey
04/20/2021, 5:25 PMnpx prisma db seed --preview-feature
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Running ts-node "prisma/seed.ts" ...
Failed to seed data, Error:
Invalid `prisma.product.upsert()` invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
Alfred S
04/20/2021, 9:12 PMMagnus
04/21/2021, 8:41 AMJohn McElreavey
04/21/2021, 5:06 PMYuukiKanasugi
04/22/2021, 1:43 AMNaresh
04/22/2021, 1:30 PMGeorge
04/22/2021, 2:28 PMkitze
04/22/2021, 3:56 PMvenky
04/22/2021, 5:09 PMPrisma
04/22/2021, 5:38 PMAlex Vilchis
04/22/2021, 6:59 PMmodel Customer {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Proposal Proposal[] // this relation field name was autocapitalized!
}
If this is normal, what is the reasoning behind it? 🤔sal
04/23/2021, 2:58 AMid
in data.id for type CommunityCreateInput.Manish Kumar
04/23/2021, 7:54 AMconst { SEDOL } = args;
// EventCD NOT IN ('DIV' , 'DRIP') and SEDOL = ? and PrimaryExchgCD = ExchgCD"
const whereCondition = {
SEDOL,
EventCD: {
not: {
in: ["DIV", "DRIP"],
},
},
};
Elvijs
04/23/2021, 9:05 AMprisma generate
and try to run it again.\nIf that does not solve your problem, please open an issue.` but I've installed all packages in prismaLayer and ran prisma generate. When all operation are being done manually on my machine everything deploys nicely.
Do any of you have experience working in this stack and may have any advice how could I resolve it?
Thanks in advance.
Happy Friday! 😉Mykyta Machekhin
04/23/2021, 12:31 PMOfer
04/23/2021, 12:37 PMmodel Product {
id Int @id @default(autoincrement())
cars Car[]
boats Boat[]
planes. Plane[]
}
model Car {
id Int @id @default(autoincrement())
product Product @relation(fields: [productId], references: [id])
productId Int
}
model Boat {
id Int @id @default(autoincrement())
product Product @relation(fields: [productId], references: [id])
productId Int
}
model Plane {
id Int @id @default(autoincrement())
product Product @relation(fields: [productId], references: [id])
productId Int
}
But it doesn’t feel intuitive to me.
Is this the correct way in this case?Sasi
04/23/2021, 12:52 PMsal
04/23/2021, 4:21 PMlet group = await prisma.group.upsert({
where: {
id: req.body.groupId
},
update: {
id: req.body.groupId
},
create: {
id: req.body.groupId,
groupMembers: {
create: {
role: "ADMIN"
}
}
}
})