James L
05/03/2022, 10:26 AMconst account = await prisma.user.findFirst({
where: {
_reqId: 'example-here',
id: 1,
},
});
then
const reqIdMiddleware = async (params, next) => {
if (params?.args?.where['_reqId']) {
console.log('_reqId was found!', params.args.where['_reqId']);
delete params.args.where['_reqId'];
}
return next(params)
};
prisma.$use(reqIdMiddleware);
James L
05/03/2022, 10:26 AMJames L
05/03/2022, 10:27 AMcontext
object on the query methods would be really useful, though.Ben Ezard
05/03/2022, 11:36 AMJames L
05/03/2022, 11:37 AMThere aren't any clean alternatives😮
James L
05/03/2022, 11:37 AMmikkelsl
05/03/2022, 4:46 PMKevin McKernan
05/03/2022, 11:11 PMHarry
05/05/2022, 1:20 PMRavi Shankar
05/06/2022, 10:16 AMerror
. can someone help me out in thisNeil Oliver
05/09/2022, 9:29 PM$queryRaw
(Prisma Client 3.13.0) with SQLite.
SELECT value FROM generate_series(5,100,5)
. (This is just an example from the SQLite docs).
Unfortunately I am getting the error no such table: generate_series
.
Any input would be appreciated.Kevin McKernan
05/10/2022, 1:30 AMMichael
05/10/2022, 5:36 AMJohan LAJILI
05/11/2022, 4:06 PMmodel House {
id String @default(cuid()) @id
windows: Window[]
}
model Window {
house House @relation(fields: [houseId], references: [id])
houseId: String
}
Is the order of the windows array meaningful? I need the user to be able to create a window in the middle of the list. I've tried to use set or connect, specifying in there an array where I've put the window in the correct place in JavaScript. It succeeds, but the order does not seem to change, the new window is added at the end.
I can of course add a property index to sortBy in the cards, but that mean that whenever I reorder windows I need to update the index of many windows instead of updating one array, so I would rather avoid it.
(I'm using Postgres if that's relevant)
ThanksAndrew Leung
05/11/2022, 4:53 PM<https://binaries.prisma.sh>
will hang until an ETIMEDOUT
error during a yarn install
My options are limited, and in parallel trying to figure out the network security on the jenkins env to figure out how to get past this issue, but in the meantime, I’m trying to understand how I can work around this by using Engine environment variables.Martin Pinnau
05/12/2022, 8:17 AMtype Email @db(name: "emails") {
id: ID! @id
name: String @unique
emailMessage: EmailMessage
emailSubject: EmailSubject
receiverGroup: [Receiver]
isActivated: Boolean! @default(value: true)
role: String
btnName: String
}
type EmailMessage @embedded {
id: ID! @id
messageDe: String
messageEn: String
}
type EmailSubject @embedded {
id: ID! @id
subjectDe: String
subjectEn: String
}
type Receiver @embedded {
id: ID! @id
email: String!
firstName: String
lastName: String
}
This is working perfectly fine with prisma1 (prisma-client-lib 1.34.5).
Due to restrictions by nexus-plugin-prisma I'm bound to prisma version 2.23.0 regarding upgrade.
With this version I can't use the model as it is, I have to add relation keys to all models (formerly types) listed.
Prisma1 seems to be able to handle this internally without secondary keys.
How can I achieve this with prisma2 and mongodb ?Martin Pinnau
05/12/2022, 10:12 AMtype EmailMessage { .... error: Model declarations have to be indicated with the `model` keyword`
my schema:
model Email {
id String @id @map("_id") @db.ObjectId
name String @unique
emailMessage EmailMessage
emailSubject EmailSubject
receiverGroup Receiver[]
isActivated Boolean @default(value: true)
role String
btnName String
}
type EmailMessage {
id String
messageDe String
messageEn String
}
type EmailSubject {
id String
subjectDe String
subjectEn String
}
type Receiver {
id String
email String
firstName String
lastName String
}
What am I doing wrong regarding these embedded documents ?
Is there support for embedded document lists but not for embedded documents ?auser
05/12/2022, 8:07 PMJohan LAJILI
05/13/2022, 8:26 AMAnderson da Silva
05/15/2022, 10:13 PMError: Query engine library for current platform "darwin" could not be found.
You incorrectly pinned it to darwin
This probably happens, because you built Prisma Client on a different platform.
(Prisma Client looked in "path_to_project/.webpack/service/libquery_engine-darwin.dylib.node")
this is my schema.prisma file config
generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Already tried other binaryTarges, adding bynary target path from my node_modules, nothing worked so far….iki
05/16/2022, 9:09 AMQuery interpretation error [2016]
, there's no event emitted for logging, the error is just thrown and logged later by Apollo Client, but without any important details like the failing query.
clientVersion: "2.21.2"
code: "P2016"
meta: {
details: "Error for binding '1': AssertionError("Expected a valid parent ID to be present for nested update to-one case.")"
}
stack: "Error: Query interpretation error. Error for binding '1': AssertionError("Expected a valid parent ID to be present for nested update to-one case.")
at cb (/usr/src/api2/node_modules/@prisma/client/runtime/index.js:34780:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)"
Martin Pinnau
05/16/2022, 3:02 PMargs: {
buttonName: stringArg({ required: false }),
},
this doesn't work anymoreMartin Pinnau
05/16/2022, 3:04 PMstringArg({ list: [false] }),
Nico Domino
05/21/2022, 11:32 AMimage String? @db.Text
Nico Domino
05/21/2022, 11:33 AMprisma.bookmark.update({
where: id,
data: {
image: imageBase64
}
})
Nico Domino
05/21/2022, 11:33 AMNico Domino
05/21/2022, 11:34 AMimage
key in it. Yet prisma is saying the desc
column isn't long enough for some reason?Kevin Lin
05/22/2022, 3:27 AMts
import { PrismaClient } from '@prisma/client'
export { PrismaClient as DendronClient }
Kevin Lin
05/22/2022, 3:27 AMBen Ezard
05/23/2022, 1:42 PMSELECT * FROM "Conversation" ORDER BY (SELECT "createdAt" FROM "Message" WHERE "conversationId" = "Conversation".id ORDER BY "createdAt" DESC LIMIT 1) LIMIT 10;