Getting types for update query
Similar to $inferInsert, is there a $inferUpdate to get types while performing a db.update()
7 Replies
You can use
$inferInsert
for updates.Sorry for the late reply but yeah I was using it but then, if you don't have the values that are
not nullable
, lsp starts complaining.That's expected behavior. If the value is not nullable you need to provide it
Yeah but when you're trying to update, it's not necessary right
You're right, in that case I would suggest the
Partial
utility type.Solution
Like
Partial<typeof users.$inferInsert>
Alright thanks I'll give it a shot!
Yup it worked !