The following returns duplicates:
q
.from({ user: users })
.where(({ user }) => user.active)
.join({ post: posts }, ({ user, post }) => eq(user.name, post.user))
.select(({ user }) => ({ name: user.name }))
.distinct()
Minimal repro: stackblitz.com/edit/tsdd
The following returns duplicates:
Minimal repro: stackblitz.com/edit/tsdd