Skip to content

Commit 63d8bb5

Browse files
committed
Added support for easy connect string entries in tnsnames.ora file (See Issue #1644)
1 parent 0a00f90 commit 63d8bb5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ node-oracledb `v6.5.0 <https://github.com/oracle/node-oracledb/compare/v6.4.0...
1313
Thin Mode Changes
1414
++++++++++++++++++
1515

16+
#) Added support for easy connect string entries in tnsnames.ora
17+
See `Issue #1644 <https://github.com/oracle/node-oracledb/issues/1644>`__.
18+
1619
#) Added support for Oracle Database 23c feature that can improve the
1720
performance of connection creation by reducing the number of
1821
round trips required for all connections created.

lib/thin/sqlnet/networkSession.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ async function resolveConnectStr(connectString, configDir) {
8383
resolvedVal = p.get(connStr.toUpperCase());
8484
if (!resolvedVal)
8585
errors.throwErr(errors.ERR_TNS_ENTRY_NOT_FOUND, connStr, configDir ? configDir + '/tnsnames.ora' : process.env.TNS_ADMIN + '/tnsnames.ora');
86+
if (resolvedVal.rhsType == 1) {
87+
const rString = resolvedVal.atom;
88+
if ((rString.indexOf(':') != -1) || (rString.indexOf('/') != -1)) {
89+
return new EzConnect(rString).getResolvedUrl();
90+
}
91+
}
8692
resolvedVal = resolvedVal.getListElement(0);
8793
}
8894

0 commit comments

Comments
 (0)