fix for WrapMysqlModifySubqueryTransformation when using join builder#2407
fix for WrapMysqlModifySubqueryTransformation when using join builder#2407falkenhawk wants to merge 2 commits intoVincit:mainfrom
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 functionThis happens when we provide
.onIn()with an objection query.Since
WrapMysqlModifySubqueryTransformationdoes not make sense for join query, we simply skip it forJoinBuilder.