proto.io 0.0.191 → 0.0.193

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.
@@ -2,7 +2,7 @@ import _ from 'lodash';
2
2
  import { a as isRelation, i as isPointer, b as isShape, e as decodeUpdateOp, s as shapePaths, c as isPrimitive, T as TObject, _ as _isTypeof, f as isVector, g as _encodeValue, h as _decodeValue, j as dimensionOf, k as _typeof } from '../../internals/index-j8PFq8Ci.mjs';
3
3
  import { Pool, types } from 'pg';
4
4
  import QueryStream from 'pg-query-stream';
5
- import { asyncStream } from '@o2ter/utils-js';
5
+ import { asyncStream, IteratorPool } from '@o2ter/utils-js';
6
6
  import Decimal from 'decimal.js';
7
7
  import { escapeLiteral, escapeIdentifier } from 'pg/lib/utils';
8
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-ikHjpb6F.mjs';
@@ -1023,15 +1023,17 @@ class PostgresClientDriver {
1023
1023
  return asyncStream(async function* () {
1024
1024
  const client = db instanceof Pool ? await db.connect() : db;
1025
1025
  const stream = new QueryStream(text, values, { batchSize });
1026
- client.query(stream);
1027
- try {
1028
- yield* stream;
1029
- }
1030
- finally {
1031
- stream.destroy();
1032
- if (db instanceof Pool)
1033
- client.release();
1034
- }
1026
+ yield* IteratorPool(Number.MAX_SAFE_INTEGER, async function* () {
1027
+ client.query(stream);
1028
+ try {
1029
+ yield* stream;
1030
+ }
1031
+ finally {
1032
+ stream.destroy();
1033
+ if (db instanceof Pool)
1034
+ client.release();
1035
+ }
1036
+ });
1035
1037
  });
1036
1038
  }
1037
1039
  async version() {