Oracle SSH
Sets up a Oracle connection inside an SSH tunnel.
API
.connect(obj sshConfig, obj oracleConfig)
sshConfig
should be an object according to thessh2
package.oracleConfig
should be an object according to theoracle
package.- Returns a Object, containing a
client
from theoracle
package andclose
function.
Usage
Don't forget to close()
the tunnel connection when you're done with oracle.
This is a working example put only your configuration and run example.js
const Oracle = ;const oracledb = ; { let connection; try connection = await Oracle; // Now the pool is running, it can be used const sql = `SELECT sysdate FROM dual WHERE :b = 1`; const binds = 1; const options = outFormat: oracledbOUT_FORMAT_OBJECT; const result = await connectionclient; console; catch err console; finally if connection try await connection; catch err throw err; }// Call function;