Alias join doesn't seem to work

I have a simple alias:
const parent = aliasedTable(contact, "parent")

let res = await db.select().from(policy).leftJoin(parent, eq(parent.id, policy.parent_id))
const parent = aliasedTable(contact, "parent")

let res = await db.select().from(policy).leftJoin(parent, eq(parent.id, policy.parent_id))
the query code works fine, but I cannot access the aliased name in the res. it is still inferring as contact , but the docs show it inferring as parent in the res.
3 Replies
Angelelz
Angelelz3mo ago
can you share your tsconfig.json?
copypaper
copypaper4w ago
did you figure this out? havging the same issue turns out the docs were wrong, just use alias instead
copypaper
copypaper4w ago
GitHub
[BUG]: Aliasing the same table twice and then inner joining one whi...
What version of drizzle-orm are you using? 0.31.1 What version of drizzle-kit are you using? No response Describe the Bug If I make two table aliases for the same table and then inner join one whil...
Want results from more Discord servers?
Add your server