@live-change/db-server 0.6.3 → 0.6.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/lib/dbDao.js +5 -5
- package/package.json +9 -9
package/lib/dbDao.js
CHANGED
|
@@ -232,7 +232,7 @@ function localRequests(server, scriptContext) {
|
|
|
232
232
|
if(!dbName) throw new Error("databaseNameRequired")
|
|
233
233
|
const db = server.databases.get(dbName)
|
|
234
234
|
if(!db) throw new Error('databaseNotFound')
|
|
235
|
-
const queryFunction = scriptContext.
|
|
235
|
+
const queryFunction = scriptContext.getOrCreateFunction(code, 'query')
|
|
236
236
|
return db.queryUpdate((input, output) => queryFunction(input, output, params))
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -814,7 +814,7 @@ function localReads(server, scriptContext) {
|
|
|
814
814
|
if(!dbName) return new ReactiveDao.ObservableError("databaseNameRequired")
|
|
815
815
|
const db = server.databases.get(dbName)
|
|
816
816
|
if(!db) return new ReactiveDao.ObservableError('databaseNotFound')
|
|
817
|
-
const queryFunction = scriptContext.
|
|
817
|
+
const queryFunction = scriptContext.getOrCreateFunction(code, 'queryCode:' + sourceName)
|
|
818
818
|
return db.queryObservable(async (input, output) => {
|
|
819
819
|
return queryFunction(input, output, params)
|
|
820
820
|
})
|
|
@@ -823,7 +823,7 @@ function localReads(server, scriptContext) {
|
|
|
823
823
|
if(!dbName) throw new Error("databaseNameRequired")
|
|
824
824
|
const db = server.databases.get(dbName)
|
|
825
825
|
if(!db) throw new Error('databaseNotFound')
|
|
826
|
-
const queryFunction = scriptContext.
|
|
826
|
+
const queryFunction = scriptContext.getOrCreateFunction(code, 'queryCode:' + sourceName)
|
|
827
827
|
return db.queryGet((input, output) => queryFunction(input, output, params))
|
|
828
828
|
}
|
|
829
829
|
},
|
|
@@ -832,7 +832,7 @@ function localReads(server, scriptContext) {
|
|
|
832
832
|
if(!dbName) return new ReactiveDao.ObservableError("databaseNameRequired")
|
|
833
833
|
const db = server.databases.get(dbName)
|
|
834
834
|
if(!db) return new ReactiveDao.ObservableError('databaseNotFound')
|
|
835
|
-
const queryFunction = scriptContext.
|
|
835
|
+
const queryFunction = scriptContext.getOrCreateFunction(code, 'queryCode:' + sourceName)
|
|
836
836
|
return db.queryObjectObservable(async (input, output) => {
|
|
837
837
|
return queryFunction(input, output, params)
|
|
838
838
|
})
|
|
@@ -841,7 +841,7 @@ function localReads(server, scriptContext) {
|
|
|
841
841
|
if(!dbName) throw new Error("databaseNameRequired")
|
|
842
842
|
const db = server.databases.get(dbName)
|
|
843
843
|
if(!db) throw new Error('databaseNotFound')
|
|
844
|
-
const queryFunction = scriptContext.
|
|
844
|
+
const queryFunction = scriptContext.getOrCreateFunction(code, 'queryCode:' + sourceName)
|
|
845
845
|
return db.queryObjectGet((input, output) => queryFunction(input, output, params))
|
|
846
846
|
}
|
|
847
847
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-server",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@live-change/dao": "0.5.15",
|
|
32
32
|
"@live-change/dao-sockjs": "0.5.15",
|
|
33
33
|
"@live-change/dao-websocket": "0.5.15",
|
|
34
|
-
"@live-change/db": "^0.6.
|
|
35
|
-
"@live-change/db-admin": "^0.6.
|
|
36
|
-
"@live-change/db-client": "^0.6.
|
|
37
|
-
"@live-change/db-store-level": "^0.6.
|
|
38
|
-
"@live-change/db-store-lmdb": "^0.6.
|
|
39
|
-
"@live-change/db-store-observable-db": "^0.6.
|
|
40
|
-
"@live-change/db-store-rbtree": "^0.6.
|
|
34
|
+
"@live-change/db": "^0.6.4",
|
|
35
|
+
"@live-change/db-admin": "^0.6.4",
|
|
36
|
+
"@live-change/db-client": "^0.6.4",
|
|
37
|
+
"@live-change/db-store-level": "^0.6.4",
|
|
38
|
+
"@live-change/db-store-lmdb": "^0.6.4",
|
|
39
|
+
"@live-change/db-store-observable-db": "^0.6.4",
|
|
40
|
+
"@live-change/db-store-rbtree": "^0.6.4",
|
|
41
41
|
"@live-change/sockjs": "0.4.1",
|
|
42
42
|
"express": "^4.18.1",
|
|
43
43
|
"line-reader": "^0.4.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"websocket": "^1.0.34",
|
|
50
50
|
"yargs": "^17.5.1"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "2b63a796522f2a5bf7c4e0311331640b4152ba77"
|
|
53
53
|
}
|