@cap-js/sqlite 2.2.1 → 2.4.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.4.0](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.3.0...sqlite-v2.4.0) (2026-04-29)
8
+
9
+
10
+ ### Added
11
+
12
+ * supersede potentially compromised release ([#1590](https://github.com/cap-js/cds-dbs/issues/1590)) ([3be4044](https://github.com/cap-js/cds-dbs/commit/3be404417229a2dd539e4b40393d3bd346e4388c))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * The following workspace dependencies were updated
18
+ * dependencies
19
+ * @cap-js/db-service bumped from ^2.10.1 to ^2.11.0
20
+
21
+ ## [2.3.0](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.2.1...sqlite-v2.3.0) (2026-04-29)
22
+
23
+
24
+ ### Added
25
+
26
+ * decimal affinity in sqlite ([#1547](https://github.com/cap-js/cds-dbs/issues/1547)) ([9228adc](https://github.com/cap-js/cds-dbs/commit/9228adc22733b18934997506271a0c7fa6505eb8))
27
+
28
+
29
+ ### Fixed
30
+
31
+ * supersede potentially compromised release ([#1589](https://github.com/cap-js/cds-dbs/issues/1589)) ([bd73895](https://github.com/cap-js/cds-dbs/commit/bd7389524d00ddd6ed73fc79308e19e7bf952b53))
32
+
33
+
34
+ ### Dependencies
35
+
36
+ * The following workspace dependencies were updated
37
+ * dependencies
38
+ * @cap-js/db-service bumped from ^2.10.0 to ^2.10.1
39
+
7
40
  ## [2.2.1](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.2.0...sqlite-v2.2.1) (2026-04-22)
8
41
 
9
42
 
package/index.js CHANGED
@@ -1 +1,2 @@
1
1
  module.exports = require('./lib/SQLiteService.js')
2
+
@@ -270,9 +270,11 @@ class SQLiteService extends SQLService {
270
270
  Int64: cds.env.features.ieee754compatible ? expr => `CAST(${expr} as TEXT)` : undefined,
271
271
  // REVISIT: always cast to string in next major
272
272
  // Reading decimal as string to not loose precision
273
- Decimal: cds.env.features.ieee754compatible ? (expr, elem) => elem?.scale
274
- ? `CASE WHEN ${expr} IS NULL THEN NULL ELSE format('%.${elem.scale}f', ${expr}) END`
275
- : `CAST(${expr} as TEXT)`
273
+ Decimal: cds.env.features.ieee754compatible
274
+ ? (expr, elem) =>
275
+ elem?.scale
276
+ ? `CASE WHEN ${expr} IS NULL THEN NULL ELSE format('%.${elem.scale}f', ${expr}) END`
277
+ : `CASE WHEN ${expr} IS NULL THEN NULL ELSE rtrim(rtrim(format('%.999f', ${expr}), '0'), '.') END`
276
278
  : undefined,
277
279
  // Binary is not allowed in json objects
278
280
  Binary: expr => `${expr} || ''`,
@@ -289,7 +291,8 @@ class SQLiteService extends SQLService {
289
291
  Time: () => 'TIME_TEXT',
290
292
  DateTime: () => 'DATETIME_TEXT',
291
293
  Timestamp: () => 'TIMESTAMP_TEXT',
292
- Map: () => 'JSON_TEXT'
294
+ Map: () => 'JSON_TEXT',
295
+ Decimal: cds.env.requires.db?.decimal_affinity?.match(/^real$/i) ? () => 'REAL_DECIMAL' : undefined,
293
296
  }
294
297
 
295
298
  get is_distinct_from_() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/sqlite",
3
- "version": "2.2.1",
3
+ "version": "2.4.0",
4
4
  "description": "CDS database service for SQLite",
5
5
  "homepage": "https://github.com/cap-js/cds-dbs/tree/main/sqlite#cds-database-service-for-sqlite",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "better-sqlite3": "^12.0.0",
30
- "@cap-js/db-service": "^2.10.0"
30
+ "@cap-js/db-service": "^2.11.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@sap/cds": ">=9.8",