Nested SQL select returning [x: string]: unknown type

This may also be delving into SQL-specific questions, but I have a complex query where I'm joining ten tables and at points, the select object is nested three deep. (I'm fairly intermediate to SQL so if I'm thinking about this wrong, please tell me). I can get the query pretty close using the query builder syntax but I have to do some specific where/orderby selects that throw errors for some reason. No problem, I rewrite it in the db.select() syntax and it is now correctly returning data. However, the return type is just: { [x: string]: unknown; }[] Which is obviously useless for trying to use that data in my application. Not sure what I'm doing wrong here, so any help is appreciated!
1 Reply
John
John3mo ago
Ah, I just made one of my queries nested only two deep and the types are working again. I guess this is where I go into SQL specific questions now. Is it ok to just split all of these up into smaller queries? Is there a way to send all of them together to the database as one request? Or do I not need to worry about that?