-
-
Notifications
You must be signed in to change notification settings - Fork 502
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(knex): order by
with a formula field should not include as
for sub-queries
#2929
Conversation
@@ -505,7 +505,7 @@ export class QueryBuilderHelper { | |||
|
|||
Utils.splitPrimaryKeys(field).forEach(f => { | |||
const prop = this.getProperty(f, alias); | |||
const noPrefix = (prop && prop.persist === false) || QueryBuilderHelper.isCustomExpression(f); | |||
const noPrefix = (prop && prop.persist === false && !prop.formula) || QueryBuilderHelper.isCustomExpression(f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need advice on this one, I added this because on the test it the order was coming out as e0.priceTaxed
and not the formula. It would cause the mapper to not correctly resolve the field as a formula as it loses information that the property belongs to books
and not e0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formulas should be marked with persist: false
already, i dont mind the explicit check
edit: i see, this is not really about that
Codecov Report
@@ Coverage Diff @@
## master #2929 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 193 193
Lines 11782 11782
Branches 2718 2718
=========================================
Hits 11782 11782
Continue to review full report at Codecov.
|
Btw, there is the same issue on group by |
e27e4b9 should help with that |
follow on from #2848, noticed for sub-queries it was still adding
as
to formula field onorder by