xer
xer
DTDrizzle Team
Created by xer on 11/18/2023 in #help
Incorrect typing with joins on CRUD and RQB API
I'm losing typing whenever I'm using joins on CRUD api, getting [x: string]: never whereas it's typed when I'm not using joins. Same with the RQB API, joining something such as User with Posts returns User as the type... For both cases, the correct data returns in the route; since I'm using OpenAPI & RPC I'm trying to figure out how to type this correctly.. I'm using classes for each respective category, such as Posts & User, I'm passing in the drizzle instance in each one like so:
const orm = drizzle(connection, {
schema,
})

return { connection, orm }
const orm = drizzle(connection, {
schema,
})

return { connection, orm }
&
export type ORMInstance = ReturnType<typeof getDB>["orm"]
export type ORMInstance = ReturnType<typeof getDB>["orm"]
I have a feeling it's probably something super simple I'm doing wrong, but I'm still pretty new to ORMs & Typescript (Rust Background) 😅 and would appreciate some guidance here
1 replies