You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you go to line 6 of drizzle/test.ts and try to get autocomplete in the with property, you don't get any inference.
To get inference back, comment out lines 152 to 156 of drizzle/schema-test.ts.
Head back to line 6 of drizzle.test.ts and ask for autocomplete again. Boom, inference.
For extra confirmation, you'll also see the same behavior if you comment out lines 147 to 151 of drizzle/schema-test.ts instead of lines 152 to 156.
Disclaimers:
I haven't investigated to see if there are other related edge cases where inference can get dropped. For instance, I didn't check to see if the same thing happens with several one-to-ones or several one-to-manys.
I'm figuring this is a TS inference bug rather than a SQL limitation?
Thanks for taking a look Drizzlers. 🙏 Let me know if there's anything else I can do to provide context.
Expected behavior
Those sweet, sweet inferred types.
Environment & setup
Earth, I guess?
The text was updated successfully, but these errors were encountered:
I'm not sure if this was a problem initially or stackblits didn't work properly, but I just tested this in the Typescript playground and it worked properly.
What version of
drizzle-orm
are you using?0.26.5
What version of
drizzle-kit
are you using?i hate drizzle-kit so N/A /s
Describe the Bug
Here's a Stackblitz!: https://stackblitz.com/edit/stackblitz-starters-5s6m8c?file=drizzle%2Ftest.ts
To reproduce:
drizzle/test.ts
and try to get autocomplete in thewith
property, you don't get any inference.drizzle/schema-test.ts
.drizzle.test.ts
and ask for autocomplete again. Boom, inference.For extra confirmation, you'll also see the same behavior if you comment out lines 147 to 151 of
drizzle/schema-test.ts
instead of lines 152 to 156.Disclaimers:
Thanks for taking a look Drizzlers. 🙏 Let me know if there's anything else I can do to provide context.
Expected behavior
Those sweet, sweet inferred types.
Environment & setup
Earth, I guess?
The text was updated successfully, but these errors were encountered: