Correct typing when using "columns" as param
Hello awesome people at Drizzle,
I'm having this problem and I don't know how to fix it. So...
I have this RoleManager service that has a method called
getByName
that can take in columns
.
The problem is that I can't seem to type this query in a nice way and what I've done doesn't tickle me the right way. xD
2 Replies
By "type this query the right way" I'm referring to the fact that if I don't use the return type that I've set up with Pick<> I don't get type narrowing through type inference based on the columns I'm providing to the method when calling it.
Further investigations 🕵🏻♂️:
findFirst()
is a generic, I've tried typing "columns" there, but I'm not that smart. No dice.Sorry for late response, just got a time to answer all the questions in Discord
Will bring up @bloberenober for help