@pi-r/mssql 0.6.0 → 0.6.1

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/client/index.js CHANGED
@@ -346,10 +346,9 @@ async function executeBatchQuery(batch, options = '', outResult) {
346
346
  }
347
347
  item.transactionState = 1 /* DB_TRANSACTION.ACTIVE */;
348
348
  const streamRow = typeof item.streamRow === 'string' ? this.hasCoerce("mssql" /* STRINGS.MODULE_NAME */, 'options', null, credential) && (0, types_1.asFunction)(item.streamRow) : item.streamRow;
349
- const renewCache = ignoreCache === 0;
350
- const cacheValue = renewCache ? { sessionKey, renewCache } : sessionKey;
349
+ const cacheValue = ignoreCache === undefined ? sessionKey : Array.isArray(ignoreCache) ? { sessionKey, exclusiveOf: ignoreCache } : { sessionKey, renewCache: ignoreCache === 0 };
351
350
  let params = item.params, queryString = '';
352
- if ((caching && ignoreCache !== true || ignoreCache === false || ignoreCache === 1 || renewCache) && !streamRow) {
351
+ if (caching && ignoreCache !== true && !streamRow) {
353
352
  queryString = Db.asString(query, true) + '_' + Db.asString(params, true);
354
353
  if (ignoreCache !== 1) {
355
354
  const result = this.getQueryResult(source, credential, queryString, cacheValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/mssql",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "MSSQL client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://github.com/anpham6/pi-r#readme",
23
23
  "dependencies": {
24
- "@e-mc/db": "^0.8.0",
25
- "@e-mc/types": "^0.8.0",
24
+ "@e-mc/db": "^0.8.1",
25
+ "@e-mc/types": "^0.8.1",
26
26
  "tedious": "^16.6.1",
27
27
  "tedious-connection-pool2": "^2.1.0"
28
28
  }
package/types/index.d.ts CHANGED
@@ -2,7 +2,9 @@ import type { DbDataSource } from '@e-mc/types/lib/squared';
2
2
 
3
3
  import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
4
4
 
5
+ // @ts-ignore
5
6
  import type { ConnectionConfig, ParameterOptions, TediousType, TediousTypes } from 'tedious';
7
+ // @ts-ignore
6
8
  import type { PoolConfig } from 'tedious-connection-pool';
7
9
 
8
10
  export interface MSSQLDataSource extends DbDataSource<string, unknown, unknown, string | MSSQLCredential, string | PoolConfig>, ExecuteAction<MSSQLRequestParameters | MSSQLRequestWithOutputParameters> {