Closed KenjiGinjo closed 1 month ago
There are two problems here:
Incorrect SQL in whereExists
indirectly caused by softDelete
await db.activity.whereExists('members', (q) => q.where({ name: 'test' }));
Snake case problem caused by on
bug.
await db.activity.whereExists(db.activityMember, (q) =>
// activity_member.activityId isn't turned to snake_case
q.on('activity.id', 'activity_member.activityId').where({ name: 'test' }),
);
I published a fix for the first one, and going to make a fix for the second one a bit later.
It's ok now.
nope, the snake case problem isn't solved yet
q = q.whereExists('members', (q) => q.where({ 'members.userId': dto.memberId }));
// this is ok, now
Yes, that's was fixed, but the 2nd wasn't.
I just published an update for the 2nd case:
await db.activity.whereExists(db.activityMember, (q) =>
// activity_member.activityId isn't turned to snake_case
q.on('activity.id', 'activity_member.activityId').where({ name: 'test' }),
);
Now it also works.
https://github.com/KenjiGinjo/orchid-reproduction/tree/K_333