node-oracledb 6 is a ‘Thin’ mode JavaScript driver for Node.js and Oracle Database
We have just released node-oracledb 6, a major version update of our Node.js driver for Oracle Database. The driver is now a pure JavaScript driver by default, meaning you don’t need to install Oracle Client libraries. This makes installation trivial. It also means it can run in environments where Oracle Instant Client libraries aren’t available, or aren’t easy to install. Distribution of applications become a lot easier, smaller, and more portable.
Check out the node-oracledb 6.0 release announcement from my colleague Sharad Chandran.
Installation is a simple:
npm install oracledb
and then you can run an application:
const oracledb = require('oracledb');
async function run() {
const connection = await oracledb.getConnection({
user: 'cj',
password: process.env.NODE_ORACLEDB_PASSWORD,
connectString: 'localhost/freepdb1'
});
const result = await connection.execute(`SELECT CURRENT_DATE FROM DUAL`);
console.dir(result.rows, { depth: null });
await connection.close();
}
run();
You can write JavaScript or Typescript applications for Node.js.
If you have an existing application, and don’t need the optional, additional Thick mode functionality, then you can remove calls to initOracleClient()
since this enables Thick mode and loads Oracle Client libraries.
Node-oracledb 6.0 follows on from our recent python-oracledb driver which also doesn’t need Oracle Client libraries by default. Note that for both node-oracledb and python-oracledb some additional, advanced Oracle Database functionality is available if you do use Oracle Client libraries.
Node-oracledb Resources
Home page: https://oracle.github.io/node-oracledb/
Installation: https://node-oracledb.readthedocs.io/en/latest/user_guide/installation.html
Documentation: https://node-oracledb.readthedocs.io/en/latest/
Questions: https://github.com/oracle/node-oracledb/discussions/
Source code: https://github.com/oracle/node-oracledb
Npm repository: https://www.npmjs.com/package/oracledb