InferSelectModel vs. InferInsertModel
I couldn’t find any documentation on what the differences are. My best guess is maybe the insert type might not require auto incremented primary keys and other generated fields since you don’t have them on insert?
6 Replies
Correct
hello, i'm new here and i have a question about this. My column is
id: smallserial("id").primaryKey()
but when i use $inferInsert, i do have the id field, which of course i don't have when inserting. I'm i missing something in my table definition?It should be
number | undefined
. So you can just not provide itit's not, it's just
number
That's not supposed to happen. Can you put together a small repro repo?
i just found this https://github.com/drizzle-team/drizzle-orm/issues/663. I was able to solve my problem by changing smallserial to serial
GitHub
Issues · drizzle-team/drizzle-orm
TypeScript ORM that feels like writing SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.