K
Kysely•15mo ago
sirhype

Types for use with leftJoin

Hiya! I'm attempting to do a leftJoin and return the result:
const result = await db
.selectFrom("accounts")
.leftJoin("applications", "accounts.id", "applications.accountId")
.where("accounts.sessionId", "=", sessionId)
.executeTakeFirst();
const result = await db
.selectFrom("accounts")
.leftJoin("applications", "accounts.id", "applications.accountId")
.where("accounts.sessionId", "=", sessionId)
.executeTakeFirst();
I'd like to have the result be a type, like Selectable<Account & Application> but I'm not sure if this is supported or what the proper way to do this is. Any help would be appreciated, thank you!
2 Replies
Unknown User
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
sirhype
sirhype•15mo ago
Thanks! I ended up figuring out the answer to my question, sorry, forgot to follow up here 🙂 I really appreciate the help!