Skip to content

Commit 6fc5afa

Browse files
chore(cds9): use _target once; no need to drill down manually (#1134)
`q._target` will resolve recursively to the innermost entity, with our streamlined `cds.infer` --> no need to do this manually anymore this is a follow up of #1126 @danjoa fyi --------- Co-authored-by: Johannes Vogel <[email protected]>
1 parent e263c10 commit 6fc5afa

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

db-service/lib/cqn4sql.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,7 @@ function cqn4sql(originalQuery, model) {
802802
})
803803
} else {
804804
outerAlias = transformedQuery.SELECT.from.as
805-
const getInnermostTarget = q => (q._target ? getInnermostTarget(q._target) : q)
806-
subqueryFromRef = [
807-
...(transformedQuery.SELECT.from.ref || /* subq in from */ [getInnermostTarget(transformedQuery).name]),
808-
...ref,
809-
]
805+
subqueryFromRef = [transformedQuery._target.name, ...ref]
810806
}
811807

812808
// this is the alias of the column which holds the correlated subquery

0 commit comments

Comments
 (0)