objection.js
objection.js copied to clipboard
relationMapping composite keys with same property names gives ambiguous column error
Hi, I am trying to create a relationMapping between two composite keys which both share the same property names:
join: {
from: [`table1.user_id`, `table1.hub_id`],
to: [`table2.user_id`, `table2.hub_id`],
},
I'm getting a where "user_id" = $1 - column reference "user_id" is ambiguous
error. Is there a way to create an alias for these keys? thank you.
Could you add a .debug()
to your query builder and share the logged query in full?