Error with tipe in InferInsertModel
Hello! I have a table visit with an optional field comment (it is not marked as notNull). However, when I use InferInsertModel to type the data for insertion, the comment field is not included.
4 Replies
That’s intended behavior
Since it’s a nullable field, you are allowed to not provide it in the insert, and the database will set it to null
Yes, but I can insert it right away; however, it's not in the types, so TypeScript is now complaining.
It is in the types, it's just optional. If you don't see it, you might need to set
strict: true
in your tsconfigThank you, I'll try