{"id":17002019,"url":"https://github.com/sagiegurari/simple-oracledb","last_synced_at":"2025-10-26T01:03:01.236Z","repository":{"id":1764124,"uuid":"44295476","full_name":"sagiegurari/simple-oracledb","owner":"sagiegurari","description":"Extend capabilities of oracledb with simplified API for quicker development.","archived":false,"fork":false,"pushed_at":"2023-01-19T17:35:43.000Z","size":1007,"stargazers_count":36,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T22:00:37.764Z","etag":null,"topics":["database","nodejs","oracle","oracle-db"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagiegurari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-15T05:21:38.000Z","updated_at":"2023-09-23T14:08:28.000Z","dependencies_parsed_at":"2023-02-11T13:00:31.380Z","dependency_job_id":null,"html_url":"https://github.com/sagiegurari/simple-oracledb","commit_stats":null,"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fsimple-oracledb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fsimple-oracledb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fsimple-oracledb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fsimple-oracledb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagiegurari","download_url":"https://codeload.github.com/sagiegurari/simple-oracledb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858929,"owners_count":20359260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","nodejs","oracle","oracle-db"],"created_at":"2024-10-14T04:26:52.295Z","updated_at":"2025-10-26T01:03:01.150Z","avatar_url":"https://github.com/sagiegurari.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-oracledb\n\n[![NPM Version](http://img.shields.io/npm/v/simple-oracledb.svg?style=flat)](https://www.npmjs.org/package/simple-oracledb) [![CI](https://github.com/sagiegurari/simple-oracledb/workflows/CI/badge.svg?branch=master)](https://github.com/sagiegurari/simple-oracledb/actions) [![Coverage Status](https://coveralls.io/repos/sagiegurari/simple-oracledb/badge.svg)](https://coveralls.io/r/sagiegurari/simple-oracledb) [![Known Vulnerabilities](https://snyk.io/test/github/sagiegurari/simple-oracledb/badge.svg)](https://snyk.io/test/github/sagiegurari/simple-oracledb) [![Inline docs](http://inch-ci.org/github/sagiegurari/simple-oracledb.svg?branch=master)](http://inch-ci.org/github/sagiegurari/simple-oracledb) [![License](https://img.shields.io/npm/l/simple-oracledb.svg?style=flat)](https://github.com/sagiegurari/simple-oracledb/blob/master/LICENSE) [![Total Downloads](https://img.shields.io/npm/dt/simple-oracledb.svg?style=flat)](https://www.npmjs.org/package/simple-oracledb)\n\n\u003e Extend capabilities of oracledb with simplified API for quicker development.\n\n* [Overview](#overview)\n* [Usage](#usage)\n  * [OracleDB](#usage-oracledb)\n    * [Event: pool-created](#event-pool-created-oracledb)\n    * [Event: pool-released](#event-pool-released-oracledb)\n    * [Event: connection-created](#event-connection-created-oracledb)\n    * [Event: connection-released](#event-connection-released-oracledb)\n    * [createPool](#OracleDB-createpool)\n    * [run](#OracleDB+run)\n  * [Pool](#usage-pool)\n    * [Event: connection-created](#Pool+Event+connection-created)\n    * [Event: connection-released](#Pool+Event+connection-released)\n    * [Event: release](#Pool+Event+Pool-released)\n    * [getConnection](#Pool+getConnection)\n    * [run](#Pool+run)\n    * [parallelQuery](#Pool+parallelQuery)\n    * [terminate](#Pool+terminate)\n    * [close](#Pool+terminate)\n  * [Connection](#usage-connection)\n    * [Event: release](#event-connection-release)\n    * [query](#Connection+query)\n    * [insert](#Connection+insert)\n    * [update](#Connection+update)\n    * [queryJSON](#Connection+queryJSON)\n    * [batchInsert](#Connection+batchInsert)\n    * [batchUpdate](#Connection+batchUpdate)\n    * [transaction](#Connection+transaction)\n    * [run](#Connection+run)\n    * [executeFile](#Connection+executeFile)\n    * [release](#Connection+release)\n    * [close](#Connection+release)\n    * [rollback](#Connection+rollback)\n  * [SimpleOracleDB](#usage-simple-oracledb)\n    * [Event: pool-created](#event-pool-created-simpleoracledb)\n    * [Event: pool-released](#event-pool-released-simpleoracledb)\n    * [Event: connection-created](#event-connection-created-simpleoracledb)\n    * [Event: connection-released](#event-connection-released-simpleoracledb)\n    * [diagnosticInfo](#usage-diagnostic-info)\n    * [enableDiagnosticInfo](#usage-enable-diagnostic-info)\n  * [Extensions](#SimpleOracleDB+addExtension)\n    * [connection.upsert](#usage-extension-connection.upsert)\n* [Debug](#debug)\n* [Installation](#installation)\n* [Known Issues](#issues)\n* [API Documentation](docs/api.md)\n* [Contributing](.github/CONTRIBUTING.md)\n* [Release History](#history)\n* [License](#license)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n## Overview\nThis library enables to modify the oracledb main object, oracledb pool and oracledb connection of the [official oracle node.js driver](https://github.com/oracle/node-oracledb).\u003cbr\u003e\nThe main goal is to provide an extended oracledb connection which provides more functionality for most use cases.\u003cbr\u003e\nThe new functionality aim is to be simpler and more straightforward to enable quicker development.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\nIn order to use this library, you need to either extend the main oracledb object as follows:\n\n```js\n//load the oracledb library\nvar oracledb = require('oracledb');\n\n//load the simple oracledb\nvar SimpleOracleDB = require('simple-oracledb');\n\n//modify the original oracledb library\nSimpleOracleDB.extend(oracledb);\n\n//from this point connections fetched via oracledb.getConnection(...) or pool.getConnection(...)\n//have access to additional functionality.\noracledb.getConnection(function onConnection(error, connection) {\n    if (error) {\n        //handle error\n    } else {\n        //work with new capabilities or original oracledb capabilities\n        connection.query(...);\n    }\n});\n```\n\nAnother option is to modify your oracledb pool instance (in case the pool was created outside your code and\nout of your control), as follows:\n\n```js\n//load the simple oracledb\nvar SimpleOracleDB = require('simple-oracledb');\n\nfunction myFunction(pool) {\n    //modify the original oracledb pool instance\n    SimpleOracleDB.extend(pool);\n\n    //from this point connections fetched via pool.getConnection(...)\n    //have access to additional functionality.\n    pool.getConnection(function onConnection(error, connection) {\n        if (error) {\n          //handle error\n        } else {\n          //work with new capabilities or original oracledb capabilities\n          connection.query(...);\n        }\n    });\n}\n```\n\nOne last option is to modify your oracledb connection instance (in case the connection was created outside your code\nand out of your control), as follows:\n\n```js\n//load the simple oracledb\nvar SimpleOracleDB = require('simple-oracledb');\n\nfunction doSomething(connection, callback) {\n    //modify the original oracledb connection instance\n    SimpleOracleDB.extend(connection);\n\n    //from this point the connection has access to additional functionality as well as the original oracledb capabilities.\n    connection.query(...);\n}\n```\n\n\u003ca name=\"usage-oracledb\"\u003e\u003c/a\u003e\n## Class: OracleDB\n\n\u003ca name=\"event-pool-created-oracledb\"\u003e\u003c/a\u003e\n### Event: 'pool-created'\n\n* pool - The pool instance\n\nThis events is triggered when a pool is created.\n\n\u003ca name=\"event-pool-released-oracledb\"\u003e\u003c/a\u003e\n### Event: 'pool-released'\n\n* pool - The pool instance\n\nThis events is triggered after a pool is released.\n\n\u003ca name=\"event-connection-created-oracledb\"\u003e\u003c/a\u003e\n### Event: 'connection-created'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is created via oracledb.\n\n\u003ca name=\"event-connection-released-oracledb\"\u003e\u003c/a\u003e\n### Event: 'connection-released'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is released successfully.\n\n\u003ca name=\"OracleDB-createpool\"\u003e\u003c/a\u003e\n### 'oracledb.createPool(poolAttributes, [callback]) ⇒ [Promise]'\nThis function modifies the existing oracledb.createPool function by enhancing the returned pool to support retry in the getConnection function.\u003cbr\u003e\nThe pool.getConnection will retry configurable amount of times with configurable interval between attempts to return a connection in the getConnection function.\u003cbr\u003e\nIn case all attempts fail, the getConnection callback will receive the error object of the last attempt.\n\n```js\noracledb.createPool({\n  retryCount: 5, //The max amount of retries to get a connection from the pool in case of any error (default to 10 if not provided)\n  retryInterval: 500, //The interval in millies between get connection retry attempts (defaults to 250 millies if not provided)\n  runValidationSQL: true, //True to ensure the connection returned is valid by running a test validation SQL (defaults to true)\n  validationSQL: 'SELECT 1 FROM DUAL', //The test SQL to invoke before returning a connection to validate the connection is open (defaults to 'SELECT 1 FROM DUAL')\n  //any other oracledb pool attributes\n}, function onPoolCreated(error, pool) {\n  //continue flow\n});\n```\n\n\u003ca name=\"OracleDB+run\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'oracledb.run(connectionAttributes, action, [callback]) ⇒ [Promise]'\nThis function invokes the provided action (function) with a valid connection object and a callback.\u003cbr\u003e\nThe action can use the provided connection to run any connection operation/s (execute/query/transaction/...) and after finishing it\nmust call the callback with an error (if any) and result.\u003cbr\u003e\nFor promise support, the action can simply return a promise instead of calling the provided callback.\u003cbr\u003e\nThis function will ensure the connection is released properly and only afterwards will call the provided callback with the action error/result.\u003cbr\u003e\nThis function basically will remove the need of caller code to get and release a connection and focus on the actual database operation logic.\u003cbr\u003e\nIt is recommanded to create a pool and use the pool.run instead of oracledb.run as this function will create a new connection (and release it) for each invocation,\non the other hand, pool.run will reuse pool managed connections which will result in improved performance.\n\n**Example**\n```js\noracledb.run({\n user: process.env.ORACLE_USER,\n password: process.env.ORACLE_PASSWORD,\n connectString: process.env.ORACLE_CONNECTION_STRING\n}, function onConnection(connection, callback) {\n  //run some query and the output will be available in the 'run' callback\n  connection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110], callback);\n}, function onActionDone(error, result) {\n  //do something with the result/error\n});\n\noracledb.run({\n user: process.env.ORACLE_USER,\n password: process.env.ORACLE_PASSWORD,\n connectString: process.env.ORACLE_CONNECTION_STRING\n}, function (connection, callback) {\n  //run some database operations in a transaction\n  connection.transaction([\n    function firstAction(callback) {\n      connection.insert(...., callback);\n    },\n    function secondAction(callback) {\n      connection.update(...., callback);\n    }\n  ], {\n    sequence: true\n  }, callback); //at end of transaction, call the oracledb provided callback\n}, function onActionDone(error, result) {\n  //do something with the result/error\n});\n\n//full promise support for both oracledb.run and the action\noracledb.run({\n user: process.env.ORACLE_USER,\n password: process.env.ORACLE_PASSWORD,\n connectString: process.env.ORACLE_CONNECTION_STRING\n}, function (connection) {\n  //run some database operations in a transaction and return a promise\n  return connection.transaction([\n    function firstAction() {\n      return connection.insert(....); //returns a promise\n    },\n    function secondAction() {\n      return connection.update(....); //returns a promise\n    }\n  ]);\n}).then(function (result) {\n  //do something with the result\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"usage-pool\"\u003e\u003c/a\u003e\n## Class: Pool\n\n\u003ca name=\"Pool+Event+connection-created\"\u003e\u003c/a\u003e\n### Event: 'connection-created'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is created via pool.\n\n\u003ca name=\"Pool+Event+connection-released\"\u003e\u003c/a\u003e\n### Event: 'connection-released'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is released successfully.\n\n\u003ca name=\"Pool+Event+Pool-released\"\u003e\u003c/a\u003e\n### Event: 'release'\n\n* pool - The pool instance\n\nThis events is triggered after the pool is released successfully.\n\n\u003ca name=\"Pool+getConnection\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'pool.getConnection([callback]) ⇒ [Promise]'\nWraps the original oracledb getConnection in order to provide an extended connection object.\u003cbr\u003e\nIn addition, this function will attempt to fetch a connection from the pool and in case of any error will reattempt for a configurable amount of times.\u003cbr\u003e\nIt will also ensure the provided connection is valid by running a test SQL and if validation fails, it will fetch another connection (continue to reattempt).\u003cbr\u003e\nSee [getConnection](https://github.com/oracle/node-oracledb/blob/master/doc/api.md#getconnectionpool) for official API details.\u003cbr\u003e\nSee [createPool](https://github.com/sagiegurari/simple-oracledb/blob/master/docs/api.md#SimpleOracleDB.oracle.createPool) for extended createPool API details.\n\n**Example**\n```js\noracledb.createPool({\n  retryCount: 5, //The max amount of retries to get a connection from the pool in case of any error (default to 10 if not provided)\n  retryInterval: 500, //The interval in millies between get connection retry attempts (defaults to 250 millies if not provided)\n  runValidationSQL: true, //True to ensure the connection returned is valid by running a test validation SQL (defaults to true)\n  usePingValidation: true, //If runValidationSQL, this flag will define if validation should first attempt to use connection.ping instead of running a SQL\n  validationSQL: 'SELECT 1 FROM DUAL', //The test SQL to invoke before returning a connection to validate the connection is open (defaults to 'SELECT 1 FROM DUAL')\n  //any other oracledb pool attributes\n}, function onPoolCreated(error, pool) {\n  pool.getConnection(function onConnection(poolError, connection) {\n    //continue flow (connection, if provided, has been tested to ensure it is valid)\n  });\n});\n\n//another example but with promise support\noracledb.createPool({\n  retryCount: 5, //The max amount of retries to get a connection from the pool in case of any error (default to 10 if not provided)\n  retryInterval: 500, //The interval in millies between get connection retry attempts (defaults to 250 millies if not provided)\n  runValidationSQL: true, //True to ensure the connection returned is valid by running a test validation SQL (defaults to true)\n  usePingValidation: true, //If runValidationSQL, this flag will define if validation should first attempt to use connection.ping instead of running a SQL\n  validationSQL: 'SELECT 1 FROM DUAL', //The test SQL to invoke before returning a connection to validate the connection is open (defaults to 'SELECT 1 FROM DUAL')\n  //any other oracledb pool attributes\n}).then(function onPoolCreated(pool) {\n  pool.getConnection(function onConnection(poolError, connection) {\n    //continue flow (connection, if provided, has been tested to ensure it is valid)\n  });\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Pool+run\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'pool.run(action, [options], [callback]) ⇒ [Promise]'\nThis function invokes the provided action (function) with a valid connection object and a callback.\u003cbr\u003e\nThe action can use the provided connection to run any connection operation/s (execute/query/transaction/...) and after finishing it\nmust call the callback with an error (if any) and result.\u003cbr\u003e\nFor promise support, the action can simply return a promise instead of calling the provided callback.\u003cbr\u003e\nThe pool will ensure the connection is released properly and only afterwards will call the provided callback with the action error/result.\u003cbr\u003e\nThis function basically will remove the need of caller code to get and release a connection and focus on the actual database operation logic.\u003cbr\u003e\nFor extended promise support, the action provided can return a promise instead of calling the provided callback (see examples).\n\n**Example**\n```js\npool.run(function (connection, callback) {\n  //run some query and the output will be available in the 'run' callback\n  connection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110], callback);\n}, function onActionDone(error, result) {\n  //do something with the result/error\n});\n\npool.run(function (connection, callback) {\n  //run some database operations in a transaction\n  connection.transaction([\n    function firstAction(callback) {\n      connection.insert(...., callback);\n    },\n    function secondAction(callback) {\n      connection.update(...., callback);\n    }\n  ], {\n    sequence: true\n  }, callback); //at end of transaction, call the pool provided callback\n}, {\n  ignoreReleaseErrors: false //enable/disable ignoring any release error (default not to ignore)\n}, function onActionDone(error, result) {\n  //do something with the result/error\n});\n\n//another example but with promise support\npool.run(function (connection, callback) {\n  //run some query and the output will be available in the 'run' promise 'then'\n  connection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110], callback);\n}).then(function onActionDone(result) {\n  //do something with the result\n});\n\n//extended promise support (action is returning a promise instead of using the callback)\npool.run(function (connection) {\n  //run some query and the output will be available in the 'run' promise 'then'\n  return connection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110]); //no need for a callback, instead return a promise\n}).then(function onActionDone(result) {\n  //do something with the result\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Pool+parallelQuery\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'pool.parallelQuery(querySpec, [options], [callback]) ⇒ [Promise]'\nThis function invokes the requested queries in parallel (limiting it based on the amount of node.js thread pool size).\u003cbr\u003e\nIn order for the queries to run in parallel, multiple connections will be used so use this with caution.\n\n**Example**\n```js\npool.parallelQuery([\n  {\n    sql: 'SELECT department_id, department_name FROM departments WHERE manager_id = :id',\n    bindParams: [100],\n    options: {\n      //any options here\n    }\n  },\n  {\n    sql: 'SELECT * FROM employees WHERE manager_id = :id',\n    bindParams: {\n      id: 100\n    }\n  }\n], function onQueriesDone(error, results) {\n  //do something with the result/error\n  const query1Results = results[0];\n  const query2Results = results[1];\n});\n\n//another example but with promise support\npool.parallelQuery([\n  {\n    sql: 'SELECT department_id, department_name FROM departments WHERE manager_id = :id',\n    bindParams: [100],\n    options: {\n      //any options here\n    }\n  },\n  {\n    sql: 'SELECT * FROM employees WHERE manager_id = :id',\n    bindParams: {\n      id: 100\n    }\n  }\n]).then(function onQueriesDone(results) {\n  //do something with the result\n  const query1Results = results[0];\n  const query2Results = results[1];\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Pool+terminate\"\u003e\u003c/a\u003e\n### 'pool.terminate([callback]) ⇒ [Promise]'\n### 'pool.close([callback]) ⇒ [Promise]'\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\nThis function modifies the existing pool.terminate function by enabling the input\ncallback to be an optional parameter.\u003cbr\u003e\nSince there is no real way to release the pool that fails to be terminated, all that you can do in the callback\nis just log the error and continue.\u003cbr\u003e\nTherefore this function allows you to ignore the need to pass a callback and makes it as an optional parameter.\u003cbr\u003e\nThe pool.terminate also has an alias pool.close for consistent close function naming to all relevant objects.\n\n**Example**\n```js\npool.terminate(); //no callback needed\n\n//still possible to call with a terminate callback function\npool.terminate(function onTerminate(error) {\n  if (error) {\n    //now what?\n  }\n});\n\n//can also use close\npool.close();\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"usage-connection\"\u003e\u003c/a\u003e\n## Class: Connection\n\n\u003ca name=\"event-connection-release\"\u003e\u003c/a\u003e\n### Event: 'release'\nThis events is triggered when the connection is released successfully.\n\n\u003ca name=\"Connection+query\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.query(sql, [bindParams], [options], [callback]) ⇒ [ResultSetReadStream] \\| [Promise]'\nProvides simpler interface than the original oracledb connection.execute function to enable simple query invocation.\u003cbr\u003e\nThe callback output will be an array of objects, each object holding a property for each field with the actual value.\u003cbr\u003e\nAll LOBs will be read and all rows will be fetched.\u003cbr\u003e\nThis function is not recommended for huge results sets or huge LOB values as it will consume a lot of memory.\u003cbr\u003e\nThe function arguments used to execute the 'query' are exactly as defined in the oracledb connection.execute function.\n\n**Example**\n```js\n//read all rows and get an array of objects with all data\nconnection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110], function onResults(error, results) {\n  if (error) {\n    //handle error...\n  } else {\n    //print the 4th row DEPARTMENT_ID column value\n    console.log(results[3].DEPARTMENT_ID);\n  }\n});\n\n//same as previous example but with promise support\nconnection.query('SELECT department_id, department_name FROM departments WHERE manager_id \u003c :id', [110]).then(function (results) {\n  //print the 4th row DEPARTMENT_ID column value\n  console.log(results[3].DEPARTMENT_ID);\n});\n\n//In order to split results into bulks, you can provide the splitResults = true option.\n//The callback will be called for each bulk with array of objects.\n//Once all rows are read, the callback will be called with an empty array.\n//Promises are not supported with splitResults=true\nconnection.query('SELECT * FROM departments WHERE manager_id \u003e :id', [110], {\n  splitResults: true,\n  bulkRowsAmount: 100 //The amount of rows to fetch (for splitting results, that is the max rows that the callback will get for each callback invocation)\n}, function onResults(error, results) {\n  if (error) {\n    //handle error...\n  } else if (results.length) {\n    //handle next bulk of results\n  } else {\n    //all rows read\n  }\n});\n\n//In order to stream results into a read stream, you can provide the streamResults = true option.\n//The optional callback will be called with a read stream instance which can be used to fetch/pipe the data.\n//Once all rows are read, the proper stream events will be called.\nconst stream = connection.query('SELECT * FROM departments WHERE manager_id \u003e :id', [110], {\n  streamResults: true\n});\n\n//listen to fetched rows via data event or just pipe to another handler\nstream.on('data', function (row) {\n  //use row object\n\n  if (row.MY_ID === 800) {\n    stream.close(); //optionally call the close function to prevent any more 'data' events and free the connection to execute other operations\n  }\n});\n\n//optionally listen also to metadata of query\nstream.on('metadata', function (metaData) {\n  console.log(metaData);\n});\n\n//listen to other events such as end/close/error....\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+insert\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.insert(sql, [bindParams], [options], [callback]) ⇒ [Promise]'\nProvides simpler interface than the original oracledb connection.execute function to enable simple insert invocation with LOB support.\u003cbr\u003e\nThe callback output will be the same as oracledb connection.execute.\u003cbr\u003e\nAll LOBs will be written to the DB via streams and only after all LOBs are written the callback will be called.\u003cbr\u003e\nThe function arguments used to execute the 'insert' are exactly as defined in the oracledb connection.execute function, however the options are mandatory.\n\n**Example**\n```js\nconnection.insert('INSERT INTO mylobs (id, clob_column1, blob_column2) VALUES (:id, EMPTY_CLOB(), EMPTY_BLOB())', { //no need to specify the RETURNING clause in the SQL\n  id: 110,\n  clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n  blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n}, {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}, function onResults(error, output) {\n  //continue flow...\n});\n\n//add few more items to the RETURNING clause (only used if lobMetaInfo is provided)\nconnection.insert('INSERT INTO mylobs (id, clob_column1, blob_column2) VALUES (:myid, EMPTY_CLOB(), EMPTY_BLOB())', { //no need to specify the RETURNING clause in the SQL\n  myid: {\n    type: oracledb.NUMBER,\n    dir: oracledb.BIND_INOUT,\n    val: 1234\n  },\n  clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n  blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n}, {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  },\n  returningInfo: { //all items in this column/bind constiable object will be added to the generated RETURNING clause\n    id: 'myid'\n  }\n}, function onResults(error, output) {\n  //continue flow...\n});\n\n//another example but with promise support\nconnection.insert('INSERT INTO mylobs (id, clob_column1, blob_column2) VALUES (:id, EMPTY_CLOB(), EMPTY_BLOB())', { //no need to specify the RETURNING clause in the SQL\n  id: 110,\n  clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n  blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n}, {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}).then(function (results) {\n  console.log(results.rowsAffected);\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+update\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.update(sql, [bindParams], [options], [callback]) ⇒ [Promise]'\nProvides simpler interface than the original oracledb connection.execute function to enable simple update invocation with LOB support.\u003cbr\u003e\nThe callback output will be the same as oracledb connection.execute.\u003cbr\u003e\nAll LOBs will be written to the DB via streams and only after all LOBs are written the callback will be called.\u003cbr\u003e\nThe function arguments used to execute the 'update' are exactly as defined in the oracledb connection.execute function, however the options are mandatory.\n\n**Example**\n```js\nconnection.update('UPDATE mylobs SET name = :name, clob_column1 = EMPTY_CLOB(), blob_column2 = EMPTY_BLOB() WHERE id = :id', { //no need to specify the RETURNING clause in the SQL\n  id: 110,\n  name: 'My Name',\n  clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n  blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n}, {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}, function onResults(error, output) {\n  //continue flow...\n});\n\n//another example but with promise support\nconnection.update('UPDATE mylobs SET name = :name, clob_column1 = EMPTY_CLOB(), blob_column2 = EMPTY_BLOB() WHERE id = :id', { //no need to specify the RETURNING clause in the SQL\n  id: 110,\n  name: 'My Name',\n  clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n  blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n}, {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}).then(function (results) {\n  console.log(results.rowsAffected);\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+queryJSON\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.queryJSON(sql, [bindParams], [options], [callback]) ⇒ [Promise]'\nThis function will invoke the provided SQL SELECT and return a results object with the returned row count and the JSONs.\u003cbr\u003e\nThe json property will hold a single JSON object in case the returned row count is 1, and an array of JSONs in case the row count is higher.\u003cbr\u003e\nThe query expects that only 1 column is fetched and if more are detected in the results, this function will return an error in the callback.\u003cbr\u003e\nThe function arguments used to execute the 'queryJSON' are exactly as defined in the oracledb connection.execute function.\n\n**Example**\n```js\nconnection.queryJSON('SELECT JSON_DATA FROM APP_CONFIG WHERE ID \u003e :id', [110], function onResults(error, results) {\n  if (error) {\n    //handle error...\n  } else if (results.rowCount === 1) { //single JSON is returned\n    //print the JSON\n    console.log(results.json);\n  } else if (results.rowCount \u003e 1) { //multiple JSONs are returned\n    //print the JSON\n    results.json.forEach(function printJSON(json) {\n      console.log(json);\n    });\n  } else {\n    console.log('Did not find any results');\n  }\n});\n\n//another example but with promise support\nconnection.queryJSON('SELECT JSON_DATA FROM APP_CONFIG WHERE ID \u003e :id', [110]).then(function (results) {\n  if (results.rowCount === 1) { //single JSON is returned\n    //print the JSON\n    console.log(results.json);\n  } else if (results.rowCount \u003e 1) { //multiple JSONs are returned\n    //print the JSON\n    results.json.forEach(function printJSON(json) {\n      console.log(json);\n    });\n  }\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+batchInsert\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.batchInsert(sql, bindParamsArray, options, [callback]) ⇒ [Promise]'\nEnables to run an INSERT SQL statement multiple times for each of the provided bind params.\u003cbr\u003e\nThis allows to insert to same table multiple different rows with one single call.\u003cbr\u003e\nThe callback output will be an array of objects of same as oracledb connection.execute (per row).\u003cbr\u003e\nAll LOBs for all rows will be written to the DB via streams and only after all LOBs are written the callback will be called.\u003cbr\u003e\nThe function arguments used to execute the 'insert' are exactly as defined in the oracledb connection.execute function, however the options are mandatory and\nthe bind params is now an array of bind params (one per row).\n\n**Example**\n```js\nconnection.batchInsert('INSERT INTO mylobs (id, clob_column1, blob_column2) VALUES (:id, EMPTY_CLOB(), EMPTY_BLOB())', [ //no need to specify the RETURNING clause in the SQL\n  { //first row values\n    id: 110,\n    clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n    blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n  },\n  { //second row values\n    id: 111,\n    clobText1: 'second row',\n    blobBuffer2: new Buffer('second rows')\n  }\n], {\n  autoCommit: true, //must be set to true in options to support auto commit after insert is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}, function onResults(error, output) {\n  //continue flow...\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+batchUpdate\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.batchUpdate(sql, bindParamsArray, options, [callback]) ⇒ [Promise]'\nEnables to run an UPDATE SQL statement multiple times for each of the provided bind params.\u003cbr\u003e\nThis allows to update to same table multiple different rows with one single call.\u003cbr\u003e\nThe callback output will be an array of objects of same as oracledb connection.execute (per row).\u003cbr\u003e\nAll LOBs for all rows will be written to the DB via streams and only after all LOBs are written the callback will be called.\u003cbr\u003e\nThe function arguments used to execute the 'update' are exactly as defined in the oracledb connection.execute function, however the options are mandatory and\nthe bind params is now an array of bind params (one per row).\n\n**Example**\n```js\nconnection.batchUpdate('UPDATE mylobs SET name = :name, clob_column1 = EMPTY_CLOB(), blob_column2 = EMPTY_BLOB() WHERE id = :id', [ //no need to specify the RETURNING clause in the SQL\n  { //first row values\n    id: 110,\n    clobText1: 'some long clob string', //add bind constiable with LOB column name and text content (need to map that name in the options)\n    blobBuffer2: new Buffer('some blob content, can be binary...')  //add bind constiable with LOB column name and text content (need to map that name in the options)\n  },\n  { //second row values\n    id: 111,\n    clobText1: 'second row',\n    blobBuffer2: new Buffer('second rows')\n  }\n], {\n  autoCommit: true, //must be set to true in options to support auto commit after update is done, otherwise the auto commit will be false (oracledb.autoCommit is not checked)\n  lobMetaInfo: { //if LOBs are provided, this data structure must be provided in the options object and the bind constiables parameter must be an object (not array)\n    clob_column1: 'clobText1', //map oracle column name to bind constiable name\n    blob_column2: 'blobBuffer2'\n  }\n}, function onResults(error, output) {\n  //continue flow...\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+transaction\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.transaction(actions, [options], [callback]) ⇒ [Promise]'\nEnables to run multiple oracle operations in a single transaction.\u003cbr\u003e\nThis function basically allows to automatically commit or rollback once all your actions are done.\u003cbr\u003e\nActions are basically javascript functions which get a callback when invoked, and must call that callback with error or result.\u003cbr\u003e\nFor promise support, actions can simply return a promise instead of using the provided callback.\u003cbr\u003e\nAll provided actions are executed in sequence unless options.sequence=false is provided (parallel invocation is only for IO operations apart of the oracle driver as the driver will queue operations on same connection).\u003cbr\u003e\nOnce all actions are done, in case of any error in any action, a rollback will automatically get invoked, otherwise a commit will be invoked.\u003cbr\u003e\nOnce the rollback/commit is done, the provided callback will be invoked with the error (if any) and results of all actions.\u003cbr\u003e\nWhen calling any connection operation (execute, insert, update, ...) the connection will automatically set the autoCommit=false and will ignore the value provided.\u003cbr\u003e\nThis is done to prevent commits in the middle of the transaction.\u003cbr\u003e\nIn addition, you can not start a transaction while another transaction is in progress.\n\n**Example**\n```js\n//run all actions in parallel\nconnection.transaction([\n  function insertSomeRows(callback) {\n    connection.insert(...., function (error, results) {\n      //some more inserts....\n      connection.insert(...., callback);\n    });\n  },\n  function insertSomeMoreRows(callback) {\n    connection.insert(...., callback);\n  },\n  function doSomeUpdates(callback) {\n    connection.update(...., callback);\n  },\n  function runBatchUpdates(callback) {\n    connection.batchUpdate(...., callback);\n  }\n], {\n  sequence: false\n}, function onTransactionResults(error, output) {\n  //continue flow...\n});\n\n//run all actions in sequence\nconnection.transaction([\n  function firstAction(callback) {\n    connection.insert(...., callback);\n  },\n  function secondAction(callback) {\n    connection.update(...., callback);\n  }\n], {\n  sequence: true\n}, function onTransactionResults(error, output) {\n  //continue flow...\n});\n\n//another example but with promise support\nconnection.transaction([\n  function firstAction(callback) {\n    connection.insert(...., callback);\n  },\n  function secondAction(callback) {\n    connection.update(...., callback);\n  }\n], {\n  sequence: true\n}).then(function onTransactionResults(output) {\n  //continue flow...\n});\n\n//actions can return a promise instead of using callback (you can mix actions to either use callback or return a promise)\nconnection.transaction([\n  function firstAction() {\n    return connection.insert(....); //return a promise\n  },\n  function secondAction() {\n    return connection.update(....); //return a promise\n  }\n], {\n  sequence: true\n}).then(function onTransactionResults(output) {\n  //continue flow...\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+run\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.run(actions, [options], [callback]) ⇒ [Promise]'\nEnables to run multiple oracle operations in sequence or parallel.\u003cbr\u003e\nActions are basically javascript functions which get a callback when invoked, and must call that callback with error or result.\u003cbr\u003e\nFor promise support, actions can simply return a promise instead of using the provided callback.\u003cbr\u003e\nAll provided actions are executed in sequence unless options.sequence=false is provided (parallel invocation is only for IO operations apart of the oracle driver as the driver will queue operations on same connection).\u003cbr\u003e\nThis function is basically the same as connection.transaction with few exceptions\u003cbr\u003e\n\u003cul\u003e\n  \u003cli\u003eThis function will \u003cb\u003enot\u003c/b\u003e auto commit/rollback or disable any commits/rollbacks done by the user\u003c/li\u003e\n  \u003cli\u003eYou can invoke connection.run inside connection.run as many times as needed (for example if you execute connection.run with option.sequence=false meaning parallel and inside invoke connection.run with option.sequence=true for a subset of operations)\u003c/li\u003e\n\u003c/ul\u003e\n\n**Example**\n```js\n//run all actions in parallel\nconnection.run([\n  function insertSomeRows(callback) {\n    connection.insert(...., function (error, results) {\n      //some more inserts....\n      connection.insert(...., callback);\n    });\n  },\n  function insertSomeMoreRows(callback) {\n    connection.insert(...., callback);\n  },\n  function doSomeUpdates(callback) {\n    connection.update(...., callback);\n  },\n  function runBatchUpdates(callback) {\n    connection.batchUpdate(...., callback);\n  }\n], {\n  sequence: false\n}, function onActionsResults(error, output) {\n  //continue flow...\n});\n\n//run all actions in sequence\nconnection.run([\n  function firstAction(callback) {\n    connection.insert(...., callback);\n  },\n  function secondAction(callback) {\n    connection.update(...., callback);\n  }\n], {\n  sequence: true\n}, function onActionsResults(error, output) {\n  //continue flow...\n});\n\n//run some actions in sequence and a subset in parallel\nconnection.run([\n  function firstAction(callback) {\n    connection.insert(...., callback);\n  },\n  function secondAction(callback) {\n    connection.update(...., callback);\n  },\n  function subsetInParallel(callback) {\n    //run all actions in parallel\n    connection.run([\n      function insertSomeRows(subsetCallback) {\n        connection.insert(...., function (error, results) {\n          //some more inserts....\n          connection.insert(...., subsetCallback);\n        });\n      },\n      function insertSomeMoreRows(subsetCallback) {\n        connection.insert(...., subsetCallback);\n      },\n      function doSomeUpdates(subsetCallback) {\n        connection.update(...., subsetCallback);\n      },\n      function runBatchUpdates(subsetCallback) {\n        connection.batchUpdate(...., subsetCallback);\n      }\n    ], {\n      sequence: false\n    }, callback); //all parallel actions done, call main callback\n  }\n], {\n  sequence: true\n}, function onActionsResults(error, output) {\n  //continue flow...\n});\n\n//another example but with promise support\nconnection.run([\n  function firstAction(callback) {\n    connection.insert(...., callback);\n  },\n  function secondAction(callback) {\n    connection.update(...., callback);\n  }\n], {\n  sequence: true\n}).then(function onActionsResults(output) {\n  //continue flow...\n});\n\n//actions can return a promise instead of using callback (you can mix actions to either use callback or return a promise)\nconnection.run([\n  function firstAction() {\n    return connection.insert(....); //return a promise\n  },\n  function secondAction() {\n    return connection.update(....); //return a promise\n  }\n], {\n  sequence: true\n}).then(function onActionsResults(output) {\n  //continue flow...\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+executeFile\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.executeFile(file, [options], [callback]) ⇒ [Promise]'\nReads the sql string from the provided file and executes it.\u003cbr\u003e\nThe file content must be a single valid SQL command string.\u003cbr\u003e\nThis function is basically a quick helper to reduce the coding needed to read the sql file.\n\n**Example**\n```js\nconnection.executeFile('./populate_table.sql', function onResults(error, results) {\n  if (error) {\n    //handle error...\n  } else {\n    //continue\n  }\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+release\"\u003e\u003c/a\u003e\n### 'connection.release([options], [callback]) ⇒ [Promise]'\n### 'connection.close([options], [callback]) ⇒ [Promise]'\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\nThis function modifies the existing connection.release function by enabling the input\ncallback to be an optional parameter and providing ability to auto retry in case of any errors during release.\u003cbr\u003e\nThe connection.release also has an alias connection.close for consistent close function naming to all relevant objects.\n\n**Example**\n```js\nconnection.release(); //no callback needed\n\n//still possible to call with a release callback function\nconnection.release(function onRelease(error) {\n  if (error) {\n    //now what?\n  }\n});\n\n//retry release in case of errors is enabled if options are provided\nconnection.release({\n  retryCount: 20, //retry max 20 times in case of errors (default is 10 if not provided)\n  retryInterval: 1000 //retry every 1 second (default is 250 millies if not provided)\n});\n\n//you can provide both retry options and callback (callback will be called only after all retries are done or in case connection was released)\nconnection.release({\n  retryCount: 10,\n  retryInterval: 250,\n  force: true //break any running operation before running release\n}, function onRelease(error) {\n  if (error) {\n    //now what?\n  }\n});\n\n//can also use close instead of release\nconnection.close({\n  retryCount: 10,\n  retryInterval: 250\n}, function onRelease(error) {\n  if (error) {\n    //now what?\n  }\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"Connection+rollback\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'connection.rollback([callback]) ⇒ [Promise]'\nThis function modifies the existing connection.rollback function by enabling the input\ncallback to be an optional parameter.\u003cbr\u003e\nIf rollback fails, you can't really rollback again the data, so the callback is not always needed.\u003cbr\u003e\nTherefore this function allows you to ignore the need to pass a callback and makes it as an optional parameter.\n\n**Example**\n```js\nconnection.rollback(); //no callback needed\n\n//still possible to call with a rollback callback function\nconnection.rollback(function onRollback(error) {\n  if (error) {\n    //now what?\n  }\n});\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\n\u003ca name=\"usage-simple-oracledb\"\u003e\u003c/a\u003e\n## Class: SimpleOracleDB\n\n\u003ca name=\"event-pool-created-simpleoracledb\"\u003e\u003c/a\u003e\n### Event: 'pool-created'\n\n* pool - The pool instance\n\nThis events is triggered when a pool is created.\n\n\u003ca name=\"event-pool-released-simpleoracledb\"\u003e\u003c/a\u003e\n### Event: 'pool-released'\n\n* pool - The pool instance\n\nThis events is triggered after a pool is released.\n\n\u003ca name=\"event-connection-created-simpleoracledb\"\u003e\u003c/a\u003e\n### Event: 'connection-created'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is created via oracledb.\n\n\u003ca name=\"event-connection-released-simpleoracledb\"\u003e\u003c/a\u003e\n### Event: 'connection-released'\n\n* connection - The connection instance\n\nThis events is triggered when a connection is released successfully.\n\n\u003ca name=\"usage-diagnostic-info\"\u003e\u003c/a\u003e\n### 'SimpleOracleDB.diagnosticInfo'\nThe pool/connection diagnostics info.\u003cbr\u003e\nThis includes info of all live pools (including live time and create time) and all live connections (including parent pool if any, live time, create time and last SQL)\n\n\u003ca name=\"usage-enable-diagnostic-info\"\u003e\u003c/a\u003e\n### 'SimpleOracleDB.enableDiagnosticInfo'\nTrue if the monitoring is enabled and it will listen and store pool/connection diagnostics information.\u003cbr\u003e\nBy default this is set to false.\n\n\u003ca name=\"SimpleOracleDB+addExtension\"\u003e\u003c/a\u003e\n\u003c!-- markdownlint-disable MD009 MD031 MD036 --\u003e\n### 'SimpleOracleDB.addExtension(type, name, extension, [options]) ⇒ Boolean'\nAdds an extension to all newly created objects of the requested type.\u003cbr\u003e\nAn extension, is a function which will be added to any pool or connection instance created after the extension was added.\u003cbr\u003e\nThis function enables external libraries to further extend oracledb using a very simple API and without the need to wrap the pool/connection creation functions.\u003cbr\u003e\nExtension functions automatically get promisified unless specified differently in the optional options.\n\n**Example**\n```js\n//define a new function for all new connection objects called 'myConnFunc' which accepts 2 arguments\nSimpleOracleDB.addExtension('connection', 'myConnFunc', function (myParam1, myParam2, callback) {\n  //implement some custom functionality...\n\n  callback();\n});\n\n//get connection (via oracledb directly or via pool) and start using the new function\nconnection.myConnFunc('test', 123, function () {\n  //continue flow...\n});\n\n//extensions are automatically promisified (can be disabled) so you can also run extension functions without callback\nconst promise = connection.myConnFunc('test', 123);\npromise.then(function () {\n  //continue flow...\n}).catch(function (error) {\n  //got some error...\n});\n\n//define a new function for all new pool objects called 'myPoolFunc'\nSimpleOracleDB.addExtension('pool', 'myPoolFunc', function () {\n  //implement some custom functionality\n});\n\n//get pool and start using the new function\npool.myPoolFunc();\n```\n\u003c!-- markdownlint-enable MD009 MD031 MD036 --\u003e\n\nAn example of an existing extension can be found at: [oracledb-upsert](https://github.com/sagiegurari/oracledb-upsert) which adds the connection.upsert (insert/update) functionality.\n\n\u003ca name=\"usage-extension-connection.upsert\"\u003e\u003c/a\u003e\n### 'connection.upsert(sqls, bindParams, [options], [callback]) ⇒ [Promise]'\nSee [oracledb-upsert](https://github.com/sagiegurari/oracledb-upsert) for more info.\n\n\u003cbr\u003e\n**The rest of the API is the same as defined in the oracledb library: https://github.com/oracle/node-oracledb/blob/master/doc/api.md**\n\n\u003ca name=\"debug\"\u003e\u003c/a\u003e\n## Debug\nIn order to turn on debug messages, use the standard nodejs NODE_DEBUG environment variable.\n\n````ini\nNODE_DEBUG=simple-oracledb\n````\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\nIn order to use this library, just run the following npm install command:\n\n```sh\nnpm install --save simple-oracledb\n```\n\nThis library doesn't define oracledb as a dependency and therefore it is not installed when installing simple-oracledb.\u003cbr\u003e\nYou should define oracledb in your package.json and install it based on the oracledb installation instructions found at: [installation guide](https://github.com/oracle/node-oracledb/blob/master/INSTALL.md)\n\n\u003ca name=\"issues\"\u003e\u003c/a\u003e\n## Known Issues\n\n* oracledb version 1.7.0 breaks the API and prevents the library from being extended. This was fixed in oracledb 1.7.1 ([oracledb case](https://github.com/oracle/node-oracledb/issues/369))\n\n## API Documentation\nSee full docs at: [API Docs](docs/api.md)\n\n## Contributing\nSee [contributing guide](.github/CONTRIBUTING.md)\n\n\u003ca name=\"history\"\u003e\u003c/a\u003e\n## Release History\n\n| Date        | Version | Description |\n| ----------- | ------- | ----------- |\n| 2021-10-22  | v3.0.0  | Add null binding support, update constants with latest changes and do not break by default after run is done |\n| 2020-05-13  | v2.0.0  | Migrate to github actions and upgrade minimal node version |\n| 2019-05-25  | v1.4.2  | Maintenance |\n| 2019-01-25  | v1.4.0  | useExecuteMany=true by default |\n| 2018-09-23  | v1.3.0  | Added executeMany support for the batch APIs |\n| 2018-04-14  | v1.2.2  | Performance improvement for pooled connection fetching (#23) |\n| 2017-01-20  | v1.1.57 | connection.run, connection.transaction and oracledb.run actions can now return a promise instead of using a callback |\n| 2017-01-14  | v1.1.56 | pool.run actions now can return a promise instead of using a callback |\n| 2016-12-28  | v1.1.50 | Added pool.parallelQuery which enables parallel queries using multiple connections |\n| 2016-11-15  | v1.1.41 | Added connection.executeFile to read SQL statement from file and execute it |\n| 2016-10-07  | v1.1.26 | Added oracledb.run |\n| 2016-08-15  | v1.1.2  | Added 'metadata' event for connection.query with streaming |\n| 2016-08-10  | v1.1.0  | Breaking change connection.run and connection.transaction default is now sequence instead of parallel |\n| 2016-08-09  | v1.0.2  | Added connection.run |\n| 2016-08-07  | v0.1.98 | NODE_DEBUG=simple-oracledb will now also log all SQL statements and bind params for the connection.execute function |\n| 2016-08-05  | v0.1.96 | Extensions are now automatically promisified |\n| 2016-08-05  | v0.1.95 | Added promise support for all library APIs |\n| 2016-07-26  | v0.1.84 | Add integration test via docker |\n| 2016-07-24  | v0.1.83 | Add support for node-oracledb promise |\n| 2016-07-17  | v0.1.80 | Add support for node-oracledb promise |\n| 2016-07-14  | v0.1.79 | Fixed possible max stack size error |\n| 2016-05-01  | v0.1.57 | Added the new monitor (SimpleOracleDB.diagnosticInfo and SimpleOracleDB.enableDiagnosticInfo) and SimpleOracleDB is now an event emitter |\n| 2016-03-31  | v0.1.51 | Added new stream.close function to stop streaming data and free the connection for more operations |\n| 2016-03-03  | v0.1.40 | Connection and Pool are now event emitters |\n| 2016-03-02  | v0.1.38 | Added new force option for connection.release/close |\n| 2016-02-28  | v0.1.37 | Added SimpleOracleDB.addExtension which allows to further extend oracledb |\n| 2016-02-22  | v0.1.32 | Added new pool.run operation |\n| 2016-02-16  | v0.1.29 | new optional options.returningInfo to insert/update/batch to enable to modify the returning/into clause when using LOBs |\n| 2016-02-12  | v0.1.26 | Added sequence option for connection.transaction and added pool.close=pool.terminate, connection.close=connection.release aliases |\n| 2016-02-10  | v0.1.23 | Adding debug logs via NODE_DEBUG=simple-oracledb |\n| 2016-02-09  | v0.1.20 | connection.release now supports retry options |\n| 2016-01-22  | v0.1.18 | Fixed missing call to resultset.close after done reading |\n| 2016-01-12  | v0.1.8  | Avoid issues with oracledb stream option which is based on this library |\n| 2016-01-07  | v0.1.7  | connection.query with streamResults=true returns a readable stream |\n| 2015-12-30  | v0.1.6  | connection.transaction disables commit/rollback while running |\n| 2015-12-29  | v0.1.4  | Added connection.transaction |\n| 2015-12-29  | v0.1.3  | Added connection.batchUpdate |\n| 2015-12-22  | v0.1.2  | Added streaming of query results with new option streamResults=true |\n| 2015-12-21  | v0.1.1  | Rename streamResults to splitResults |\n| 2015-12-21  | v0.0.35 | New bulkRowsAmount option to manage query resultset behaviour |\n| 2015-12-21  | v0.0.34 | Added splitting of query results into bulks with new option splitResults=true |\n| 2015-12-08  | v0.0.24 | Added pool.getConnection connection validation via running SQL test command |\n| 2015-11-17  | v0.0.17 | Added pool.getConnection automatic retry |\n| 2015-11-15  | v0.0.16 | Added connection.batchInsert and connection.rollback |\n| 2015-10-20  | v0.0.10 | Added connection.queryJSON |\n| 2015-10-19  | v0.0.9  | autoCommit support when doing INSERT/UPDATE with LOBs |\n| 2015-10-19  | v0.0.7  | Added pool.terminate |\n| 2015-10-18  | v0.0.5  | Added connection.update |\n| 2015-10-18  | v0.0.4  | Added connection.insert |\n| 2015-10-15  | v0.0.1  | Initial release. |\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\nDeveloped by Sagie Gur-Ari and licensed under the Apache 2 open source license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fsimple-oracledb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagiegurari%2Fsimple-oracledb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fsimple-oracledb/lists"}