fix(query-generator) Simplify where item query (#8068)
* refactor(abstruct.query-generator): Reduce complexity of abstruct query-generator whereItemQuery by whereItemQuery had cyclic complexity of 85 reduced to 26 to make logic a bit easier to follow. Logic is almost identical but at places where logic looked like an obvoius error it was tweeked, like - _traverseJSON had weird logic if the item was plain object - cast wast set by either path (ok) or the first value of the first property of an object (doesn't make sense) where value passed into whereItemQuery was in the main function scope causing it to accumulate properties on each iteration (doesn't make sense) All test are passing with no issues but since there were minor logic changes there might be some edge cases needed to be addressed. Though it's more resonable to assume changes will fix bugs related to those edge cases than cause them * fix(abstract.query-generator): Fix discrepancies between postgres and sqlite casting and handling of postgres and sqlite handle casting and JSONB formats a bit diffrently yet some previous commits didn't took this changes into consideration when handling casting and didn't test casting properly * fix(abstract.query-generator): Fix issue where not properly treating plain js object values for JSON column Fixes #3824 (again)
Showing
with
175 additions
and
3 deletions
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment