How to type the values that go into .update.set()
?
#1806
Unanswered
anthonyma94
asked this question in
Q&A
Replies: 1 comment
-
This would be the issue to follow #836. const params: Partial<typeof table.$inferInsert> = {
name: "hello",
invalid: "world"
}
// or
const params = {
name: "hello",
invalid: "world"
} satisfies Partial<typeof table.$inferInsert> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using
update.set()
to update values in a table, the types work great when putting the values directly intoset()
. If there are any keys that aren't supposed to be there, I get an error. However, this doesn't work when the values are created elsewhere and passed into the function. As long as there is at least 1 valid key, the values do not throw an error until runtime. What can I type the params with so that it throws an error at build time?Beta Was this translation helpful? Give feedback.
All reactions