orange-orm 3.10.3 → 3.10.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/docs/changelog.md +7 -5
- package/package.json +1 -1
- package/src/client/index.mjs +1580 -1016
- package/src/mssql/newTransaction.js +1 -0
- package/src/mySql/newTransaction.js +1 -0
- package/src/oracle/newTransaction.js +1 -0
- package/src/patchTable.js +4 -1
- package/src/pg/newTransaction.js +1 -0
- package/src/sap/newTransaction.js +1 -0
- package/src/sqlite/newTransaction.js +1 -0
- package/src/table/clearCache.js +7 -0
- package/src/table/getSessionCache.js +8 -0
- package/src/table/newRowCache.js +4 -4
- package/src/table/relation/newExpanderCache.js +2 -0
- package/src/table/relation/newManyCache.js +4 -4
- package/src/table/setSessionCache.js +8 -0
- package/src/tedious/newTransaction.js +1 -0
package/src/patchTable.js
CHANGED
|
@@ -3,13 +3,16 @@ let applyPatch = require('./applyPatch');
|
|
|
3
3
|
let fromCompareObject = require('./fromCompareObject');
|
|
4
4
|
let validateDeleteConflict = require('./validateDeleteConflict');
|
|
5
5
|
let validateDeleteAllowed = require('./validateDeleteAllowed');
|
|
6
|
+
let clearCache = require('./table/clearCache');
|
|
6
7
|
|
|
7
8
|
async function patchTable() {
|
|
8
9
|
// const dryrun = true;
|
|
9
10
|
//traverse all rows you want to update before updatinng or inserting anything.
|
|
10
11
|
//this is to avoid page locks in ms sql
|
|
11
12
|
// await patchTableCore.apply(null, [...arguments, dryrun]);
|
|
12
|
-
|
|
13
|
+
const result = await patchTableCore.apply(null, arguments);
|
|
14
|
+
clearCache();
|
|
15
|
+
return result;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
async function patchTableCore(table, patches, { strategy = undefined, deduceStrategy = false, ...options } = {}, dryrun) {
|
package/src/pg/newTransaction.js
CHANGED
package/src/table/newRowCache.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let newCache = require('./newCache');
|
|
2
|
-
let
|
|
3
|
-
let
|
|
2
|
+
let getSessionCache = require('./getSessionCache');
|
|
3
|
+
let setSessionCache = require('./setSessionCache');
|
|
4
4
|
|
|
5
5
|
function newRowCache(table) {
|
|
6
6
|
let id = Symbol();
|
|
@@ -38,11 +38,11 @@ function newRowCache(table) {
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
function getCache(table, id) {
|
|
41
|
-
let cache =
|
|
41
|
+
let cache = getSessionCache(id);
|
|
42
42
|
if (cache)
|
|
43
43
|
return cache;
|
|
44
44
|
cache = _newRowCache(table);
|
|
45
|
-
|
|
45
|
+
setSessionCache(id, cache);
|
|
46
46
|
return cache;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -4,8 +4,8 @@ var synchronizeRemoved = require('./manyCache/synchronizeRemoved');
|
|
|
4
4
|
var extractParentKey = require('./manyCache/extractParentKey');
|
|
5
5
|
var newCacheCore = require('./newManyCacheCore');
|
|
6
6
|
var newId = require('../../newId');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var getSessionCache = require('../getSessionCache');
|
|
8
|
+
var setSessionCache = require('../setSessionCache');
|
|
9
9
|
|
|
10
10
|
function newManyCache(joinRelation) {
|
|
11
11
|
var c = {};
|
|
@@ -25,10 +25,10 @@ function newManyCache(joinRelation) {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
c.getInnerCache = function() {
|
|
28
|
-
var cache =
|
|
28
|
+
var cache = getSessionCache(key);
|
|
29
29
|
if (!cache) {
|
|
30
30
|
cache = newCacheCore(joinRelation);
|
|
31
|
-
|
|
31
|
+
setSessionCache(key, cache);
|
|
32
32
|
fillCache();
|
|
33
33
|
synchronizeAdded(c.tryAdd, joinRelation);
|
|
34
34
|
synchronizeRemoved(c.tryRemove, joinRelation);
|