{"id":47938135,"url":"https://github.com/abbvie-external/oracle-helpers","last_synced_at":"2026-04-04T07:54:42.439Z","repository":{"id":57688006,"uuid":"491674241","full_name":"abbvie-external/oracle-helpers","owner":"abbvie-external","description":"A collection of helpers for alleviating boilerplate in node with OracleDB","archived":false,"fork":false,"pushed_at":"2025-12-11T22:50:50.000Z","size":2508,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T07:54:40.395Z","etag":null,"topics":["nodejs","oracledb","sql"],"latest_commit_sha":null,"homepage":"https://abbvie-external.github.io/oracle-helpers/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbvie-external.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-12T21:33:38.000Z","updated_at":"2025-12-11T22:50:53.000Z","dependencies_parsed_at":"2024-10-13T22:30:22.457Z","dependency_job_id":"41b5c873-2997-4e51-a1cf-3b3d45c6d375","html_url":"https://github.com/abbvie-external/oracle-helpers","commit_stats":{"total_commits":120,"total_committers":2,"mean_commits":60.0,"dds":0.35,"last_synced_commit":"71d18672d321eb8ac705537e473fc60d2dd82f1f"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/abbvie-external/oracle-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbvie-external%2Foracle-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbvie-external%2Foracle-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbvie-external%2Foracle-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbvie-external%2Foracle-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbvie-external","download_url":"https://codeload.github.com/abbvie-external/oracle-helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbvie-external%2Foracle-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nodejs","oracledb","sql"],"created_at":"2026-04-04T07:54:39.658Z","updated_at":"2026-04-04T07:54:42.419Z","avatar_url":"https://github.com/abbvie-external.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oracle Helpers\n\nA collection of helpers for alleviating boilerplate in OracleDB projects\n\n[Usage](#usage)\n[SQL Template Tag](#SQL-Template-Tag)\n[Typescript](#typescript)\n\n## Note:\n\nThis package sets `fetchAsBuffer` and `fetchAsString` automatically. This will be changed in the next major version to avoid unexpected side-effects!\n\n```js\noracledb.fetchAsBuffer = [oracledb.BLOB];\noracledb.fetchAsString = [oracledb.CLOB];\n```\n\n# Installation\n\nInstall using\n\n```\nnpm install oracle-helpers\n```\n\n### API Page\n\nhttps://abbvie-external.github.io/oracle-helpers/\n\n# Options\n\n## Pools\n\n### Pool Defaults\n\nPool Defaults lets you set the behavior of the generated pools. These will not automatically reconfigure the pools when changed unless you close the pool first to re-create it. If you want to change the pool settings after the initial creation of the pool without closing and re-making the pool, use `getPool` and the `Pool#reconfigure` method.\n\nTo set the defaults for all future pools, use `setPoolDefaults` with `undefined` as the first parameter\n\n```js\nimport { setPoolDefaults } from 'oracle-helpers';\n\nsetPoolDefaults(undefined, {\n  expireTime: 1,\n  connectTimeout: 10,\n  poolMin: 12,\n  poolMax: 20,\n  poolTimeout: 120,\n});\nconst globalDefaults = getPoolDefaults(undefined);\n\nexport const dbConfig = {\n  /* ... */\n};\n\nsetPoolDefaults(dbConfig, {\n  poolMin: 12,\n  poolMax: 20,\n  poolTimeout: 120,\n});\n\nconst curDefaults = getPoolDefaults(dbConfig);\n```\n\n### Pool `configuration` - Deprecated\n\nConfiguration lets you set up certain behaviors to customize how the pools work outside of oracle\n\nThis is deprecated and will be removed in the future! Use [Pool Defaults](#pool-defaults) instead\n\n```js\nimport { configuration } from 'oracle-helpers';\n/**\n * The number of ms between the sending of keep alive probes. If this property is set to a value greater than zero, it enables the keep alive probes\n *\n * set to `undefined` to ignore these settings\n * @deprecated For thin mode with oracledb v6+, use `setPoolDefaults` to set `expireTime` instead.\n *\n * For thick mode with oracle 19c+, use an Easy Connect string or a Connect Descriptor string. the property is `EXPIRE_TIME`\n */\nconfiguration.pingTime = 60000; // 1 minute\n/**\n * The timeout duration in ms for an application to establish an Oracle Net connection.\n *\n * set to `undefined` to ignore these settings\n * @deprecated For thin mode with oracledb v6+, use `setPoolDefaults` to set `connectTimeout` instead.\n *\n * For thick mode with oracle 19c+, use an Easy Connect string or a Connect Descriptor string. the property is `CONNECT_TIMEOUT`\n */\nconfiguration.connectionTimeout = 10000; // 10 seconds\n```\n\n## Debug Logging\n\nFor improved debugging, you can set up a function to log the errors from oracle with the sql and parameters\n\n```js\nimport { setSqlErrorLogger } from 'oracle-helpers';\n\nif (process.env.NODE_ENV === 'development') {\n  setSqlErrorLogger((error, sql, params) =\u003e {\n    console.error(error, sql, params);\n  });\n}\n```\n\n# Usage\n\n## `sql` Tagged Template Vs Sql Text + Params:\n\n```ts\nimport { sql, getSql, getSqlPool } from 'oracle-helpers';\n\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\n\n// sql tagged template!\nconst query = sql`SELECT * FROM TABLE where ID=${5}`;\n\ngetSql\u003c{ ID: number; NAME: string }[]\u003e(dbConfig, query).then((rows) =\u003e {\n  console.log(rows);\n});\n\n// sql text + params:\nconst sqlText = `SELECT * FROM TABLE where ID=:id`;\n\ngetSql\u003c{ ID: number; NAME: string }[]\u003e(dbConfig, sqlText, { id: 5 }).then(\n  (rows) =\u003e {\n    console.log(rows);\n  },\n);\n\n// sql tagged template with params (for syntax highlighting only):\nconst query2 = sql`SELECT * FROM TABLE where ID=:id`;\n\ngetSql\u003c{ ID: number; NAME: string }[]\u003e(dbConfig, query2.sql, { id: 5 }).then(\n  (rows) =\u003e {\n    console.log(rows);\n  },\n);\n```\n\n## Getters\n\n```ts\nimport { sql, getSql, getSqlPool } from 'oracle-helpers';\n\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\nconst query = sql`SELECT * FROM TABLE where ID=${5}`;\n\ngetSql\u003c{ ID: number; NAME: string }[]\u003e(dbConfig, query).then((rows) =\u003e {\n  console.log(rows);\n});\n\ngetSqlPool\u003c{ ID: number; NAME: string }[]\u003e(dbConfig, query).then((rows) =\u003e {\n  console.log(rows);\n});\n```\n\n## Mutations\n\n```ts\nimport {\n  sql,\n  mutateSql,\n  mutateSqlPool,\n  mutateManySql,\n  mutateManySqlPool,\n} from 'oracle-helpers';\n\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\n\nconst runSql = async () =\u003e {\n  const query = `INSERT INTO TABLE (ID, NAME) VALUES (:id, :name)`;\n\n  await mutateSql(dbConfig, query, { id: 5, name: 'test' });\n\n  await mutateSqlPool(dbConfig, query, { id: 6, name: 'test2' });\n\n  await mutateManySql(dbConfig, query, [\n    { id: 7, name: 'test3' },\n    { id: 8, name: 'test4' },\n  ]);\n\n  await mutateManySqlPool(dbConfig, query, [\n    { id: 8, name: 'test5' },\n    { id: 9, name: 'test6' },\n  ]);\n};\n\n// Using the full tagged template query with different values than what was started with doesn't work, so use mutateMany if you need multiple values at once:\n\nconst runSql = async () =\u003e {\n  const query = sql`INSERT INTO TABLE (ID, NAME)\n                    VALUES (${[7, 8, 9, 10]},\n                            ${['test', 'test2', 'test3', 'test4']}\n                          )`;\n  await mutateManySql(dbConfig, query);\n};\n```\n\n## toBindDefs\n\nYou can use `toBindDefs` to automatically set up bind definitions from the values from the Sql template tag result.\n\nThis is especially important in `mutateMany` in which you can't include the bind definitions as part of the parameters (due to how Node Oracledb works).\n\nThis means that if you want to use `returning` in mutateMany, you need to set up the whole bind definitions object yourself. And that's what `toBindDefs` helps solve.\n\n```ts\nimport OracleDB from 'oracledb';\nimport { mutateManySqlPool, toBindDefs } from 'oracle-helpers';\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\n\nconst runSql = async () =\u003e {\n  const query = sql`INSERT INTO books (author, genre) values(${[\n    'bob',\n    'joe',\n    'bill',\n  ]}, ${'fantasy'}) RETURNING id into :id`;\n  // Important to pull values out of query ahead of time to avoid extra calculations.\n  const { values, sql: sqlQuery } = query;\n  const result = await mutateManySqlPool\u003c{ id: [number] }\u003e(\n    dbConfig,\n    sqlQuery,\n    values,\n    {\n      bindDefs: toBindDefs(values, {\n        id: {\n          dir: OracleDB.BIND_OUT,\n          type: OracleDB.NUMBER,\n        },\n      }),\n    },\n  );\n  const ids = results.outBinds.map(({ id }) =\u003e id[0]);\n  console.log('newIds:', ids);\n};\n```\n\n## Advanced\n\nRun multiple mutations with a get inbetween in a single all-or-nothing transaction including returning a value from an insert.\n\n```ts\nimport { STRING, NUMBER, BIND_OUT, BIND_IN } from 'oracledb';\nimport { getPoolConnection, getSql, mutateSql } from 'oracle-helpers';\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\nconst sql = `INSERT INTO TABLE (ID, NAME) VALUES (ID_SEQ.NEXT_VAL, :name) returning ID into :id`;\nconst selectSql = `SELECT * FROM TABLE where ID=:id`;\n\nconst runSql = async () =\u003e {\n  const connection = await getPoolConnection(dbConfig);\n\n  try {\n    const result = await mutateSql\u003c{ id: number[] }\u003e(\n      connection,\n      sql,\n      {\n        name: 'test',\n      },\n      {\n        bindDefs: {\n          name: { type: STRING, dir: BIND_IN },\n          id: { type: NUMBER, dir: BIND_OUT },\n        },\n      },\n    );\n\n    const id = result.outBinds.id[0];\n\n    const row = await getSql(connection, selectSql, { id })[0];\n\n    const insertMultipleSql = `INSERT INTO TABLE_TERM (TABLE_ID, TERM_ID, TERM) VALUES (:tableId, ID_SEQ.NEXT_VAL, :term)`;\n\n    const terms = [\n      'Yes',\n      'No',\n      'Maybe',\n      'Y',\n      'N',\n      'M',\n      'Yeah',\n      'Nah',\n      'Aye',\n      'Nay',\n    ];\n\n    await mutateManySql(\n      connection,\n      insertMultipleSql,\n      terms.map((term) =\u003e ({ tableId: id, term })),\n      {\n        autoCommit: true, // Make it commit upon success.\n      },\n    );\n  } finally {\n    // Close the connection. This should only be necessary on success, as if there's an error it'll automatically rollback/close the connection before propagating the error\n    connection.close();\n  }\n};\n```\n\n### Advanced with the tagged template:\n\n```ts\nimport { STRING, NUMBER, BIND_IN, BIND_OUT } from 'oracledb';\nimport {\n  sql,\n  getPoolConnection,\n  getSql,\n  mutateSql,\n  toBindDefs,\n} from 'oracle-helpers';\nconst dbConfig = {\n  user: 'username',\n  password: 'password',\n  connectString: 'oracle db connection string',\n};\n\nconst runSql = async () =\u003e {\n  const connection = await getPoolConnection(dbConfig);\n\n  try {\n    const value = 'test';\n\n    const result = await mutateSql\u003c{ id: number[] }\u003e(\n      connection,\n      sql`INSERT INTO TABLE (ID, NAME)\n        VALUES (ID_SEQ.NEXT_VAL,${value})\n        returning ID into ${{\n          dir: BIND_OUT,\n          type: NUMBER,\n          name: 'id',\n        }}`,\n    );\n\n    const id = result.outBinds.id[0];\n\n    const selectSql = sql`SELECT * FROM TABLE where ID=${id}`;\n\n    const row = await getSql(connection, selectSql)[0];\n\n    const terms = [\n      'Yes',\n      'No',\n      'Maybe',\n      'Y',\n      'N',\n      'M',\n      'Yeah',\n      'Nah',\n      'Aye',\n      'Nay',\n    ];\n\n    const insertMultipleSql = sql`INSERT INTO TABLE_TERM\n           (TABLE_ID, TERM_ID, TERM)\n    VALUES (${id}, ID_SEQ.NEXT_VAL, ${terms}) returning TERM_ID into :termId`;\n    const results = await mutateManySql\u003c{ termId: [number] }\u003e(\n      connection,\n      insertMultipleSql,\n      {\n        autoCommit: true, // Make it commit upon success.\n        bindDefs: toBindDefs(values, {\n          termId: { dir: BIND_OUT, type: NUMBER },\n        }),\n      },\n    );\n    const termIds = results.outBinds.map(({ termId }) =\u003e termId[0]);\n    return termIds;\n  } finally {\n    // Close the connection - Very important!\n    connection.close();\n  }\n};\n```\n\n# SQL Template Tag\n\n\u003e ES2015 tagged template string for preparing SQL statements, integrated with this oracle helpers library.\n\n### Modified from:\n\nhttps://github.com/blakeembrey/sql-template-tag\n\n## Extension for syntax highlighting (basic):\n\nhttps://marketplace.visualstudio.com/items?itemName=thebearingedge.vscode-sql-lit\n\nThis one has more issues in my experience:\n\nhttps://marketplace.visualstudio.com/items?itemName=frigus02.vscode-sql-tagged-template-literals-syntax-only\n\n## Usage\n\n```ts\nimport { sql, empty, join, raw, getSql, mutateManySql } from 'oracle-helpers';\n\nconst query = sql`SELECT * FROM books WHERE id = ${id}`;\n\nquery.sql; //=\u003e \"SELECT * FROM books WHERE id = $1\"\nquery.values; //=\u003e {1: id}\n\ngetSql(dbConfig, query.sql, query.values);\n\n// Embed SQL instances inside SQL instances.\nconst nested = sql`SELECT id FROM authors WHERE name = ${'Blake'}`;\nconst query = sql`SELECT * FROM books WHERE author_id IN (${nested})`;\n\n// Join and \"empty\" helpers (useful for nested queries).\nsql`SELECT * FROM books ${hasIds ? sql`WHERE ids IN (${join(ids)})` : empty}`;\n\n// Mutate Many\nconst mutation = sql`INSERT INTO books (author, genre) values(${[\n  'bob',\n  'joe',\n  'bill',\n]}, ${['fantasy', 'historical', 'romance']})`;\nmutateManySql(dbConfig, mutation.sql, mutation.values);\n```\n\nWithout the rest of oracle-helpers (assuming node16+ resolution):\n\n```ts\nimport { sql } from 'oracle-helpers/sql';\nimport oracledb from 'oracledb';\n\nconst query = sql`SELECT * FROM books where id = ${3}`;\n\nconst connection = await oracledb.getConnection(dbConfig);\ntry {\n  const { rows: books } = await connection.execute(query.sql, query.values, {\n    outFormat: oracledb.OUT_FORMAT_OBJECT,\n    resultSet: false,\n  });\n  // do something with books here\n} finally {\n  await connection.close();\n}\n```\n\n### Join\n\nAccepts an array of values and returns an `Sql` instance with the values joined by a separator.\n\n#### `Sql#join` method\n\nIn `Sql#join`, the separator is the `Sql` instance that the method is called on.\n\n```js\nconst query = sql`,`.join([1, 2, 3]);\n\nquery.sql; //=\u003e \":1, :2, :3\"\nquery.values; //=\u003e {1: 1, 2: 2, 3: 3}\n```\n\nIt can also be used to create dynamic SQL by joining multiple values together.\n\n```js\nconst queries = [sql`one = ${1}`, sql`two = ${2}`, sql`three = ${3}`];\nconst filters = sql` AND `.join(queries);\nconst result = sql`select * from table ${\n  queries.length ? sql`WHERE ${filters}` : empty\n} ORDER BY two`;\nresult.sql; //=\u003e \"select * from table WHERE one = :1 AND two = :2 AND three = :3 ORDER BY two\"\nresult.values; //=\u003e {1: 1, 2: 2, 3: 3}\n```\n\nBy making a quick helper, you can simplify this use case:\n\n```js\nfunction joinWhere(filters, useAndAfter = false) {\n  if (useAndAfter) {\n    filters = filters.concat(empty);\n  }\n  if (filters.length) {\n    return `WHERE ${join(filters.concat(empty), ' AND ')}`;\n  }\n}\nconst queries = [sql`one = ${1}`, sql`two = ${2}`, sql`three = ${3}`];\nconst result = sql`select * from table ${joinWhere(queries)} ORDER BY two`;\n```\n\n#### `join` Function\n\nThe standalone `join` function takes the separator as the second argument, with `,` as the default separator\n\n```js\nimport { join } from 'oracle-helpers';\n\nconst query = join([1, 2, 3]);\n\nquery.sql; //=\u003e \":1, :2, :3\"\nquery.values; //=\u003e {1: 1, 2: 2, 3: 3}\n```\n\nIt can also be used to create dynamic SQL by joining multiple values together.\n\n```js\nconst queries = [sql`one = ${1}`, sql`two = ${2}`, sql`three = ${3}`];\nconst filters = join(queries, ' AND ');\nconst result = sql`select * from table ${\n  filters === empty ? empty : sql`WHERE ${filters}`\n} ORDER BY two`;\nresult.sql; //=\u003e \"select * from table WHERE one = :1 AND two = :2 AND three = :3 ORDER BY two\"\nresult.values; //=\u003e {1: 1, 2: 2, 3: 3}\n```\n\nBy making a quick helper, you can simplify this use case:\n\n```js\nfunction joinWhere(filters, useAndAfter = false) {\n  if (useAndAfter) {\n    filters = filters.concat(empty);\n  }\n  if (filters.length) {\n    return `WHERE ${sql` AND `.join(filters.concat(empty))}`;\n  }\n}\nconst queries = [sql`one = ${1}`, sql`two = ${2}`, sql`three = ${3}`];\nconst result = sql`select * from table ${joinWhere(queries)} ORDER BY two`;\n```\n\n### Raw\n\nAccepts a string and returns a SQL instance, useful if you want some part of the SQL to be dynamic.\n\n**Do not** accept raw user input to `raw`, this will create a SQL injection vulnerability!\n\n```js\nraw('SELECT'); // equivalent to: sql`SELECT`\n```\n\n```js\nconst input = 'devUsers';\nconst TABLES = new Map([\n  ['users', 'ENV.USERS'],\n  ['devUsers', 'DEV_ENV.USERS'],\n]);\nsql`SELECT * FROM ${raw(TABLES.get(input))}`; // equivalent to sql`SELECT * FROM DEV_ENV.USERS`\n```\n\n### Empty\n\nSimple placeholder value for an empty SQL string. Equivalent to `raw('')`.\n\nYou can use this to great effect when creating dynamic SQL.\n\n```ts\n/**\n * if the value passed in is a boolean, treat it as empty\n *\n * great for ensuring short-circuiting behavior while still being more readable than nested ternaries directly\n */\nfunction sqlBool(sql: boolean | RawValue) {\n  return typeof sql === 'boolean' ? empty : sql;\n}\n\nconst isUpdate = false;\nsql`${sqlBool(isUpdate \u0026\u0026 sql`UPDATE Test WHERE ...`)}`;\n```\n\n## Related\n\nSome other modules exist that do something similar but for the wrong form of sql! Every flavour does variables differently:\n\n- [`sql-template-tag`](https://github.com/blakeembrey/sql-template-tag): The origin for this part of the module. - supports postgres, mysql, and oracledb. - not as integrated with oracle\n- [`node-sql-template-strings`](https://github.com/felixfbecker/node-sql-template-strings): promotes mutation via chained methods and lacks nesting SQL statements. - supports postgres and mysql\n- [`pg-template-tag`](https://github.com/XeCycle/pg-template-tag): missing TypeScript and MySQL support. By supporting `pg` only, it has the ability to [dedupe `values`](https://github.com/XeCycle/pg-template-tag/issues/5#issuecomment-386875336). - That's where I got the idea to dedupe values in this fork.\n\n# Typescript\n\nAll the sql helper functions have generics for type definitions of the return values. The generics don't affect the actual return values, so it is up to you to keep them accurate for your returns.\n\n## Utility types\n\n### `ToDBType`\n\nThe `ToDBType` utility type will convert an object to a representation of it that would be returned from the database. It changes any objects/arrays to `string`s. If you want to convert them to something else, you can use the third template parameter (`ObjectType`) to change the behavior. `Date`s will remain `Date` objects as Oracledb does return dates as dates. That is configurable by passing in `true` for the `DateString` argument which will also convert `Date`s to `string`s.\n\n```ts\ntype Foo = {\n  a: number;\n  b?: string[];\n  c: { id: number; value: string };\n  d: Date;\n};\ntype FooDB = ToDBType\u003cFoo\u003e;\n//=\u003e {\n// \ta: number;\n// \tb: string | null;\n// \tc: string;\n// \td: Date;\n//}\ntype FooDBNoDate = ToDBType\u003cFoo, true\u003e;\n//=\u003e {\n// \ta: number;\n// \tb: string | null;\n// \tc: string;\n// \td: string;\n//}\ntype FooDBBufferNoDate = ToDBType\u003cFoo, true, Buffer\u003e;\n//=\u003e {\n// \ta: number;\n// \tb: Buffer | null;\n// \tc: Buffer;\n// \td: string;\n//}\n```\n\n## Type Guards\n\n### `isDBError`\n\nThe `isDBError` is a convenience function for duck-typing if an error is an Oracle DBError as node-oracledb doesn't expose one.\n\n```ts\ntry {\n} catch (error) {\n  if (isDBError(error)) {\n    // TS knows that this is a DBError type from node-oracledb\n  }\n}\n```\n\n# Development\n\n## Environment\n\nThis package has tests (src/tests/sqlHelpers.spec.ts) which are reliant on a OracleDB instance existing. However, it doesn't create the instance, so in order to run the tests fully, there are 3 environment variables needed to connect to the DB for running the tests:\n\n```env\nNODE_ORACLEDB_CONNECTION_STRING\nNODE_ORACLEDB_USER\nNODE_ORACLEDB_PASSWORD\n```\n\n## Commits\n\nCommits need to be in the Conventional Commit form for automatic changelog generation\n\n## Publishing\n\nIn order to publish, run `npm run prepare-release` then run `git push --follow-tags origin main \u0026\u0026 npm publish` to publish.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbvie-external%2Foracle-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbvie-external%2Foracle-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbvie-external%2Foracle-helpers/lists"}