@cap-js/sqlite 2.0.2 → 2.0.4
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 +16 -0
- package/lib/SQLiteService.js +8 -0
- package/lib/session.json +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@
|
|
|
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.4](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.0.3...sqlite-v2.0.4) (2025-10-23)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Dependencies
|
|
11
|
+
|
|
12
|
+
* The following workspace dependencies were updated
|
|
13
|
+
* dependencies
|
|
14
|
+
* @cap-js/db-service bumped from ^2 to ^2.6.0
|
|
15
|
+
|
|
16
|
+
## [2.0.3](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.0.2...sqlite-v2.0.3) (2025-09-30)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
* associations in `[@cds](https://github.com/cds).search` are additive ([#1355](https://github.com/cap-js/cds-dbs/issues/1355)) ([ea931cb](https://github.com/cap-js/cds-dbs/commit/ea931cb120c2857aa18a4eb68b893926c0999a9f))
|
|
22
|
+
|
|
7
23
|
## [2.0.2](https://github.com/cap-js/cds-dbs/compare/sqlite-v2.0.1...sqlite-v2.0.2) (2025-06-30)
|
|
8
24
|
|
|
9
25
|
|
package/lib/SQLiteService.js
CHANGED
|
@@ -2,6 +2,7 @@ const { SQLService } = require('@cap-js/db-service')
|
|
|
2
2
|
const cds = require('@sap/cds')
|
|
3
3
|
const sqlite = require('better-sqlite3')
|
|
4
4
|
const $session = Symbol('dbc.session')
|
|
5
|
+
const sessionVariableMap = require('./session.json') // Adjust the path as necessary for your project
|
|
5
6
|
const convStrm = require('stream/consumers')
|
|
6
7
|
const { Readable } = require('stream')
|
|
7
8
|
|
|
@@ -57,6 +58,13 @@ class SQLiteService extends SQLService {
|
|
|
57
58
|
|
|
58
59
|
set(variables) {
|
|
59
60
|
const dbc = this.dbc || cds.error('Cannot set session context: No database connection')
|
|
61
|
+
|
|
62
|
+
// Enrich provided session context with aliases
|
|
63
|
+
for (const alias in sessionVariableMap) {
|
|
64
|
+
const name = sessionVariableMap[alias]
|
|
65
|
+
if (variables[name]) variables[alias] = variables[name]
|
|
66
|
+
}
|
|
67
|
+
|
|
60
68
|
if (!dbc[$session]) dbc[$session] = variables
|
|
61
69
|
else Object.assign(dbc[$session], variables)
|
|
62
70
|
}
|
package/lib/session.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js/sqlite",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "cds-test"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cap-js/db-service": "^2",
|
|
29
|
+
"@cap-js/db-service": "^2.6.0",
|
|
30
30
|
"better-sqlite3": "^12.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|