Jon Koops
DTDrizzle Team
•Created by Jon Koops on 6/8/2024 in #help
No type inference when specifying a reference.
Hmmm, upon closer inspection I need a seperate table to link both together, so perhaps what I am doing here is invalid.
5 replies
DTDrizzle Team
•Created by Jon Koops on 6/8/2024 in #help
No type inference when specifying a reference.
Logged an issue for this: https://github.com/drizzle-team/drizzle-orm/issues/2476
5 replies
DTDrizzle Team
•Created by Jon Koops on 6/8/2024 in #help
No type inference when specifying a reference.
I have a feeling this is a circular reference issue, as when I remove the
.references(() => invitations.id),
from invitationId
this all seems to work.5 replies
DTDrizzle Team
•Created by Jon Koops on 6/8/2024 in #help
No type inference when specifying a reference.
This is all fine, until I want to add a reference from
primary_guest_id
to the guest id
. If I change the following line:
to:
Now suddenly the ORM is no longer able to infer a TypeScript type (both invitations
and guests
are any
, and I get the following errors:
It seems however that Drizzle kit is able to create the SQL:
Why are my TypeScript types getting borked? How can this be fixed?5 replies