@cap-js/db-service 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
  - The format is based on [Keep a Changelog](http://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.6.1](https://github.com/cap-js/cds-dbs/compare/db-service-v1.6.0...db-service-v1.6.1) (2024-02-05)
8
+
9
+
10
+ ### Fixed
11
+
12
+ * consider leafs in `ref` with filter (→ `.id`) for alias calculation ([#440](https://github.com/cap-js/cds-dbs/issues/440)) ([3e2ef24](https://github.com/cap-js/cds-dbs/commit/3e2ef2429701f37853117c0f902a198aded767d9))
13
+
7
14
  ## [1.6.0](https://github.com/cap-js/cds-dbs/compare/db-service-v1.5.1...db-service-v1.6.0) (2024-02-02)
8
15
 
9
16
 
package/lib/cqn4sql.js CHANGED
@@ -916,8 +916,9 @@ function cqn4sql(originalQuery, model = cds.context?.model || cds.model) {
916
916
 
917
917
  function assignUniqueSubqueryAlias() {
918
918
  if (q.SELECT.from.uniqueSubqueryAlias) return
919
+ const last = q.SELECT.from.ref.at(-1)
919
920
  const uniqueSubqueryAlias = inferred.joinTree.addNextAvailableTableAlias(
920
- getLastStringSegment(q.SELECT.from.ref[q.SELECT.from.ref.length - 1]),
921
+ getLastStringSegment(last.id||last),
921
922
  originalQuery.outerQueries,
922
923
  )
923
924
  Object.defineProperty(q.SELECT.from, 'uniqueSubqueryAlias', { value: uniqueSubqueryAlias })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/db-service",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "CDS base database service",
5
5
  "homepage": "https://github.com/cap-js/cds-dbs/tree/main/db-service#cds-base-database-service",
6
6
  "repository": {