-
Notifications
You must be signed in to change notification settings - Fork 639
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 #2407
base: main
Are you sure you want to change the base?
Conversation
Fixes and error where .andOnIn() causes: "TypeError: parentQuery.isUpdate is not a function"
I've added a typings test for join.onIn + subquery case, but then I realized objection's typings currently do not allow that, because objection.js/typings/objection/index.d.ts Line 611 in 23b8ac1
and that, in turn, has only those variants listed for and I remembered, it just worked for us (joins with onIn + subquery) when we Since those are proven to work just fine, it would be better to extend the JoinClause typings in https://github.com/Vincit/objection.js/blob/23b8ac112ff095b5d6d8ac2f60b9af87d9028a77/typings/objection/index.d.ts and add tests for such join + onIn variants somewhere along those lines objection.js/tests/integration/find.js Line 183 in a7186eb
(there aren't many test cases for .*join() methods anyway)
|
@falkenhawk could you look into why this is currently failing on Node 16? |
They fail because of typing errors coming from
because , as I mentioned in my previous comment, To make it right, typings need a rewrite on objection's side to allow objection's QueryBuilder in places where knex's QueryBuilder is accepted. Tests are also missing for such cases... I think they were left out to trust knex's test suite that join methods work instead. |
@falkenhawk thank you for the explanation, and apologies for initially not reading the full description thoroughly. Would you be willing to work on the missing types? I'd be OK with the missing tests. |
ported from ovos#10
Fixes error where
.onIn()
/.andOnIn()
causes:TypeError: parentQuery.isUpdate is not a function
This happens when we provide
.onIn()
with an objection query.Since
WrapMysqlModifySubqueryTransformation
does not make sense for join query, we simply skip it forJoinBuilder
.