@cap-js/sqlite 1.11.0 → 2.0.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 +21 -0
- package/lib/SQLiteService.js +0 -40
- package/lib/cql-functions.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@
|
|
|
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.0.0](https://github.com/cap-js/cds-dbs/compare/sqlite-v1.11.0...sqlite-v2.0.0) (2025-05-07)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* update peer dependency to @sap/cds@9 ([#1178](https://github.com/cap-js/cds-dbs/issues/1178))
|
|
13
|
+
* update dependency to @cap-js/db-service@2 ([#1178](https://github.com/cap-js/cds-dbs/issues/1178))
|
|
14
|
+
* Unfiltered db constraint errors ([#1165](https://github.com/cap-js/cds-dbs/issues/1165))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
* Support for hierarchical queries ([#1093](https://github.com/cap-js/cds-dbs/issues/1093)) ([246e0b3](https://github.com/cap-js/cds-dbs/commit/246e0b38840f7e132ea49cae335b6be7a55354b3))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
* Unfiltered db constraint errors ([#1165](https://github.com/cap-js/cds-dbs/issues/1165)) ([ff39e22](https://github.com/cap-js/cds-dbs/commit/ff39e22ac6cd3f20c98bc31c1a6bb828aa009796))
|
|
25
|
+
* update peer dependency to @sap/cds@9 ([#1178](https://github.com/cap-js/cds-dbs/issues/1178)) ([#1178](https://github.com/cap-js/cds-dbs/issues/1178)) ([0507edd](https://github.com/cap-js/cds-dbs/commit/0507edd4e1dcb98983b1fb65ade1344d978b7524))
|
|
26
|
+
* update dependency to @cap-js/db-service@2 ([#1178](https://github.com/cap-js/cds-dbs/issues/1178)) ([#1178](https://github.com/cap-js/cds-dbs/issues/1178)) ([0507edd](https://github.com/cap-js/cds-dbs/commit/0507edd4e1dcb98983b1fb65ade1344d978b7524))
|
|
27
|
+
|
|
7
28
|
## [1.11.0](https://github.com/cap-js/cds-dbs/compare/sqlite-v1.10.0...sqlite-v1.11.0) (2025-04-17)
|
|
8
29
|
|
|
9
30
|
|
package/lib/SQLiteService.js
CHANGED
|
@@ -5,7 +5,6 @@ const $session = Symbol('dbc.session')
|
|
|
5
5
|
const convStrm = require('stream/consumers')
|
|
6
6
|
const { Readable } = require('stream')
|
|
7
7
|
|
|
8
|
-
const SANITIZE_VALUES = process.env.NODE_ENV === 'production' && cds.env.log.sanitize_values !== false
|
|
9
8
|
const keywords = cds.compiler.to.sql.sqlite.keywords
|
|
10
9
|
// keywords come as array
|
|
11
10
|
const sqliteKeywords = keywords.reduce((prev, curr) => {
|
|
@@ -284,45 +283,6 @@ class SQLiteService extends SQLService {
|
|
|
284
283
|
|
|
285
284
|
static ReservedWords = { ...super.ReservedWords, ...sqliteKeywords }
|
|
286
285
|
}
|
|
287
|
-
|
|
288
|
-
// REALLY REVISIT: Here we are doing error handling which we probably never should have started.
|
|
289
|
-
// And worst of all, we handed out this as APIs without documenting it, so stakeholder tests rely
|
|
290
|
-
// on that? -> we urgently need to review these stakeholder tests.
|
|
291
|
-
// And we'd also need this to be implemented by each db service, and therefore documented, correct?
|
|
292
|
-
async onINSERT(req) {
|
|
293
|
-
try {
|
|
294
|
-
return await super.onINSERT(req)
|
|
295
|
-
} catch (err) {
|
|
296
|
-
throw _not_unique(err, 'ENTITY_ALREADY_EXISTS', req.data)
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
async onUPDATE(req) {
|
|
301
|
-
try {
|
|
302
|
-
return await super.onUPDATE(req)
|
|
303
|
-
} catch (err) {
|
|
304
|
-
throw _not_unique(err, 'UNIQUE_CONSTRAINT_VIOLATION', req.data)
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// function _not_null (err) {
|
|
310
|
-
// if (err.code === "SQLITE_CONSTRAINT_NOTNULL") return Object.assign (err, {
|
|
311
|
-
// code: 'MUST_NOT_BE_NULL',
|
|
312
|
-
// target: /\.(.*?)$/.exec(err.message)[1], // here we are even constructing OData responses, with .target
|
|
313
|
-
// message: 'Value is required',
|
|
314
|
-
// })
|
|
315
|
-
// }
|
|
316
|
-
|
|
317
|
-
function _not_unique(err, code, data) {
|
|
318
|
-
if (err.message.match(/unique constraint/i))
|
|
319
|
-
return Object.assign(err, {
|
|
320
|
-
originalMessage: err.message, // FIXME: required because of next line
|
|
321
|
-
message: code, // FIXME: misusing message as code
|
|
322
|
-
code: 400, // FIXME: misusing code as (http) status
|
|
323
|
-
})
|
|
324
|
-
if (data) err.values = SANITIZE_VALUES ? ['***'] : data
|
|
325
|
-
return err
|
|
326
286
|
}
|
|
327
287
|
|
|
328
288
|
module.exports = SQLiteService
|
package/lib/cql-functions.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js/sqlite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/cap-js/cds-dbs"
|
|
8
|
+
"url": "git+https://github.com/cap-js/cds-dbs.git"
|
|
9
9
|
},
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/cap-js/cds-dbs/issues"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"test": "cds-test"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cap-js/db-service": "^
|
|
29
|
+
"@cap-js/db-service": "^2",
|
|
30
30
|
"better-sqlite3": "^11.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@sap/cds": ">=
|
|
33
|
+
"@sap/cds": ">=9"
|
|
34
34
|
},
|
|
35
35
|
"cds": {
|
|
36
36
|
"requires": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"db": "sql"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"license": "
|
|
53
|
+
"license": "Apache-2.0"
|
|
54
54
|
}
|