Alban Kaperi
05/17/2022, 1:31 PMAlban Kaperi
05/17/2022, 1:33 PMType 'Name' is not assignable to type 'string'.
Jason Kleinberg
05/17/2022, 2:12 PMJulien Demarque
05/17/2022, 2:39 PMmodel BaseVariable {
options String[]
}
What is odd is that prisma.baseVariable.create doesn't require me to fill the options argument, so I got baseVariables with options set to null in my postgresdb.
But! if I try to assign null to options in prisma.baseVariable.create I get a type error.Danilo Cadena
05/17/2022, 2:48 PMJason Kleinberg
05/17/2022, 2:57 PM$disconnect
, but reconnecting takes a long time in tests (and takes longer as we go along for some reason).Dhwanik Panchal
05/17/2022, 4:38 PMMattia Romeo
05/17/2022, 6:47 PMBriggs
05/17/2022, 9:42 PMconst result = await prisma.user.create({
data: {
email: '<mailto:abc@123.com|abc@123.com>',
firstName: 'abc',
lastName: 'xyz',
type: UserType.OWNER,
},
context: blah,
});
context could be of any type so we could then pick that up in the middleware
export async function PubSubMiddleWare(
params: Prisma.MiddlewareParams,
next: (params: Prisma.MiddlewareParams) => Promise<any>
) {
const { action, model, args } = params;
const { context } = args;
pubsub
.publish(`${params.model}_changed`, {
mutation: action,
model,
node: result,
context
})
}
Pieter
05/17/2022, 10:47 PMdaemon
05/18/2022, 2:46 AMbash
script to run npx prisma migrate deploy
and afterwards start the node process? I think there is some waiting involved right? Trying to dockerize the app so I can run it in awsdaemon
05/18/2022, 2:53 AMlax
05/18/2022, 4:08 AMlax
05/18/2022, 4:09 AMChris Tsongas
05/18/2022, 5:06 AMDenis Goncharenko
05/18/2022, 5:12 AMDavedavedave
05/18/2022, 11:20 AMdescribe("UserService", () => {
let connection: Connection
beforeAll(async (done) => {
connection = await useRefreshDatabase({ connection: 'memory' })
await useSeeding()
const user = await factory(User)().make()
const createdUser = await factory(User)().create()
await runSeeder(CreateUserSeed)
done()
})
afterAll(async (done) => {
await tearDownDatabase()
done()
})
test('Should ...', () => { ... })
})
Can anybody chime inShivam Singh
05/18/2022, 1:10 PMawait this.prismaService.person.update({
where: {
id,
},
data: {
name,
configuration: {
update: configuration,
},
address,
age,
}
})
Now name
, address
and age
comes from request body and might be empty. I want to update these properties only if they are not empty. Is there a way to do so?Michael Roberts
05/18/2022, 1:28 PMRichard Kaufman-López
05/18/2022, 1:36 PMMichael Roberts
05/18/2022, 2:05 PMJonas Schultheiss
05/18/2022, 2:56 PMdriverId
)". Do you know how i could approach this error?Aaron Waller
05/18/2022, 3:23 PMprisma.posts.count();
I can get the Table size, and with Math.random()
I generated 10 random int values.
How can I now query my database and get 10 random posts?Joshua Snyder
05/18/2022, 6:49 PMset:[]
for a related record in a prisma.update()
call where that related record has cascading deletes, delete the disconnected records?Michael Roberts
05/18/2022, 7:19 PMMichael Roberts
05/18/2022, 7:35 PMMichael Roberts
05/18/2022, 7:36 PMMichael Roberts
05/18/2022, 7:36 PMMichael Roberts
05/18/2022, 7:36 PMPeter Belbin
05/18/2022, 8:48 PMupsert
functionality? I have a simple loop iterating through a list of records that should be created (if not found) or simply retrieved (ie: update: {} // no change ), and the records do exist that are being upserted. First item in the list works as it should, but 2nd item is not. The record exists in the db, but I'm getting Error: Query upsertOneUser is required to return data, but found no record(s).
(the entity object is 'User'). Prisma 3.14.0 is being used. Worked fine with 3.12.0.