@things-factory/ops-master 10.1.299 → 10.1.302
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/ops-master",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.302",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"things-factory": true,
|
|
6
6
|
"author": "heartyoh <heartyoh@hatiolab.com>",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@operato/shell": "^10.29.69",
|
|
43
43
|
"@operato/styles": "^10.0.0",
|
|
44
44
|
"@operato/utils": "^10.29.39",
|
|
45
|
-
"@things-factory/auth-base": "^10.1.
|
|
45
|
+
"@things-factory/auth-base": "^10.1.302",
|
|
46
46
|
"@things-factory/env": "^10.1.298",
|
|
47
|
-
"@things-factory/shell": "^10.1.
|
|
48
|
-
"@things-factory/worklist": "^10.1.
|
|
47
|
+
"@things-factory/shell": "^10.1.302",
|
|
48
|
+
"@things-factory/worklist": "^10.1.302"
|
|
49
49
|
},
|
|
50
50
|
"browser": "dist-client/index.js",
|
|
51
51
|
"files": [
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"!**/.DS_Store"
|
|
65
65
|
],
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@things-factory/notification": "^10.1.
|
|
67
|
+
"@things-factory/notification": "^10.1.302",
|
|
68
68
|
"copyfiles": "^2.4.1",
|
|
69
69
|
"rimraf": "^6.1.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "2e754aaeafcd39f5c6f4b7c8847a6c60ffe0789c"
|
|
72
72
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type EntityManager, type EntityTarget, type SelectQueryBuilder } from 'typeorm';
|
|
2
|
-
/**
|
|
3
|
-
* **A write lock on the rows of one table only** - what every locking read of a revision service takes.
|
|
4
|
-
*
|
|
5
|
-
* Current reads are required after waiting for the subject lock, including MySQL REPEATABLE READ, so these reads lock.
|
|
6
|
-
* But a plain `FOR UPDATE` locks every row the query reads: a read filtered by its domain joins the domain row, and a
|
|
7
|
-
* read that loads a revision with its lines LEFT JOINs them - and postgres refuses `FOR UPDATE` on the nullable side of
|
|
8
|
-
* an outer join outright (`0A000`). Publishing a recipe failed that way on postgres (found 2026-10-23, the warehouse's
|
|
9
|
-
* kitting tests); test specifications and materials read their revisions the same way. Postgres names the table to lock
|
|
10
|
-
* (`FOR UPDATE OF`); the other drivers that lock are left as they were. The operato warehouse took the same turn for
|
|
11
|
-
* its stock rows (`writeLockOn`, `fb055e0d`).
|
|
12
|
-
*/
|
|
13
|
-
export declare function writeLockOn(manager: EntityManager, entity: EntityTarget<any>): {
|
|
14
|
-
lock?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
lock: {
|
|
17
|
-
tables?: string[];
|
|
18
|
-
mode: "pessimistic_write";
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/** The same lock on a query builder's own alias - `setLock` takes the alias as written into the SQL. */
|
|
22
|
-
export declare function lockRowsOf<T extends object>(manager: EntityManager, query: SelectQueryBuilder<T>): SelectQueryBuilder<T>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeLockOn = writeLockOn;
|
|
4
|
-
exports.lockRowsOf = lockRowsOf;
|
|
5
|
-
const shell_1 = require("@things-factory/shell");
|
|
6
|
-
/**
|
|
7
|
-
* **A write lock on the rows of one table only** - what every locking read of a revision service takes.
|
|
8
|
-
*
|
|
9
|
-
* Current reads are required after waiting for the subject lock, including MySQL REPEATABLE READ, so these reads lock.
|
|
10
|
-
* But a plain `FOR UPDATE` locks every row the query reads: a read filtered by its domain joins the domain row, and a
|
|
11
|
-
* read that loads a revision with its lines LEFT JOINs them - and postgres refuses `FOR UPDATE` on the nullable side of
|
|
12
|
-
* an outer join outright (`0A000`). Publishing a recipe failed that way on postgres (found 2026-10-23, the warehouse's
|
|
13
|
-
* kitting tests); test specifications and materials read their revisions the same way. Postgres names the table to lock
|
|
14
|
-
* (`FOR UPDATE OF`); the other drivers that lock are left as they were. The operato warehouse took the same turn for
|
|
15
|
-
* its stock rows (`writeLockOn`, `fb055e0d`).
|
|
16
|
-
*/
|
|
17
|
-
function writeLockOn(manager, entity) {
|
|
18
|
-
if (!(0, shell_1.writeLockSupported)(manager))
|
|
19
|
-
return {};
|
|
20
|
-
return { lock: { mode: 'pessimistic_write', ...(isPostgres(manager) ? { tables: [manager.connection.getMetadata(entity).tableNameWithoutPrefix] } : {}) } };
|
|
21
|
-
}
|
|
22
|
-
/** The same lock on a query builder's own alias - `setLock` takes the alias as written into the SQL. */
|
|
23
|
-
function lockRowsOf(manager, query) {
|
|
24
|
-
if (!(0, shell_1.writeLockSupported)(manager))
|
|
25
|
-
return query;
|
|
26
|
-
return query.setLock('pessimistic_write', undefined, isPostgres(manager) ? [query.escape(query.alias)] : undefined);
|
|
27
|
-
}
|
|
28
|
-
function isPostgres(manager) {
|
|
29
|
-
return manager.connection?.options?.type === 'postgres';
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=row-lock.js.map
|