{"id":15681495,"url":"https://github.com/eomm/fastify-sqlite","last_synced_at":"2025-05-07T10:06:03.892Z","repository":{"id":59350007,"uuid":"535983011","full_name":"Eomm/fastify-sqlite","owner":"Eomm","description":"Fastify plugin to connect to a SQLite database","archived":false,"fork":false,"pushed_at":"2024-01-09T11:28:36.000Z","size":19,"stargazers_count":10,"open_issues_count":7,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-25T02:32:39.283Z","etag":null,"topics":["database","fastify","fastify-plugin","hacktoberfest","nodejs","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Eomm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T06:09:59.000Z","updated_at":"2024-05-11T07:03:52.000Z","dependencies_parsed_at":"2024-10-29T01:15:36.136Z","dependency_job_id":null,"html_url":"https://github.com/Eomm/fastify-sqlite","commit_stats":{"total_commits":6,"total_committers":3,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"2bbe31e825eec322c461cf49eaf77cd492a765f9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eomm%2Ffastify-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eomm%2Ffastify-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eomm%2Ffastify-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eomm%2Ffastify-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eomm","download_url":"https://codeload.github.com/Eomm/fastify-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232001679,"owners_count":18458478,"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","fastify","fastify-plugin","hacktoberfest","nodejs","sqlite","sqlite3"],"created_at":"2024-10-03T16:55:34.242Z","updated_at":"2024-12-31T15:24:41.158Z","avatar_url":"https://github.com/Eomm.png","language":"JavaScript","readme":"# fastify-sqlite\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![ci](https://github.com/Eomm/fastify-sqlite/actions/workflows/ci.yml/badge.svg)](https://github.com/Eomm/fastify-sqlite/actions/workflows/ci.yml)\n\nFastify plugin to connect to a SQLite3 database.\nUnder the hood, this plugin uses [`sqlite3`](https://www.npmjs.com/package/sqlite3).\n\n## Install\n\n```\nnpm install fastify-sqlite\n```\n\n### Compatibility\n\n| Plugin version | Fastify version |\n| ------------- |:---------------:|\n| `^1.0.0` | `^4.0.0` |\n\n\n## Usage\n\n```js\nconst fastifySqlite = require('fastify-sqlite')\n\nasync function main () {\n  const app = fastify()\n  app.register(fastifySqlite, {\n    dbFile: 'foo.db'\n  })\n  await app.ready()\n\n  app.sqlite.all('SELECT * FROM myTable', (err, rows) =\u003e {\n    // do something\n  })\n}\nmain()\n```\n\nCheckout the [sqlite3 documentation](https://github.com/TryGhost/node-sqlite3/wiki/API) to see all the available methods.\n\nNote that Promise APIs are not supported by the `sqlite3` module by default.\nBy using the `promiseApi` option, the [`sqlite`](https://github.com/kriasoft/node-sqlite) wrapper will be used\nto enhance the Database instance. It has many convenient utilities such as `migration` support.\n\n## Options\n\nYou can pass the following options to the plugin:\n\n```js\nawait app.register(require('fastify-sqlite'), {\n  promiseApi: true, // the DB instance supports the Promise API. Default false\n  name: 'mydb', // optional decorator name. Default null\n  verbose: true, // log sqlite3 queries as trace. Default false\n  dbFile: ':memory:', // select the database file. Default ':memory:'\n  mode: fastifySqlite.sqlite3.OPEN_READONLY \n    // how to connecto to the DB, Default: OPEN_READWRITE | OPEN_CREATE | OPEN_FULLMUTEX\n})\n\n// usage WITH name option\nawait app.sqlite.myDb.all('SELECT * FROM myTable')\n```\n\n## License\n\nCopyright [Manuel Spigolon](https://github.com/Eomm), Licensed under [MIT](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feomm%2Ffastify-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feomm%2Ffastify-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feomm%2Ffastify-sqlite/lists"}