{"id":13836168,"url":"https://github.com/cemremengu/fastify-oracle","last_synced_at":"2026-02-25T18:03:19.894Z","repository":{"id":57233338,"uuid":"118928564","full_name":"cemremengu/fastify-oracle","owner":"cemremengu","description":"Attaches an oracledb connection pool to a Fastify server instance.","archived":false,"fork":false,"pushed_at":"2020-05-11T17:14:01.000Z","size":134,"stargazers_count":14,"open_issues_count":6,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-18T13:35:20.563Z","etag":null,"topics":["fastify","fastify-plugin","oracledb"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cemremengu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-25T15:11:16.000Z","updated_at":"2024-10-08T07:42:04.000Z","dependencies_parsed_at":"2022-08-31T14:11:27.335Z","dependency_job_id":null,"html_url":"https://github.com/cemremengu/fastify-oracle","commit_stats":null,"previous_names":["jsumners/fastify-oracle"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/cemremengu/fastify-oracle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemremengu%2Ffastify-oracle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemremengu%2Ffastify-oracle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemremengu%2Ffastify-oracle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemremengu%2Ffastify-oracle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cemremengu","download_url":"https://codeload.github.com/cemremengu/fastify-oracle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemremengu%2Ffastify-oracle/sbom","scorecard":{"id":270735,"data":{"date":"2025-08-11","repo":{"name":"github.com/cemremengu/fastify-oracle","commit":"e095cdb9275e995ed4b34435cd148d512636ae92"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T13:17:02.720Z","repository_id":57233338,"created_at":"2025-08-17T13:17:02.720Z","updated_at":"2025-08-17T13:17:02.720Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29833680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T17:57:15.019Z","status":"ssl_error","status_checked_at":"2026-02-25T17:56:11.472Z","response_time":61,"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":["fastify","fastify-plugin","oracledb"],"created_at":"2024-08-04T15:00:37.210Z","updated_at":"2026-02-25T18:03:19.878Z","avatar_url":"https://github.com/cemremengu.png","language":"JavaScript","readme":"# fastify-oracle\n[![Greenkeeper badge](https://badges.greenkeeper.io/cemremengu/fastify-oracle.svg)](https://greenkeeper.io/)\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/cemremengu/fastify-oracle.svg?branch=master)](https://travis-ci.org/cemremengu/fastify-oracle) [![Coverage Status](https://coveralls.io/repos/github/cemremengu/fastify-oracle/badge.svg?branch=master)](https://coveralls.io/github/cemremengu/fastify-oracle?branch=master)\n\nThis module provides access to an Oracle database connection pool via the\n[oracledb](https://npm.im/oracledb) module. It decorates the [Fastify](https://fastify.io)\ninstance with an `oracle` property that is a connection pool instance.\n\nWhen the Fastify server is shutdown, this plugin invokes the `.close()` method\non the connection pool.\n\n## Install\n```\nnpm i fastify-oracle --save\n```\n\n## Usage\nAdd it to you project with `register` and you are done!\nThis plugin will add the `oracle` namespace in your Fastify instance, with the following properties:\n```\ngetConnection: the function to get a connection from the pool\npool: the pool instance\nquery: a utility to perform a query _without_ a transaction\ntransact: a utility to perform multiple queries _with_ a transaction\n```\n\n## Examples\n\nThe plugin provides the basic functionality for creating a connection and executing statements such as\n\n```js\nconst fastify = require('fastify')()\n\nfastify.register(require('fastify-oracle'), {\n  pool: {\n    user: 'foo',\n    password: 'bar',\n    connectString: 'oracle.example.com:1521/foobar'\n  }\n})\n\nfastify.get('/db_data', async function (req, reply) {\n  let connection\n  try {\n    connection = await this.oracle.getConnection()\n    const { rows } = await connection.execute('SELECT 1 AS FOO FROM DUAL')\n    return rows\n  } finally {\n    if (connection) await connection.close()\n  }\n})\n\nfastify.listen(3000, (err) =\u003e {\n  if (err) {\n    fastify.log.error(err)\n    // Manually close since Fastify did not boot correctly.\n    fastify.close(err =\u003e {\n      process.exit(1)\n    })\n  }\n\n  // Initiate Fastify's shutdown procedure so that the plugin will\n  // automatically close the connection pool.\n  process.on('SIGTERM', fastify.close.bind(fastify))\n})\n```\n\nThe `query` feature can be used for convenience to perform a query _without_ a transaction\n\n```js\nconst fastify = require('fastify')\n\nfastify.register(require('fastify-oracle'), {\n  pool: {\n    user: 'travis',\n    password: 'travis',\n    connectString: 'localhost/xe'\n  } \n})\n\nfastify.post('/user/:username', (req, reply) =\u003e {\n  // will return a promise, fastify will send the result automatically\n  return fastify.oracle.query('SELECT * FROM USERS WHERE NAME = :name', { name: 'james' })\n})\n\n/* or with a callback\n\nfastify.oracle.query('SELECT * FROM USERS', function onResult (err, result) {\n  reply.send(err || result)\n})\n\n*/\n```\nSee [node-oracledb](https://oracle.github.io/node-oracledb/doc/api.html#-426-connectionexecute) documentation for all available usage options.\n\nThe `transact` feature can be used for convenience to perform multiple queries _with_ a transaction\n\n```js\nconst fastify = require('fastify')\n\nfastify.register(require('fastify-oracle'), {\n  pool: {\n    user: 'travis',\n    password: 'travis',\n    connectString: 'localhost/xe'\n  } \n})\n\nfastify.post('/user/:username', (req, reply) =\u003e {\n  // will return a promise, fastify will send the result automatically\n  return fastify.oracle.transact(async conn =\u003e {\n    // will resolve to commit, or rollback with an error\n    return conn.execute(`INSERT INTO USERS (NAME) VALUES('JIMMY')`)\n  })\n})\n\n/* or with a callback\n\nfastify.oracle.transact(conn =\u003e {\n    return conn.execute('SELECT * FROM DUAL')\n  },\n  function onResult (err, result) {\n    reply.send(err || result)\n  }\n})\n\n*/\n\n/* or with a commit callback\n\nfastify.oracle.transact((conn, commit) =\u003e {\n  conn.execute('SELECT * FROM DUAL', (err, res) =\u003e {\n    commit(err, res)\n  });\n})\n\n*/\n\n```\n\n## Options\n\n`fastify-oracle` requires an options object with at least one of the following\nproperties:\n\n- `pool`: an `oracledb` [pool configuration object](https://github.com/oracle/node-oracledb/blob/33331413/doc/api.md#createpool)\n- `poolAlias`: the name of a pool alias that has already been configured. This\ntakes precedence over the `pool` option.\n- `client`: an instance of an `oracledb` connection pool. This takes precedence\nover the `pool` and `poolAlias` options.\n\nOther options are as follows\n\n- `name`: (optional) can be used in order to connect to multiple oracledb instances. The first registered instance can be accessed via `fastify.oracle` or `fastify.oracle.\u003cdbname\u003e`. Note that once you register a *named* instance, you will *not* be able to register an unnamed instance.\n- `outFormat`: (optional) sets the `outFormat` of oracledb. Should be `'ARRAY'` or `'OBJECT'`. Default: `'ARRAY'`\n- `fetchAsString`: (optional) the column data of specified types are returned as a string instead of the default representation. Should be an array of valid data types. \nValid values are `['DATE', 'NUMBER', 'BUFFER', 'CLOB']`. Default `[]`.\n\n\n```js\nconst fastify = require('fastify')()\n\nfastify\n  .register(require('fastify-oracle'), {\n    pool: {\n      user: 'foo',\n      password: 'bar',\n      connectString: 'oracle.example.com:1521/ora1'\n    },\n    name: 'ora1'\n  })\n  .register(require('fastify-oracle'), {\n    pool: {\n      user: 'foo',\n      password: 'bar',\n      connectString: 'oracle.example.com:1521/ora2'\n    },\n    name: 'ora2'\n  })\n\nfastify.get('/db_1_data', async function (req, reply) {\n  let conn\n  try {\n    conn = await this.oracle.ora1.getConnection()\n    const result = await conn.execute('select 1 as foo from dual')  \n    return result.rows\n  } finally {\n    if (conn) {\n      conn.close().catch((err) =\u003e {})\n    }\n  } \n})\n\nfastify.get('/db_2_data', async function (req, reply) {\n  let conn\n  try {\n    conn = await this.oracle.ora2.getConnection()\n    const result = await conn.execute('select 1 as foo from dual')  \n    return result.rows\n  } finally {\n    if (conn) {\n      conn.close().catch((err) =\u003e {})\n    }\n  }\n})\n```\n\nThe `oracledb` instance is also available via `fastify.oracle.db` for accessing constants and other functionality:\n\n```js\nfastify.get('/db_data', async function (req, reply) {\n  let conn\n  try {\n    conn = await this.oracle.ora1.getConnection()\n    const result = await conn.execute('select 1 as foo from dual', { }, { outFormat: this.oracle.db.OBJECT })\n    return result.rows\n  } finally {\n    if (conn) {\n      conn.close().catch((err) =\u003e {})\n    }\n  } \n})\n```\n\nIf needed `pool` instance can be accessed via `fastify.oracle[.dbname].pool`\n\n## License\n\n[MIT License](http://jsumners.mit-license.org/)\n\n## Acknowledgements\n\nThanks to \n- [James Sumners](https://github.com/jsumners), who is the original author of this plugin, for his work and transferring his repository to me.\n- [Vincit](https://github.com/Vincit/travis-oracledb-xe) for his Travis Oracle work.\n","funding_links":[],"categories":["\u003ch2 align=\"center\"\u003eAwesome Fastify\u003c/h2\u003e"],"sub_categories":["\u003ch2 align=\"center\"\u003eEcosystem\u003c/h2\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemremengu%2Ffastify-oracle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcemremengu%2Ffastify-oracle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemremengu%2Ffastify-oracle/lists"}