@cap-js/sqlite 1.5.1 → 1.6.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 +17 -0
- package/lib/SQLiteService.js +16 -1
- package/package.json +2 -2
- package/lib/ReservedWords.json +0 -149
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@
|
|
|
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
|
+
## [1.6.0](https://github.com/cap-js/cds-dbs/compare/sqlite-v1.5.1...sqlite-v1.6.0) (2024-03-22)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
* forUpdate and forShareLock ([#148](https://github.com/cap-js/cds-dbs/issues/148)) ([99a1170](https://github.com/cap-js/cds-dbs/commit/99a1170e61de4fd0c505834c25a9c03fc34da85b))
|
|
13
|
+
* **hana:** drop prepared statements after end of transaction ([#537](https://github.com/cap-js/cds-dbs/issues/537)) ([b1f864e](https://github.com/cap-js/cds-dbs/commit/b1f864e0a3a0e5efacd803d3709379cab76d61cc))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
* **`sqlite`:** use keyword list from compiler ([#526](https://github.com/cap-js/cds-dbs/issues/526)) ([a227c61](https://github.com/cap-js/cds-dbs/commit/a227c61312ba9e7d6a54944c822d5de0bb2d3f3c))
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
* this package now requires `@cap-js/db-service >= v1.7.0` ([#545](https://github.com/cap-js/cds-dbs/issues/545)) ([2cec27d](https://github.com/cap-js/cds-dbs/commit/2cec27d91402804c3b2da25cc7169f0d81a7406a))
|
|
23
|
+
|
|
7
24
|
## [1.5.1](https://github.com/cap-js/cds-dbs/compare/sqlite-v1.5.0...sqlite-v1.5.1) (2024-02-16)
|
|
8
25
|
|
|
9
26
|
|
package/lib/SQLiteService.js
CHANGED
|
@@ -5,6 +5,13 @@ const $session = Symbol('dbc.session')
|
|
|
5
5
|
const convStrm = require('stream/consumers')
|
|
6
6
|
const { Readable } = require('stream')
|
|
7
7
|
|
|
8
|
+
const keywords = cds.compiler.to.sql.sqlite.keywords
|
|
9
|
+
// keywords come as array
|
|
10
|
+
const sqliteKeywords = keywords.reduce((prev, curr) => {
|
|
11
|
+
prev[curr] = 1
|
|
12
|
+
return prev
|
|
13
|
+
}, {})
|
|
14
|
+
|
|
8
15
|
class SQLiteService extends SQLService {
|
|
9
16
|
init() {
|
|
10
17
|
return super.init(...arguments)
|
|
@@ -171,6 +178,14 @@ class SQLiteService extends SQLService {
|
|
|
171
178
|
return super.val(v)
|
|
172
179
|
}
|
|
173
180
|
|
|
181
|
+
forUpdate() {
|
|
182
|
+
return ''
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
forShareLock() {
|
|
186
|
+
return ''
|
|
187
|
+
}
|
|
188
|
+
|
|
174
189
|
// Used for INSERT statements
|
|
175
190
|
static InputConverters = {
|
|
176
191
|
...super.InputConverters,
|
|
@@ -234,7 +249,7 @@ class SQLiteService extends SQLService {
|
|
|
234
249
|
return 'is'
|
|
235
250
|
}
|
|
236
251
|
|
|
237
|
-
static ReservedWords = { ...super.ReservedWords, ...
|
|
252
|
+
static ReservedWords = { ...super.ReservedWords, ...sqliteKeywords }
|
|
238
253
|
}
|
|
239
254
|
|
|
240
255
|
// REALLY REVISIT: Here we are doing error handling which we probably never should have started.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js/sqlite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"test": "jest --silent"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cap-js/db-service": "^1.
|
|
33
|
+
"@cap-js/db-service": "^1.7.0",
|
|
34
34
|
"better-sqlite3": "^9.3.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
package/lib/ReservedWords.json
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ABORT": 1,
|
|
3
|
-
"ACTION": 1,
|
|
4
|
-
"ADD": 1,
|
|
5
|
-
"AFTER": 1,
|
|
6
|
-
"ALL": 1,
|
|
7
|
-
"ALTER": 1,
|
|
8
|
-
"ALWAYS": 1,
|
|
9
|
-
"ANALYZE": 1,
|
|
10
|
-
"AND": 1,
|
|
11
|
-
"AS": 1,
|
|
12
|
-
"ASC": 1,
|
|
13
|
-
"ATTACH": 1,
|
|
14
|
-
"AUTOINCREMENT": 1,
|
|
15
|
-
"BEFORE": 1,
|
|
16
|
-
"BEGIN": 1,
|
|
17
|
-
"BETWEEN": 1,
|
|
18
|
-
"BY": 1,
|
|
19
|
-
"CASCADE": 1,
|
|
20
|
-
"CASE": 1,
|
|
21
|
-
"CAST": 1,
|
|
22
|
-
"CHECK": 1,
|
|
23
|
-
"COLLATE": 1,
|
|
24
|
-
"COLUMN": 1,
|
|
25
|
-
"COMMIT": 1,
|
|
26
|
-
"CONFLICT": 1,
|
|
27
|
-
"CONSTRAINT": 1,
|
|
28
|
-
"CREATE": 1,
|
|
29
|
-
"CROSS": 1,
|
|
30
|
-
"CURRENT": 1,
|
|
31
|
-
"CURRENT_DATE": 1,
|
|
32
|
-
"CURRENT_TIME": 1,
|
|
33
|
-
"CURRENT_TIMESTAMP": 1,
|
|
34
|
-
"DATABASE": 1,
|
|
35
|
-
"DEFAULT": 1,
|
|
36
|
-
"DEFERRABLE": 1,
|
|
37
|
-
"DEFERRED": 1,
|
|
38
|
-
"DELETE": 1,
|
|
39
|
-
"DESC": 1,
|
|
40
|
-
"DETACH": 1,
|
|
41
|
-
"DISTINCT": 1,
|
|
42
|
-
"DO": 1,
|
|
43
|
-
"DROP": 1,
|
|
44
|
-
"EACH": 1,
|
|
45
|
-
"ELSE": 1,
|
|
46
|
-
"END": 1,
|
|
47
|
-
"ESCAPE": 1,
|
|
48
|
-
"EXCEPT": 1,
|
|
49
|
-
"EXCLUDE": 1,
|
|
50
|
-
"EXCLUSIVE": 1,
|
|
51
|
-
"EXISTS": 1,
|
|
52
|
-
"EXPLAIN": 1,
|
|
53
|
-
"FAIL": 1,
|
|
54
|
-
"FILTER": 1,
|
|
55
|
-
"FIRST": 1,
|
|
56
|
-
"FOLLOWING": 1,
|
|
57
|
-
"FOR": 1,
|
|
58
|
-
"FOREIGN": 1,
|
|
59
|
-
"FROM": 1,
|
|
60
|
-
"FULL": 1,
|
|
61
|
-
"GENERATED": 1,
|
|
62
|
-
"GLOB": 1,
|
|
63
|
-
"GROUP": 1,
|
|
64
|
-
"GROUPS": 1,
|
|
65
|
-
"HAVING": 1,
|
|
66
|
-
"IF": 1,
|
|
67
|
-
"IGNORE": 1,
|
|
68
|
-
"IMMEDIATE": 1,
|
|
69
|
-
"IN": 1,
|
|
70
|
-
"INDEX": 1,
|
|
71
|
-
"INDEXED": 1,
|
|
72
|
-
"INITIALLY": 1,
|
|
73
|
-
"INNER": 1,
|
|
74
|
-
"INSERT": 1,
|
|
75
|
-
"INSTEAD": 1,
|
|
76
|
-
"INTERSECT": 1,
|
|
77
|
-
"INTO": 1,
|
|
78
|
-
"IS": 1,
|
|
79
|
-
"ISNULL": 1,
|
|
80
|
-
"JOIN": 1,
|
|
81
|
-
"KEY": 1,
|
|
82
|
-
"LAST": 1,
|
|
83
|
-
"LEFT": 1,
|
|
84
|
-
"LIKE": 1,
|
|
85
|
-
"LIMIT": 1,
|
|
86
|
-
"MATCH": 1,
|
|
87
|
-
"MATERIALIZED": 1,
|
|
88
|
-
"NATURAL": 1,
|
|
89
|
-
"NO": 1,
|
|
90
|
-
"NOT": 1,
|
|
91
|
-
"NOTHING": 1,
|
|
92
|
-
"NOTNULL": 1,
|
|
93
|
-
"NULL": 1,
|
|
94
|
-
"NULLS": 1,
|
|
95
|
-
"OF": 1,
|
|
96
|
-
"OFFSET": 1,
|
|
97
|
-
"ON": 1,
|
|
98
|
-
"OR": 1,
|
|
99
|
-
"ORDER": 1,
|
|
100
|
-
"OTHERS": 1,
|
|
101
|
-
"OUTER": 1,
|
|
102
|
-
"OVER": 1,
|
|
103
|
-
"PARTITION": 1,
|
|
104
|
-
"PLAN": 1,
|
|
105
|
-
"PRAGMA": 1,
|
|
106
|
-
"PRECEDING": 1,
|
|
107
|
-
"PRIMARY": 1,
|
|
108
|
-
"QUERY": 1,
|
|
109
|
-
"RAISE": 1,
|
|
110
|
-
"RANGE": 1,
|
|
111
|
-
"RECURSIVE": 1,
|
|
112
|
-
"REFERENCES": 1,
|
|
113
|
-
"REGEXP": 1,
|
|
114
|
-
"REINDEX": 1,
|
|
115
|
-
"RELEASE": 1,
|
|
116
|
-
"RENAME": 1,
|
|
117
|
-
"REPLACE": 1,
|
|
118
|
-
"RESTRICT": 1,
|
|
119
|
-
"RETURNING": 1,
|
|
120
|
-
"RIGHT": 1,
|
|
121
|
-
"ROLLBACK": 1,
|
|
122
|
-
"ROW": 1,
|
|
123
|
-
"ROWS": 1,
|
|
124
|
-
"SAVEPOINT": 1,
|
|
125
|
-
"SELECT": 1,
|
|
126
|
-
"SET": 1,
|
|
127
|
-
"TABLE": 1,
|
|
128
|
-
"TEMP": 1,
|
|
129
|
-
"TEMPORARY": 1,
|
|
130
|
-
"THEN": 1,
|
|
131
|
-
"TIES": 1,
|
|
132
|
-
"TO": 1,
|
|
133
|
-
"TRANSACTION": 1,
|
|
134
|
-
"TRIGGER": 1,
|
|
135
|
-
"UNBOUNDED": 1,
|
|
136
|
-
"UNION": 1,
|
|
137
|
-
"UNIQUE": 1,
|
|
138
|
-
"UPDATE": 1,
|
|
139
|
-
"USING": 1,
|
|
140
|
-
"VACUUM": 1,
|
|
141
|
-
"VALUES": 1,
|
|
142
|
-
"VIEW": 1,
|
|
143
|
-
"VIRTUAL": 1,
|
|
144
|
-
"WHEN": 1,
|
|
145
|
-
"WHERE": 1,
|
|
146
|
-
"WINDOW": 1,
|
|
147
|
-
"WITH": 1,
|
|
148
|
-
"WITHOUT": 1
|
|
149
|
-
}
|