How to types and parsing with raw sql

So I'm having to fall back to raw sql for a slightly gnarly query I'm doing. What's the best way to make typescript happy, and get things like dates parsed properly? Do I want something like mapWith? That seems to only be for a single value..
4 Replies
johtso
johtsoOP4w ago
My query returns a few columns from another table untouched (including dates), and then some SUMed numbers and a couple of strings I guess I could just make the query a view..
Angelelz
Angelelz4w ago
All of that sounds like it should be done by drizzle
johtso
johtsoOP4w ago
If I make a view from my query then it feels like I stay on the drizzle happy path, and I can tell drizzle the types of all the columns like with a normal table would be nice if you could still do that without having to use a view
Angelelz
Angelelz4w ago
I think you can. What's the query that you want to type? Maybe include the parts that you haven't been able to use drizzle for
Want results from more Discord servers?
Add your server