@e-mc/db 0.12.1 → 0.12.3
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/README.md +7 -7
- package/index.js +1 -0
- package/package.json +4 -4
- package/pool.js +5 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.12.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.12.2/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { DbDataSource } from "./squared";
|
|
@@ -34,7 +34,7 @@ interface IDb extends IClientDb<IHost, DbModule, DbDataSource, DbSourceOptions,
|
|
|
34
34
|
executeBatchQuery(batch: DbDataSource[], sessionKey: string, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
35
35
|
executeBatchQuery(batch: DbDataSource[], options?: ExecuteBatchQueryOptions | string, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
36
36
|
processRows(batch: DbDataSource[], tasks: Promise<QueryResult | null>[], parallel: boolean): Promise<BatchQueryResult>;
|
|
37
|
-
processRows(batch: DbDataSource[], tasks: Promise<QueryResult | null>[], options?: ProcessRowsOptions, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
37
|
+
processRows(batch: DbDataSource[], tasks: Promise<QueryResult | null>[], options?: ProcessRowsOptions | boolean, outResult?: BatchQueryResult): Promise<BatchQueryResult>;
|
|
38
38
|
handleFail(err: unknown, item: DbDataSource, options?: HandleFailOptions): boolean;
|
|
39
39
|
readTLSCert(value: unknown, cache?: boolean): string;
|
|
40
40
|
readTLSConfig(options: SecureContextOptions, cache?: boolean): void;
|
|
@@ -206,11 +206,11 @@ const [rows1, rows2] = await instance.executeBatchQuery([
|
|
|
206
206
|
|
|
207
207
|
## References
|
|
208
208
|
|
|
209
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
210
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
211
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
212
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
213
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
209
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/squared.d.ts
|
|
210
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/core.d.ts
|
|
211
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/db.d.ts
|
|
212
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/http.d.ts
|
|
213
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/settings.d.ts
|
|
214
214
|
|
|
215
215
|
* https://www.npmjs.com/package/@types/node
|
|
216
216
|
|
package/index.js
CHANGED
|
@@ -269,6 +269,7 @@ class Db extends core_1.ClientDb {
|
|
|
269
269
|
result.queue_max ??= config.queue_max;
|
|
270
270
|
result.queue_idle ??= config.queue_idle;
|
|
271
271
|
result.timeout ??= config.timeout;
|
|
272
|
+
result.server_timeout ??= config.server_timeout;
|
|
272
273
|
result.socket_timeout ??= config.socket_timeout;
|
|
273
274
|
}
|
|
274
275
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/db",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "DB modules for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.12.
|
|
24
|
-
"@e-mc/request": "0.12.
|
|
25
|
-
"@e-mc/types": "0.12.
|
|
23
|
+
"@e-mc/core": "0.12.3",
|
|
24
|
+
"@e-mc/request": "0.12.3",
|
|
25
|
+
"@e-mc/types": "0.12.3"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/pool.js
CHANGED
|
@@ -12,13 +12,16 @@ class DbPool {
|
|
|
12
12
|
return crypto.randomUUID();
|
|
13
13
|
}
|
|
14
14
|
static canCache(credential) {
|
|
15
|
+
if (credential.uuidKey) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
15
18
|
const properties = this.CACHE_IGNORE;
|
|
16
19
|
for (let i = 0, length = properties.length; i < length; ++i) {
|
|
17
20
|
if (credential[properties[i]] !== undefined) {
|
|
18
|
-
return
|
|
21
|
+
return false;
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
|
-
return
|
|
24
|
+
return true;
|
|
22
25
|
}
|
|
23
26
|
static sanitize(credential) {
|
|
24
27
|
const properties = this.CACHE_UNUSED;
|