K
Kysely17mo 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 User17mo ago
Message Not Public
Sign In & Join Server To View
sirhype
sirhype17mo ago
Thanks! I ended up figuring out the answer to my question, sorry, forgot to follow up here 🙂 I really appreciate the help!