proto.io 0.0.148 → 0.0.150
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/dist/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +2 -2
- package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
- package/dist/adapters/storage/progres.d.ts +6 -1
- package/dist/adapters/storage/progres.js +13 -4
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +13 -4
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -5
- package/dist/client.js +2 -2
- package/dist/client.mjs +3 -3
- package/dist/index.d.ts +3 -5
- package/dist/index.js +53 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -21
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-CvfRsxEZ.d.ts → index-013pxZ3P.d.ts} +5 -78
- package/dist/internals/index-013pxZ3P.d.ts.map +1 -0
- package/dist/internals/{index-EOtjV6U_.mjs → index-BmRuvHVZ.mjs} +11 -1
- package/dist/internals/index-BmRuvHVZ.mjs.map +1 -0
- package/dist/internals/index-BqFdBhFc.js.map +1 -1
- package/dist/internals/{index-DZS2c96L.js → index-CSNRyhjB.js} +2 -2
- package/dist/internals/{index-DZS2c96L.js.map → index-CSNRyhjB.js.map} +1 -1
- package/dist/internals/{index-C6zdNpc_.js → index-CVutVPmd.js} +11 -1
- package/dist/internals/{index-C6zdNpc_.js.map → index-CVutVPmd.js.map} +1 -1
- package/dist/internals/index-CsRN32Jf.d.ts +60 -0
- package/dist/internals/index-CsRN32Jf.d.ts.map +1 -0
- package/dist/internals/{index-D4VXQ1FB.d.ts → index-CyX8Lu9K.d.ts} +3 -2
- package/dist/internals/index-CyX8Lu9K.d.ts.map +1 -0
- package/dist/internals/{index-tNCIyuCp.js → index-D1YGwuNK.js} +8 -4
- package/dist/internals/index-D1YGwuNK.js.map +1 -0
- package/dist/internals/index-be1VYBY2.mjs.map +1 -1
- package/dist/internals/{index-DGau0Wqf.mjs → index-c-CaNuVY.mjs} +8 -4
- package/dist/internals/index-c-CaNuVY.mjs.map +1 -0
- package/dist/internals/{index-DTZ5uRgF.mjs → index-tU-lsQqj.mjs} +2 -2
- package/dist/internals/{index-DTZ5uRgF.mjs.map → index-tU-lsQqj.mjs.map} +1 -1
- package/dist/internals/{random-XGNkddOu.js → random-DBDmz54D.js} +3 -3
- package/dist/internals/{random-XGNkddOu.js.map → random-DBDmz54D.js.map} +1 -1
- package/dist/internals/{random-BjV_01xP.mjs → random-KZTFMK9-.mjs} +3 -3
- package/dist/internals/{random-BjV_01xP.mjs.map → random-KZTFMK9-.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/internals/index-BAB_APmb.d.ts +0 -116
- package/dist/internals/index-BAB_APmb.d.ts.map +0 -1
- package/dist/internals/index-CvfRsxEZ.d.ts.map +0 -1
- package/dist/internals/index-D4VXQ1FB.d.ts.map +0 -1
- package/dist/internals/index-DGau0Wqf.mjs.map +0 -1
- package/dist/internals/index-EOtjV6U_.mjs.map +0 -1
- package/dist/internals/index-tNCIyuCp.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import { a as isPointer, b as isRelation, i as isShape, d as decodeUpdateOp, s as shapePaths, e as isPrimitive, T as TObject, f as isVector, _ as _decodeValue, g as _encodeValue, h as dimensionOf, j as _typeof } from '../../internals/index-
|
|
2
|
+
import { a as isPointer, b as isRelation, i as isShape, d as decodeUpdateOp, s as shapePaths, e as isPrimitive, T as TObject, f as isVector, _ as _decodeValue, g as _encodeValue, h as dimensionOf, j as _typeof } from '../../internals/index-BmRuvHVZ.mjs';
|
|
3
3
|
import { Pool, types } from 'pg';
|
|
4
4
|
import QueryStream from 'pg-query-stream';
|
|
5
5
|
import { asyncStream } from '@o2ter/utils-js';
|
|
6
6
|
import Decimal from 'decimal.js';
|
|
7
7
|
import { escapeLiteral, escapeIdentifier } from 'pg/lib/utils';
|
|
8
|
-
import { a as QueryCoditionalSelector, b as QueryFieldSelector, c as QueryExpressionSelector, d as QueryDistanceExpression, e as QueryCoditionalExpression, f as QueryComparisonExpression, g as QueryNotExpression, h as QueryArrayExpression, i as QueryValueExpression, j as QueryKeyExpression, Q as QuerySelector, F as FieldSelectorExpression } from '../../internals/index-
|
|
8
|
+
import { a as QueryCoditionalSelector, b as QueryFieldSelector, c as QueryExpressionSelector, d as QueryDistanceExpression, e as QueryCoditionalExpression, f as QueryComparisonExpression, g as QueryNotExpression, h as QueryArrayExpression, i as QueryValueExpression, j as QueryKeyExpression, Q as QuerySelector, F as FieldSelectorExpression } from '../../internals/index-tU-lsQqj.mjs';
|
|
9
9
|
import '@o2ter/crypto-js';
|
|
10
|
-
import { _ as _resolveColumn, g as generateId, Q as QueryValidator } from '../../internals/random-
|
|
10
|
+
import { _ as _resolveColumn, g as generateId, Q as QueryValidator } from '../../internals/random-KZTFMK9-.mjs';
|
|
11
11
|
import { P as PVK } from '../../internals/private-BUpLAMZi.mjs';
|
|
12
12
|
|
|
13
13
|
//
|
|
@@ -2445,6 +2445,9 @@ class PostgresStorageClient extends SqlStorage {
|
|
|
2445
2445
|
withConnection(callback) {
|
|
2446
2446
|
return callback(this);
|
|
2447
2447
|
}
|
|
2448
|
+
isDuplicateIdError(error) {
|
|
2449
|
+
return error.code === '23505' && error.table && error.constraint === `${error.table}_pkey`;
|
|
2450
|
+
}
|
|
2448
2451
|
atomic(callback, options) {
|
|
2449
2452
|
return this.withTransaction(async (conn) => {
|
|
2450
2453
|
if (options?.lockTable)
|
|
@@ -2528,7 +2531,13 @@ class PostgresStorageTransaction extends PostgresStorageClient {
|
|
|
2528
2531
|
return this._selectLock;
|
|
2529
2532
|
}
|
|
2530
2533
|
atomic(callback, options) {
|
|
2531
|
-
|
|
2534
|
+
if (!options?.retry)
|
|
2535
|
+
return callback(this);
|
|
2536
|
+
return this.withTransaction(async (conn) => {
|
|
2537
|
+
if (options?.lockTable)
|
|
2538
|
+
await conn.lockTable(options.lockTable, true);
|
|
2539
|
+
return callback(conn);
|
|
2540
|
+
});
|
|
2532
2541
|
}
|
|
2533
2542
|
async withTransaction(callback) {
|
|
2534
2543
|
const transaction = new PostgresStorageTransaction(this._driver, this.counter + 1, this._selectLock);
|