@cap-js/db-service 2.8.0 → 2.8.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
+ ## [2.8.1](https://github.com/cap-js/cds-dbs/compare/db-service-v2.8.0...db-service-v2.8.1) (2025-12-19)
8
+
9
+
10
+ ### Fixed
11
+
12
+ * hierarchy node_id as alias ([#1450](https://github.com/cap-js/cds-dbs/issues/1450)) ([d115345](https://github.com/cap-js/cds-dbs/commit/d115345e5acc30046159ede98d99a864df55e2af))
13
+
7
14
  ## [2.8.0](https://github.com/cap-js/cds-dbs/compare/db-service-v2.7.0...db-service-v2.8.0) (2025-12-15)
8
15
 
9
16
 
@@ -244,7 +244,11 @@ const HANAFunctions = {
244
244
  let src = args.xpr[1]
245
245
 
246
246
  // Ensure that the orderBy column are exposed by the source for hierarchy sorting
247
- const orderBy = args.xpr.find((_, i, arr) => /ORDER/i.test(arr[i - 2]) && /BY/i.test(arr[i - 1]))
247
+ let orderBy = args.xpr.find((_, i, arr) => /ORDER/i.test(arr[i - 2]) && /BY/i.test(arr[i - 1]))
248
+ // use ![] instead of ""
249
+ if (orderBy && typeof orderBy === 'string') {
250
+ orderBy = orderBy.replace(/"([^"]*)"/g, '![$1]');
251
+ }
248
252
 
249
253
  const passThroughColumns = src.SELECT.columns.map(c => ({ ref: ['Source', this.column_name(c)] }))
250
254
  src.as = 'H' + (uniqueCounter++)
package/lib/cqn2sql.js CHANGED
@@ -380,7 +380,8 @@ class CQN2SQLRenderer {
380
380
 
381
381
  if (orderBy) {
382
382
  orderBy = orderBy.map(r => {
383
- const col = r.ref.at(-1)
383
+ let col = r.ref.at(-1)
384
+ if (col.toUpperCase() in reservedColumnNames) col = `$$${col}$$`
384
385
  if (!columnsIn.find(c => this.column_name(c) === col)) {
385
386
  columnsIn.push({ ref: [col] })
386
387
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/db-service",
3
- "version": "2.8.0",
3
+ "version": "2.8.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": {