@cap-js/postgres 2.1.2 → 2.2.0

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,39 @@
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.2.0](https://github.com/cap-js/cds-dbs/compare/postgres-v2.1.3...postgres-v2.2.0) (2026-03-09)
8
+
9
+
10
+ ### Added
11
+
12
+ * support for `node:sqlite` and `sql.js` ([#614](https://github.com/cap-js/cds-dbs/issues/614)) ([887d1bb](https://github.com/cap-js/cds-dbs/commit/887d1bba82347857364bc133983b9e16e054d6cd))
13
+
14
+
15
+ ### Fixed
16
+
17
+ * hana groupby with path expressions ([#1493](https://github.com/cap-js/cds-dbs/issues/1493)) ([920acde](https://github.com/cap-js/cds-dbs/commit/920acdee0edb538b74d6e5cb0a82a086556df85e))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * dependencies
24
+ * @cap-js/db-service bumped from ^2.8.2 to ^2.9.0
25
+
26
+ ## [2.1.3](https://github.com/cap-js/cds-dbs/compare/postgres-v2.1.2...postgres-v2.1.3) (2026-02-03)
27
+
28
+
29
+ ### Fixed
30
+
31
+ * `between_*` function input types ([#1468](https://github.com/cap-js/cds-dbs/issues/1468)) ([1d3905a](https://github.com/cap-js/cds-dbs/commit/1d3905a0a8e6b2a6b11c787456c86e93ac2a41cd))
32
+
33
+
34
+ ### Dependencies
35
+
36
+ * The following workspace dependencies were updated
37
+ * dependencies
38
+ * @cap-js/db-service bumped from ^2.8.1 to ^2.8.2
39
+
7
40
  ## [2.1.2](https://github.com/cap-js/cds-dbs/compare/postgres-v2.1.1...postgres-v2.1.2) (2025-12-19)
8
41
 
9
42
 
@@ -146,7 +146,7 @@ const HANAFunctions = {
146
146
  * @param {string} y - End timestamp
147
147
  * @returns {string} - SQL statement
148
148
  */
149
- nano100_between: (x, y) => `EXTRACT(EPOCH FROM ${y} - ${x}) * 10000000`,
149
+ nano100_between: (x, y) => `EXTRACT(EPOCH FROM ${y}::TIMESTAMP - ${x}::TIMESTAMP) * 10000000`,
150
150
 
151
151
  /**
152
152
  * Generates SQL statement for the difference in seconds between two timestamps
@@ -154,7 +154,7 @@ const HANAFunctions = {
154
154
  * @param {string} y - End timestamp
155
155
  * @returns {string} - SQL statement
156
156
  */
157
- seconds_between: (x, y) => `EXTRACT(EPOCH FROM ${y} - ${x})`,
157
+ seconds_between: (x, y) => `EXTRACT(EPOCH FROM ${y}::TIMESTAMP - ${x}::TIMESTAMP )`,
158
158
 
159
159
  /**
160
160
  * Generates SQL statement for the difference in days between two timestamps
@@ -171,14 +171,14 @@ const HANAFunctions = {
171
171
  * @returns {string} - SQL statement
172
172
  */
173
173
  months_between: (x, y) => `((
174
- (EXTRACT(YEAR FROM ${y}) - EXTRACT(YEAR FROM ${x})) * 12
174
+ (EXTRACT(YEAR FROM ${castVal(y)}) - EXTRACT(YEAR FROM ${castVal(x)})) * 12
175
175
  )+(
176
- EXTRACT(MONTH FROM ${y}) - EXTRACT(MONTH FROM ${x})
176
+ EXTRACT(MONTH FROM ${castVal(y)}) - EXTRACT(MONTH FROM ${castVal(x)})
177
177
  )+(
178
- case when ( cast( to_char(${y},'YYYYMM') as Integer ) < cast( to_char(${x},'YYYYMM') as Integer ) ) then
179
- cast((cast( to_char(${y},'DDHH24MISSFF3') as bigint ) > cast( to_char(${x},'DDHH24MISSFF3') as bigint )) as Integer)
178
+ case when ( cast( to_char(${castVal(y)},'YYYYMM') as Integer ) < cast( to_char(${castVal(x)},'YYYYMM') as Integer ) ) then
179
+ cast((cast( to_char(${castVal(y)},'DDHH24MISSFF3') as bigint ) > cast( to_char(${castVal(x)},'DDHH24MISSFF3') as bigint )) as Integer)
180
180
  else
181
- cast((cast( to_char(${y},'DDHH24MISSFF3') as bigint ) < cast( to_char(${x},'DDHH24MISSFF3') as bigint )) as Integer) * -1
181
+ cast((cast( to_char(${castVal(y)},'DDHH24MISSFF3') as bigint ) < cast( to_char(${castVal(x)},'DDHH24MISSFF3') as bigint )) as Integer) * -1
182
182
  end
183
183
  ))`,
184
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/postgres",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "CDS database service for Postgres",
5
5
  "homepage": "https://github.com/cap-js/cds-dbs/tree/main/postgres#cds-database-service-for-postgres",
6
6
  "repository": {
@@ -27,11 +27,11 @@
27
27
  "start": "docker compose -f pg-stack.yml up -d"
28
28
  },
29
29
  "dependencies": {
30
- "@cap-js/db-service": "^2.8.1",
30
+ "@cap-js/db-service": "^2.9.0",
31
31
  "pg": "^8"
32
32
  },
33
33
  "peerDependencies": {
34
- "@sap/cds": ">=9",
34
+ "@sap/cds": ">=9.8",
35
35
  "@sap/cds-dk": ">=9"
36
36
  },
37
37
  "peerDependenciesMeta": {