@mikro-orm/oracledb 7.0.12-dev.1 → 7.0.12-dev.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/OracleConnection.js +13 -3
- package/package.json +3 -3
package/OracleConnection.js
CHANGED
|
@@ -7,10 +7,10 @@ export class OracleConnection extends AbstractSqlConnection {
|
|
|
7
7
|
const options = this.mapOptions(overrides);
|
|
8
8
|
const password = options.password;
|
|
9
9
|
const onCreateConnection = this.options.onCreateConnection ?? this.config.get('onCreateConnection');
|
|
10
|
+
const initialPassword = typeof password === 'function' ? await password() : password;
|
|
10
11
|
const poolOptions = {
|
|
11
12
|
...options,
|
|
12
|
-
|
|
13
|
-
password: typeof password === 'function' ? await password() : password,
|
|
13
|
+
password: initialPassword,
|
|
14
14
|
sessionCallback: onCreateConnection,
|
|
15
15
|
};
|
|
16
16
|
// Retry pool creation for transient Oracle errors (e.g. ORA-01017 under load)
|
|
@@ -48,8 +48,18 @@ export class OracleConnection extends AbstractSqlConnection {
|
|
|
48
48
|
return undefined;
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
|
+
// When password is a callback, wrap the pool to resolve it per-connection.
|
|
52
|
+
// oracledb supports per-connection password override via getConnection({ password }).
|
|
53
|
+
const wrappedPool = typeof password === 'function'
|
|
54
|
+
? {
|
|
55
|
+
async getConnection() {
|
|
56
|
+
return pool.getConnection({ password: await password() });
|
|
57
|
+
},
|
|
58
|
+
close: (drainTime) => pool.close(drainTime),
|
|
59
|
+
}
|
|
60
|
+
: pool;
|
|
51
61
|
return new OracleDialect({
|
|
52
|
-
pool,
|
|
62
|
+
pool: wrappedPool,
|
|
53
63
|
executeOptions: executeOptions,
|
|
54
64
|
});
|
|
55
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/oracledb",
|
|
3
|
-
"version": "7.0.12-dev.
|
|
3
|
+
"version": "7.0.12-dev.3",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite, MSSQL and Oracle databases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"copy": "node ../../scripts/copy.mjs"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@mikro-orm/sql": "7.0.12-dev.
|
|
45
|
+
"@mikro-orm/sql": "7.0.12-dev.3",
|
|
46
46
|
"kysely": "0.28.16",
|
|
47
47
|
"oracledb": "6.10.0"
|
|
48
48
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@mikro-orm/core": "^7.0.11"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@mikro-orm/core": "7.0.12-dev.
|
|
53
|
+
"@mikro-orm/core": "7.0.12-dev.3"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">= 22.17.0"
|