William GM
12/16/2021, 4:55 AMSET LOCAL some_key = value;
on my transactions but I alway get an error, from what I saw on github issues, this is supported but for some reason is not working with me, using prisma 3.6
.
this.prismaService.$executeRaw`set local "app.current_tenant" = ${tenant.id};`
The error I get is
Raw query failed. Code: `42601`. Message: `db error: ERROR: syntax error at or near "$1"`
Dexter Marks-Barber
12/16/2021, 10:10 AMupdate
calls. Any ideas what might be going on?
https://github.com/prisma/prisma/discussions/10720
Cheers!Nischal
12/16/2021, 1:34 PMNischal
12/16/2021, 1:34 PMuser
12/16/2021, 2:18 PMSecre
12/16/2021, 2:27 PMDaniel
12/16/2021, 5:34 PMCharles Dimino
12/16/2021, 6:07 PMJin
12/16/2021, 6:31 PMlawjolla
12/16/2021, 7:14 PMJin
12/16/2021, 7:44 PMAdam Garcia
12/16/2021, 7:57 PMDrew Rawitz
12/16/2021, 7:58 PM{ in: […ids] }
is there a way to have them returned in the same exact order that I passed them in?Cymak
12/16/2021, 8:40 PMAdrian Duyzer
12/16/2021, 9:07 PMlttv Float?
But when I try to create an item with this field absent or set to null, I get the following error:
→ 124 const rate = await prisma.rate.create(
Failed to validate the query: `Unable to match input value to any allowed input type for the field. Parse errors: [Query parsing/validation error at `Mutation.createOneRate.data.RateCreateInput.lttv`: A value is required but not set., Query parsing/validation error at `Mutation.createOneRate.data.RateUncheckedCreateInput.lttv`: A value is required but not set.]` at `Mutation.createOneRate.data`
at cb (/Users/adrianduyzer/Mesa/www/transervice/bot/node_modules/@prisma/client/runtime/index.js:38683:17) {
code: 'P2009',
clientVersion: '3.6.0',
meta: {
query_validation_error: 'Unable to match input value to any allowed input type for the field. Parse errors: [Query parsing/validation error at `Mutation.createOneRate.data.RateCreateInput.lttv`: A value is required but not set., Query parsing/validation error at `Mutation.createOneRate.data.RateUncheckedCreateInput.lttv`: A value is required but not set.]',
query_position: 'Mutation.createOneRate.data'
}
}
I’ve tried regenerating the schema, regenerating the client, etc., to no avail. Any tips for me on this?Philipp Minder
12/16/2021, 9:58 PMJin
12/16/2021, 10:04 PMPhilipp Minder
12/16/2021, 10:16 PMGiorgio Delgado
12/16/2021, 11:04 PMnpm run migrate dev
… the prisma cli ended up creating a pretty confusing / alarming migration.
Why is prisma trying to rename existing foreign key and index identifiers?
The model we created literally only had two columns so we were expecting a tiny CREATE TABLE
migrationMartí Crespí
12/17/2021, 9:08 AMPhilipp Minder
12/17/2021, 9:37 AMuser
12/17/2021, 11:10 AMPhilipp Minder
12/17/2021, 12:06 PMAhmet
12/17/2021, 12:42 PMmodel accesstoken {
id Int @id @default(autoincrement())
token String
isactive Boolean
createdat DateTime @default(now())
updatedat DateTime @updatedAt
instancesworkers instancesworker[]
}
model instanceworker {
id String @id
name String
comment String?
expiredate DateTime
createdat DateTime @default(now())
updatedat DateTime @updatedAt
webhookid Int
userid String
accesstokenid Int
accesstoken accesstoken
}
Error: Schema parsing
error: Type "instancesworker" is neither a built-in type, nor refers to another model, custom type, or enum.
--> schema.prisma:43
|
42 | updatedat DateTime @updatedAt
43 | instancesworkers instancesworker[]
|
Ahmet
12/17/2021, 12:43 PMAhmet
12/17/2021, 12:44 PMsramam
12/17/2021, 1:44 PMDexter Marks-Barber
12/17/2021, 3:55 PMJason Kleinberg
12/17/2021, 4:22 PMrequestId
of the request that spawned the query.Tyler Clendenin
12/17/2021, 6:03 PMinclude
statement's records will include any other related records that already existed.