MrDell
07/11/2022, 4:11 PMEdun omatseye
07/11/2022, 4:22 PMEdun omatseye
07/11/2022, 4:22 PMEdun omatseye
07/11/2022, 4:23 PMawait prisma.player.create({
data: {
region: region,
timezone: REGION[region][country]["timezone"],
country: country,
}
}),
MrDell
07/11/2022, 4:24 PMMrDell
07/11/2022, 4:24 PMEdun omatseye
07/11/2022, 4:25 PMMrDell
07/11/2022, 4:25 PMEdun omatseye
07/11/2022, 4:25 PMMrDell
07/11/2022, 4:26 PMLars Ivar Igesund
07/11/2022, 4:28 PMEdun omatseye
07/11/2022, 4:28 PMMichael Jay
07/11/2022, 4:28 PMEdun omatseye
07/11/2022, 4:29 PMmodel Player {
id Int @id
createdAt DateTime? @default(now())
region String
country String
timezone String
Tournaments Tournament[]
}
MrDell
07/11/2022, 4:29 PMMrDell
07/11/2022, 4:30 PMEdun omatseye
07/11/2022, 4:31 PMBigInt
fields are represented by the `BigInt` type (Node.js 10.4.0+ required). The following example demonstrates how to use the BigInt
type:
import { PrismaClient, Prisma } from '@prisma/client'
const newTypes = await prisma.sample.create({
data: {
revenue: BigInt(534543543534),
},
})
MrDell
07/11/2022, 4:33 PMMrDell
07/11/2022, 4:39 PMMrDell
07/11/2022, 4:40 PMHarsh Singh
07/11/2022, 8:43 PMZichen
07/11/2022, 8:58 PM18:00:54 Environment variables loaded from .env
18:00:54 Prisma schema loaded from prisma/schema.prisma
18:00:55 thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
18:00:55 left: `22`,
18:00:55 right: `0`', library/std/src/sys/unix/locks/pthread_condvar.rs:63:9
18:00:55 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
18:00:55 fatal runtime error: failed to initiate panic, error 5
Zichen
07/11/2022, 8:58 PMViktor Suchý
07/12/2022, 5:46 AMViktor Suchý
07/12/2022, 5:48 AMsuraj sunny
07/12/2022, 2:02 PMSatont
07/12/2022, 9:51 PM[{ id: '123', name: 'first'}]
, i wan't to find channels where command with name
second
not exists, but not others channels.
model Channel {
id String @id
commands Command[]
@@map("channels")
}
model Command {
id String @id @default(dbgenerated("gen_random_uuid()"))
name String
channelId String
channel Channel @relation(fields: [channelId], references: [id])
@@map("channels_commands")
}
Jared Fraser
07/13/2022, 6:00 AMstring
in the DB but have constraints placed on the field at the DB level to restrict the values to a set (just like an enum).
In previous versions of Prisma, we defined these in our schema as an enum
and all was well, it worked perfectly.
However in trying to upgrade to Prisma 4, we've started to get the error
meta: {
code: 'XXUUU',
message: 'db error: ERROR: cannot create enum of unspecified type'
},
Which I'm assuming is that Prisma no longer knows how to cast the string db value to the enum defined in the schema.
Any tips for how to progress? Any way to define a string value in prisma with a set of possible string values?Martí Crespí
07/13/2022, 6:51 AMgraphql-scalars
package and I'm using like this
@Field(() => GraphQLScalars.BigIntResolver, {
nullable: true
})
lte?: bigint | undefined;
But when it's not null I recieved an error
"message": "Do not know how to serialize a BigInt"
Any approach to fix it or how serialize it properly?spohl
07/13/2022, 12:39 PM