Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for WrapMysqlModifySubqueryTransformation when using join builder #10

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

marcinlee
Copy link

Reiteration of: #6

Fixes error where .onIn()/.andOnIn() causes:
TypeError: parentQuery.isUpdate is not a function

This happens when we provide .onIn() with an objection query.

BlogPost.query(db)
  .alias('post')
  .innerJoin('post.comment', (join) => {
    join.onIn(
      'comment.author_id',
      Author.query(db).where('active', true)
    );
  });

Since WrapMysqlModifySubqueryTransformation does not make sense for join query, we simply skip it for JoinBuilder.

Note: This wasn't an issue in objection v1 and this error does not happen if we provide .onIn() with knex query instead.

Fixes and error where .andOnIn() causes:
"TypeError: parentQuery.isUpdate is not a function"
@marcinlee marcinlee self-assigned this Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants