@pi-r/azure 0.12.5 → 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 -4
  2. package/package.json +1 -1
package/client/index.js CHANGED
@@ -233,10 +233,10 @@ async function executeBatchQuery(credential, batch, sessionKey) {
233
233
  throw formatError(item, name ? "Missing database table" : "Missing database name");
234
234
  }
235
235
  cacheValue.exclusiveOf = Array.isArray(ignoreCache) ? ignoreCache : undefined;
236
- let rows, queryString = caching && ignoreCache !== true ? name + '_' + table + '_' : '';
236
+ let rows, queryString = caching && ignoreCache !== true ? Cloud.keyForResult(name, table) : '';
237
237
  if (storedProcedureId && params) {
238
238
  const { options } = item;
239
- if (queryString && (rows = this.getCacheResult(service, credential, queryString += (partitionKey ? Cloud.asString(partitionKey, true) : '') + '_' + storedProcedureId + '_' + Cloud.asString(params, true) + Cloud.asString(options, true), cacheValue, ignoreCache))) {
239
+ if (queryString && (rows = this.getCacheResult(service, credential, queryString = Cloud.keyForResult(queryString, partitionKey, storedProcedureId, params, options), cacheValue, ignoreCache))) {
240
240
  result[i] = rows;
241
241
  continue;
242
242
  }
@@ -248,7 +248,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
248
248
  else if (id) {
249
249
  const { update, options } = item;
250
250
  if (queryString) {
251
- queryString += (partitionKey ? Cloud.asString(partitionKey, true) : '') + '_' + id + '_' + Cloud.asString(options, true);
251
+ queryString = Cloud.keyForResult(queryString, partitionKey, id, options);
252
252
  if (!update && (rows = this.getCacheResult(service, credential, queryString, cacheValue, ignoreCache))) {
253
253
  result[i] = rows;
254
254
  continue;
@@ -285,7 +285,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
285
285
  queryString = '';
286
286
  }
287
287
  else if (queryString) {
288
- queryString += (query ? Cloud.asString(query, true) : '') + Cloud.asString(options, true);
288
+ queryString = Cloud.keyForResult(queryString, query, options);
289
289
  if (!update && (rows = this.getCacheResult(service, credential, queryString, cacheValue, ignoreCache))) {
290
290
  result[i] = rows;
291
291
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/azure",
3
- "version": "0.12.5",
3
+ "version": "0.13.0",
4
4
  "description": "Azure cloud functions for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "repository": {