Gautam Paranjape
07/07/2021, 10:12 PMHalvor
07/07/2021, 10:22 PMMukesh Kumar
07/07/2021, 10:40 PMMukesh Kumar
07/07/2021, 10:55 PM// Sequelize
Product.findAll({
group: ['date', Sequelize.json(`type.warranty`)],
attributes: [
'date',
[Sequelize.json(`type.warranty`), 'warranty'],
[Sequelize.fn('sum', Sequelizer.col('cost')), 'price ']
],
})
How do I Grouping by JSON field?Halvor
07/07/2021, 11:53 PMHalvor
07/07/2021, 11:53 PMSoumitra Shewale
07/08/2021, 6:23 AMVACUUM
to reduce disk usage? If yes, how?jignesh karamchandani
07/08/2021, 7:14 AMArun Kumar
07/08/2021, 8:14 AMmanuel
07/08/2021, 8:40 AMMykyta Machekhin
07/08/2021, 8:45 AMTimo
07/08/2021, 10:30 AMtag: String?
to tags: String[]
(changing name + type) how can I make sure that the data is being converted instead of deleted/dropped?user
07/08/2021, 3:20 PMArda Ilgaz
07/08/2021, 4:03 PMAriel Flesler
07/08/2021, 6:53 PMimport { PrismaClient } from '@prisma/client'
taking a whooping 6 seconds. Is this something you plan to optimize? anything I could do about it? It's a new project with just 8 tables/models at the moment.Gautam Paranjape
07/08/2021, 7:05 PMZestian
07/08/2021, 8:19 PMjasci
07/08/2021, 8:24 PMinput UserUpdateInput {
firstName: String
lastName: String
shippingAddress: AddressInput
phone: String
}
And this mutation:
updateUser(where: UserWhereUniqueInput!, data: UserUpdateInput!): User!
If I run this mutation and provide only firstName
and phone
for example. I can see that in my resolver I have args object with 2 properties that I have provided (only firstName
and phone
).
The question is that I’ve seen implementations that use *setNull
fields, like:
input UserUpdateInput {
firstName: String
lastName: String
shippingAddress: AddressInput
shippingAddress_setNull: Boolean
phone: String
phone_setNull: Boolean
}
I’m told that the reason is that by default the fields that are optional and not provided are set to null
but I don’t see that.
And it’s used to distinguish if a user really wants to set the field as null
or just hasn’t provided a value.
But in my case I don’t see not provided values to be set null
. Can you please help to understand what is the proper way to implement that?
Thank you.
P.S. API with Apollo Server.Ba Thien Tran
07/08/2021, 9:14 PMHalvor
07/08/2021, 11:12 PMmodel match {
id Int @id @default(autoincrement())
session_id BigInt @unique
arbitrated arbitrated?
}
model arbitrated {
id Int @id @default(autoincrement())
match match @relation(fields: [matchId], references: [id])
matchId Int
arbitrated_session_id BigInt @unique
}
Halvor
07/08/2021, 11:14 PMconst match = await prisma.match.findUnique({
where: {
session_id: 1234
}
});
const arbitrated = await prisma.arbitrated.create({
data: {
match: {
connect: {
id: match.id
}
},
arbitrated_session_id: 5678
}
});
Brendan Berman
07/08/2021, 11:41 PMQuery engine binary for current platform "linux-arm-openssl-1.1.x" could not be found.
Would really appreciate any help debugging this! I’ll drop more details into a 🧵prisma chobo
07/09/2021, 4:08 AMclass MyUserCustomRepo extends PrismaClient<User> {
customMethod() {
// implement the function
}
}
Code With Waleed
07/09/2021, 8:18 AMNivedita Singh
07/09/2021, 11:01 AMAngelo
07/09/2021, 11:16 AMconst application = await prisma.application.findFirst({
where: {
id: applicationId,
tasks: {
array_contains: [{ keyName: taskKeyName }],
},
},
});
basically I want to filter inside the JSON tasks
field (which is an array) for a value inside keyName
but I keep array_contains
is unknown, I've tried to use equals
but I assume that only returns data if all the array key value matches.
I am a bit lost and I'm not sure why it doesn't work 😞Patrick
07/09/2021, 1:51 PMNikita Mavrychev
07/09/2021, 2:15 PMnpx prisma migrate dev --name name-migration
like in docs https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate#create-migrations
field applied_steps_count
in table _prisma_migrations
equals Null
insted of 1. How can I fix it?Ba Thien Tran
07/09/2021, 4:25 PMJ Giri
07/09/2021, 9:07 PM"@types/node": "^16.3.0"
. It was working fine until day before yesterday with the version ``"@types/node": "^15.x.x"``.
This is from the doc
import { PrismaClient } from "@prisma/client";
// add prisma to the NodeJS global type
interface CustomNodeJsGlobal extends NodeJS.Global {
prisma: PrismaClient;
}
// Prevent multiple instances of Prisma Client in development
declare const global: CustomNodeJsGlobal;
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV === "development") global.prisma = prisma;
export default prisma;
I'm getting this error
error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
4 interface CustomNodeJsGlobal extends NodeJS.Global
What could i do to make it work with latest version of @types/node
?