Onkel Tem
02/18/2022, 12:39 PMOnkel Tem
02/18/2022, 12:39 PMOnkel Tem
02/18/2022, 12:43 PMmodel Inout {
id Int ...
name String
muxType ???
}
and I have this type definition for MuxType:
enum MuxType {
Sdi = <any> 'sdi',
Ts = <any> 'ts',
Essence = <any> 'essence'
}
(Btw, how to set proper language for the code block?)Onkel Tem
02/18/2022, 12:44 PMOnkel Tem
02/18/2022, 12:52 PMOnkel Tem
02/18/2022, 1:02 PMOnkel Tem
02/18/2022, 3:04 PMJacob Evans
02/18/2022, 3:41 PMzomars
02/18/2022, 4:39 PMDeepak Guptha S
02/18/2022, 5:29 PMSELECT * FROM table1
WHERE '2011-01-01' BETWEEN table1.startdate AND table1.enddate
How I can perform this operation in Prisma ?Volcanic Island
02/19/2022, 1:28 AMJames Carter
02/19/2022, 6:26 AM@@map
attribute to specify table name of a schema to connect to, but I cannot have two or more @@map
attributes in one schema (read table) definition. Any solution for this?per
02/19/2022, 8:00 AMsets
. But it can have 2 or 3 sets
depending on how the match went. So how do I create this? If I don’t provide a third set, the query fails. See the createMany
below:
const match = await prisma.match.create({
data: {
group: {
connect: {
id: groupId,
},
},
team1: {
connect: {
id: team1id,
},
},
team2: {
connect: {
id: team2id,
},
},
sets: {
createMany: {
data: [
{
setNumber: 1,
gamesTeam1: team1_set1,
gamesTeam2: team2_set1,
setWinnerId: set1Winner,
},
{
setNumber: 2,
gamesTeam1: team1_set2,
gamesTeam2: team2_set2,
setWinnerId: set2Winner,
},
{
setNumber: 3,
gamesTeam1: team1_set3,
gamesTeam2: team2_set3,
setWinnerId: set3Winner,
},
],
},
},
winner: {
connect: {
id: matchWinner,
},
},
date: '2022-01-18T08:56:38.152Z',
},
})
Onkel Tem
02/19/2022, 11:52 AMOnkel Tem
02/19/2022, 11:58 AMmodel Inout {
id Int @id @default(autoincrement())
name String
inoutConfigSdi InoutConfigSdi?
inoutConfigEth InoutConfigEth?
}
model InoutConfigSdi {
id Int @id @default(autoincrement())
portNumber String
inout Inout @relation(fields: [inoutId], references: [id])
inoutId Int @unique
}
model InoutConfigEth {
id Int @id @default(autoincrement())
address String
inout Inout @relation(fields: [inoutId], references: [id])
inoutId Int @unique
}
Here
inoutConfigSdi InoutConfigSdi?
inoutConfigEth InoutConfigEth?
look superfluous, as Input can have only ONE type of Config - either Sdi or Eth.
But I don't see any way to declare it.
Any ideas?Kasir Barati
02/20/2022, 11:09 AMfor string_1
in the @unique(map: 'string_1')
, Or it is just a simple string that is up to me to choice a meaningful string?
#2 Is the string_1
used to name the generated index for the field/s?Adrian
02/20/2022, 12:35 PMHussein
02/20/2022, 1:37 PMΓιώργος Κραχτόπουλος
02/20/2022, 3:55 PM@id
fields of type Int
, instead of only a number
a string
too?face boy
02/20/2022, 5:52 PMface boy
02/20/2022, 5:52 PMface boy
02/20/2022, 6:22 PMSardorkhuja Tukhtakhodjayev
02/20/2022, 8:28 PMHostelCreateInput
Jaye
02/20/2022, 8:38 PMjsonb
column. prisma doesn’t seem to support this, although postgres does, giving good results
is this coming any time soon? or, failing that, is there any way to add something like this to a .findMany
without rewriting all my queries in raw sql (since they’re already quite big and complex):
SELECT * FROM "Work"
WHERE to_tsvector(answers) @@ websearch_to_tsquery('my search phrase');
Fenris Play
02/21/2022, 9:29 AMKey columns "ownersIds" and "id" are of incompatible types: integer[] and integer.
Harrys Kavan
02/21/2022, 2:03 PMUserModel
and PostModel
. But how would that look for a relation query?Olyno
02/21/2022, 4:04 PMOlyno
02/21/2022, 4:05 PMAdrian
02/21/2022, 4:18 PMasync findUnique<T extends Prisma.UserArgs.include>(
where: Prisma.UserWhereUniqueInput,
include?: T
): Promise<Prisma.UserGetPayload<{ include: T }>> {
// TODO: Fetch user from Azure AD B2C
return this.prisma.user.findUnique({
where: where,
include: include ?? userWithRolesAndAvatarAndPosters.include,
// ...userWithRolesAndAvatarAndPosters,
})
}
Any idea of how to make the return type of my function dynamic based upon the include argument?Tommy Adeniyi
02/21/2022, 7:00 PMUnknown arg `access_token` in data.access_token for type AccountUncheckedCreateInput. Did you mean `accessToken`? Available args:
type AccountUncheckedCreateInput {
id?: Int
type: String
provider: String
providerAccountId: String
refreshToken?: String | Null
accessToken?: String | Null
expiresAt?: Int | Null
tokenType?: String | Null
scope?: String | Null
idToken?: String | Null
sessionState?: String | Null
oauthTokenSecret?: String | Null
oauthToken?: String | Null
userId: Int
}
Unknown arg `expires_at` in data.expires_at for type AccountUncheckedCreateInput. Did you mean `expiresAt`? Available args:
type AccountUncheckedCreateInput {
id?: Int
type: String
provider: String
providerAccountId: String
refreshToken?: String | Null
accessToken?: String | Null
expiresAt?: Int | Null
tokenType?: String | Null
scope?: String | Null
idToken?: String | Null
sessionState?: String | Null
oauthTokenSecret?: String | Null
oauthToken?: String | Null
userId: Int
}
Unknown arg `token_type` in data.token_type for type AccountUncheckedCreateInput. Did you mean `tokenType`? Available args:
type AccountUncheckedCreateInput {
id?: Int
type: String
provider: String
providerAccountId: String
refreshToken?: String | Null
accessToken?: String | Null
expiresAt?: Int | Null
tokenType?: String | Null
scope?: String | Null
idToken?: String | Null
sessionState?: String | Null
oauthTokenSecret?: String | Null
oauthToken?: String | Null
userId: Int
}
Unknown arg `id_token` in data.id_token for type AccountUncheckedCreateInput. Did you mean `idToken`? Available args:
type AccountUncheckedCreateInput {
id?: Int
type: String
provider: String
providerAccountId: String
refreshToken?: String | Null
accessToken?: String | Null
expiresAt?: Int | Null
tokenType?: String | Null
scope?: String | Null
idToken?: String | Null
sessionState?: String | Null
oauthTokenSecret?: String | Null
oauthToken?: String | Null
userId: Int
}
{
message: '\n' +
'Invalid `p.account.create()` invocation in\n' +