@pi-r/mysql 0.3.2 → 0.5.2

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Studio Trigger
1
+ Copyright 2023 Wit Studio
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pi-r/mysql
2
2
 
3
- PEP 402 - Forever Aina
3
+ PEP 402 - Forever Vivy
4
4
 
5
5
  ## LICENSE
6
6
 
package/client/index.d.ts CHANGED
@@ -6,6 +6,4 @@ import type { MySQLCredential, MySQLDataSource } from '../types';
6
6
 
7
7
  declare const MySQL: IDbSourceClient<MySQLDataSource> & {
8
8
  setAuthentication(this: IDb, credential: MySQLCredential): void;
9
- };
10
-
11
- export = MySQL;
9
+ };
package/client/index.js CHANGED
@@ -108,7 +108,7 @@ function setCredential(item) {
108
108
  if (!(pool = POOL_STATE[poolKey]) || pool.closed) {
109
109
  const config = this.getPoolConfig("mysql", password);
110
110
  if (config) {
111
- const { max, idle, queue_max } = config;
111
+ const { max, idle, queue_max, timeout } = config;
112
112
  if (max > 0) {
113
113
  credential.connectionLimit ?? (credential.connectionLimit = max);
114
114
  }
@@ -118,6 +118,9 @@ function setCredential(item) {
118
118
  if (queue_max >= 0) {
119
119
  credential.queueLimit ?? (credential.queueLimit = queue_max);
120
120
  }
121
+ if (timeout > 0) {
122
+ credential.connectTimeout ?? (credential.connectTimeout = timeout);
123
+ }
121
124
  }
122
125
  new MySQLPool(mysql.createPool(removeUUIDKey(credential)), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
123
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/mysql",
3
- "version": "0.3.2",
3
+ "version": "0.5.2",
4
4
  "description": "MySQL 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.6.1",
25
- "@e-mc/types": "^0.6.1",
24
+ "@e-mc/db": "^0.7.2",
25
+ "@e-mc/types": "^0.7.2",
26
26
  "mysql2": "^3.9.2"
27
27
  }
28
28
  }