@pi-r/postgres 0.12.4 → 0.13.0

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.
Files changed (2) hide show
  1. package/client/index.js +4 -3
  2. package/package.json +5 -5
package/client/index.js CHANGED
@@ -138,9 +138,9 @@ async function executeBatchQuery(batch, options = '', outResult) {
138
138
  if (length === 0) {
139
139
  return [];
140
140
  }
141
- let parallel, connectOnce, errorQuery, sessionKey, outCacheMiss;
141
+ let parallel, connectOnce, errorQuery, errorAsEmpty, sessionKey, outCacheMiss;
142
142
  if (isPlainObject(options)) {
143
- ({ parallel, connectOnce, errorQuery, sessionKey, outCacheMiss } = options);
143
+ ({ parallel, connectOnce, errorQuery, errorAsEmpty, sessionKey, outCacheMiss } = options);
144
144
  }
145
145
  else {
146
146
  if (typeof options === 'string') {
@@ -236,7 +236,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
236
236
  const cacheValue = ignoreCache === undefined ? sessionKey : Array.isArray(ignoreCache) ? { sessionKey, exclusiveOf: ignoreCache } : { sessionKey, renewCache: ignoreCache === 0 };
237
237
  let queryString = '', cacheCredential;
238
238
  if (caching && ignoreCache !== true) {
239
- queryString = Db.asString(query, true) + '_' + Db.asString(params, true) + (streamRow && item.options && isString(query) ? Db.asString(item.options, true) : '');
239
+ queryString = streamRow && item.options && isString(query) ? Db.keyForResult(query, params, item.options) : Db.keyForResult(query, params);
240
240
  cacheCredential = DbPool.sanitize(credential, sortKeys);
241
241
  if (ignoreCache !== 1) {
242
242
  const result = this.getQueryResult(source, cacheCredential, queryString, cacheValue);
@@ -330,6 +330,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
330
330
  }
331
331
  return this.processRows(batch, tasks, {
332
332
  parallel,
333
+ errorAsEmpty,
333
334
  disconnect: () => {
334
335
  for (const item of clients) {
335
336
  item.end(err => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/postgres",
3
- "version": "0.12.4",
3
+ "version": "0.13.0",
4
4
  "description": "PostgreSQL client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "license": "MIT",
18
18
  "homepage": "https://github.com/anpham6/pi-r#readme",
19
19
  "dependencies": {
20
- "@e-mc/db": "^0.14.5",
21
- "@e-mc/types": "^0.14.5",
22
- "pg": "^8.22.0",
20
+ "@e-mc/db": "^0.14.6",
21
+ "@e-mc/types": "^0.14.6",
22
+ "pg": "^8.23.0",
23
23
  "pg-connection-string": "^2.14.0",
24
- "pg-query-stream": "^4.16.0"
24
+ "pg-query-stream": "^4.17.0"
25
25
  }
26
26
  }