orange-orm 4.8.1 → 4.8.2

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.
@@ -12129,6 +12129,10 @@ function requirePatchTable () {
12129
12129
 
12130
12130
 
12131
12131
  function createRowInCache({ context, table, key }) {
12132
+ const tryGetFromCacheById = getOrCreateRow.tryGetFromCacheById || (getOrCreateRow.tryGetFromCacheById = requireTryGetFromCacheById());
12133
+ const cachedRow = tryGetFromCacheById(context, table, ...key);
12134
+ if (cachedRow)
12135
+ return cachedRow;
12132
12136
  const newRow = getOrCreateRow.cachedNewRow || (getOrCreateRow.cachedNewRow = requireNewRow());
12133
12137
  const pkDto = {};
12134
12138
  for (let i = 0; i < key.length && i < table._primaryColumns.length; i++) {
package/dist/index.mjs CHANGED
@@ -12130,6 +12130,10 @@ function requirePatchTable () {
12130
12130
 
12131
12131
 
12132
12132
  function createRowInCache({ context, table, key }) {
12133
+ const tryGetFromCacheById = getOrCreateRow.tryGetFromCacheById || (getOrCreateRow.tryGetFromCacheById = requireTryGetFromCacheById());
12134
+ const cachedRow = tryGetFromCacheById(context, table, ...key);
12135
+ if (cachedRow)
12136
+ return cachedRow;
12133
12137
  const newRow = getOrCreateRow.cachedNewRow || (getOrCreateRow.cachedNewRow = requireNewRow());
12134
12138
  const pkDto = {};
12135
12139
  for (let i = 0; i < key.length && i < table._primaryColumns.length; i++) {
package/docs/changelog.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ## Changelog
2
+ __4.8.2__
3
+ Slight performance gain on updates and removed accidental console.dir
2
4
  __4.8.1__
3
5
  Atomic updates/deletes with SQL-level concurrency checks (affectedRows) [#142](https://github.com/alfateam/orange-orm/issues/142)
4
6
  __4.8.0__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orange-orm",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/patchTable.js CHANGED
@@ -345,6 +345,10 @@ async function patchTableCore(context, table, patches, { strategy = undefined, d
345
345
 
346
346
 
347
347
  function createRowInCache({ context, table, key }) {
348
+ const tryGetFromCacheById = getOrCreateRow.tryGetFromCacheById || (getOrCreateRow.tryGetFromCacheById = require('./table/tryGetFromCacheById'));
349
+ const cachedRow = tryGetFromCacheById(context, table, ...key);
350
+ if (cachedRow)
351
+ return cachedRow;
348
352
  const newRow = getOrCreateRow.cachedNewRow || (getOrCreateRow.cachedNewRow = require('./table/commands/newRow'));
349
353
  const pkDto = {};
350
354
  for (let i = 0; i < key.length && i < table._primaryColumns.length; i++) {