5 Replies
2 possibilities.
- no types and let TypeScript inference do it
- await before return, then the type is just an object
If you want the type infered from
selectUserIncludingToken
, you can use some TypeScript utils: https://drizzle.run/hb9tdgrc9h53vh08dc6ahm2b
Drizzle Run
Infer return type - Drizzle Run
@Raphaël M (@rphlmr) ⚡ thannks for the response. unfortunately I can't use await because I'm writing statements that I can later use in various
db.batch
calls. So for now, I'll have to rely on Typescript inference, and turn off the eslint explicit return type rule. 😅Oh ok. Then it could be
I am on my mobile so 😅 maybe I am wrong
I ended up writing a utility to do this. I can't tell if this stupid or not:
update, it was stupid, just use
typeof myTable.$inferSelect