Paul
07/22/2021, 9:09 AMconst query = db.$executeRaw(
`
update DamFile
set deletedAt = ?
where id in (?)
`,
DateTime.utc().toString(),
ids.join(",")
)
const result = await db.$transaction([query])
console.log(result)
Can anyone catch what I am doing wrong? ThanksRyan
07/22/2021, 10:01 AMjoin
as shown here. This can be imported from:
import { Prisma } from '@prisma/client';
Prisma.join
Paul
07/22/2021, 10:09 AMPaul
07/22/2021, 10:15 AMPaul
07/22/2021, 10:16 AM[
'01FB6VB2G907FMJ91P88VXGA4S',
'01FB6VB4XWA2YKJWVZ7KADQF56',
'01FB6VB6W349W5SHTNSE39674X',
'01FB6VB95R8QB2SXAX87GVC7KY',
'01FB6VBAYKAYG0Y80DKJ4SQXQN'
]
[ 0 ]
Paul
07/22/2021, 10:17 AMRyan
07/22/2021, 10:23 AMBytes
?Paul
07/22/2021, 10:24 AMPaul
07/22/2021, 10:25 AMdb.damFile.updateMany({
data: {
deletedAt: DateTime.utc().toString(),
},
where: {
id: {
in: ids.join(",")
}
},
})
Paul
07/22/2021, 10:26 AMRyan
07/22/2021, 10:39 AMPaul
07/22/2021, 10:46 AMPaul
07/22/2021, 1:44 PMRyan
07/22/2021, 2:33 PMBuffer
.Paul
07/22/2021, 2:35 PMconst query = this.prisma.damFile.create({
data: {
id: Buffer.from(data.fileId),
userId: Buffer.from(data.userId),
parentId: Buffer.from(data.parentId),
typeId: Buffer.from(data.fileTypeId),
mimeId: Buffer.from(data.mimeId),
name: data.filename,
filename: data.filename,
filesize: data.size,
extension: data.extension,
md5: data.tempFileMd5,
filterType: data.fileType,
},
select: { id: true },
});
const result = await this.prisma.$transaction([query]);
Paul
07/22/2021, 2:36 PMmodel DamFile {
id Bytes @id @db.Binary(26)
parentId Bytes? @db.Binary(26)
createdAt DateTime @default(now())
Ryan
07/22/2021, 2:42 PMPaul
07/22/2021, 3:09 PMPaul
07/22/2021, 3:10 PMPaul
07/22/2021, 3:10 PMPaul
07/23/2021, 8:12 AMRyan
07/23/2021, 10:39 AM