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.
No description
No description
4 Replies
Angelelz
Angelelz2w ago
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
chepracio
chepracioOP2w ago
Yes, but I can insert it right away; however, it's not in the types, so TypeScript is now complaining.
Angelelz
Angelelz2w ago
It is in the types, it's just optional. If you don't see it, you might need to set strict: true in your tsconfig
chepracio
chepracioOP2w ago
Thank you, I'll try
Want results from more Discord servers?
Add your server