No overload matches this call
When inserting data into an table inside a transaction I get this error: (see attached). When I then infer the model like this: (see attached) the error is gone. Any other idea, how to solve that correctly?
It seems to be wrong...


11 Replies
@B33fb0n3 can you share your
exclusiveItems
schema?yes:

this is the full error

what is the type of newMediaId?
it's a string
actually there is two error messages there, I think the first is the issue... you are using a string (varchar) as primary key.... are you supplying a value?
doesnt InferInserType use the types from the schema? 🤔
you mean because of "uuid"?
because you are not using serial (ie. autoincrement integer), but rather a string, yes you need to supply a value or a defaultFn
see https://orm.drizzle.team/docs/column-types/pg#default-value
https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-uuid/
ah ok got it. What type do I need to provide, if it's not a string?
you can use
serial
if you want an autoincrementing integer, or uuid
with .defaultRandom()
for a string uuidHm ok. I don’t want it to be a serial neither defaultRandom. I guess I will life with that „typeof“ then ðŸ«