@mikro-orm/mysql 7.1.0-dev.2 → 7.1.0-dev.20

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.
@@ -11,12 +11,18 @@ export class MySqlConnection extends AbstractSqlConnection {
11
11
  const innerPool = createPool({ ...options, password: initialPassword });
12
12
  // mysql2 reads pool.config.connectionConfig.password when creating new physical
13
13
  // connections, so updating it before getConnection() ensures fresh tokens are used.
14
- // Existing idle connections are already authenticated and unaffected.
14
+ // Existing idle connections are already authenticated and unaffected, so we skip
15
+ // the callback when the pool has a free connection to reuse.
15
16
  const pool = {
16
17
  getConnection(cb) {
18
+ const inner = innerPool;
19
+ if ((inner._freeConnections?.length ?? 0) > 0) {
20
+ innerPool.getConnection(cb);
21
+ return;
22
+ }
17
23
  Promise.resolve(password())
18
24
  .then(pw => {
19
- innerPool.config.connectionConfig.password = pw;
25
+ inner.config.connectionConfig.password = pw;
20
26
  innerPool.getConnection(cb);
21
27
  })
22
28
  .catch(err => cb(err, undefined));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mysql",
3
- "version": "7.1.0-dev.2",
3
+ "version": "7.1.0-dev.20",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -47,16 +47,16 @@
47
47
  "copy": "node ../../scripts/copy.mjs"
48
48
  },
49
49
  "dependencies": {
50
- "@mikro-orm/sql": "7.1.0-dev.2",
50
+ "@mikro-orm/sql": "7.1.0-dev.20",
51
51
  "kysely": "0.28.16",
52
- "mysql2": "3.22.1",
52
+ "mysql2": "3.22.2",
53
53
  "sqlstring": "2.3.3"
54
54
  },
55
55
  "devDependencies": {
56
- "@mikro-orm/core": "^7.0.11"
56
+ "@mikro-orm/core": "^7.0.12"
57
57
  },
58
58
  "peerDependencies": {
59
- "@mikro-orm/core": "7.1.0-dev.2"
59
+ "@mikro-orm/core": "7.1.0-dev.20"
60
60
  },
61
61
  "engines": {
62
62
  "node": ">= 22.17.0"