JonnyP
Explore posts from serversDTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
@Andrew Sherman - so sorry for the tag.... I know a while back you mentioned to tag you in any threads that got missed when you were snowed under... This is one of those threads!
19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
Bump!...
19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
So just to be clear, all my Schema is flat normal database tables with relations and no JSON fields - I am just using either relational queries or jsonAgg to make the return from the database include nested elements.
So in terms of typescript I just want to be able to access them via indexes and keys... No need for specific jsonB queries etc.
Ie should be able to do
usersReturn[0].posts[0].comments[0].author_id
for example and have typescript be happy!19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
For reference I did bomb this old thread (https://discord.com/channels/1043890932593987624/1093581666666156043/1135127584477286530) with my queries too ... Moved here to try and be well behaved!
19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
So I started trying to create a jsonAgg function that could handle a subquery but the figuring out the rigth types to return stumped me and I couldn't find API's to help.
Is there an api or a method someone has created to handle sub queries like this ... basically looking for a
InferModel<SubQuery>
api!
Or if someone has an idea of how I should better go about this please fire away!19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
19 replies
DTDrizzle Team
•Created by JonnyP on 7/30/2023 in #help
Unwrap the return type of a Subquery, native jsonAgg support or RQ Join Names?
However, I quickly found I needed to start using sub queries to allow easy referencing of values at the top level and allow json nesting within nesting. However, this lead me to then need to use jsonAgg on a sub query and I got stuffed by types:
19 replies