{"id":15679510,"url":"https://github.com/balcieren/fastify-prisma-client","last_synced_at":"2025-03-30T12:31:57.028Z","repository":{"id":37829378,"uuid":"381643755","full_name":"balcieren/fastify-prisma-client","owner":"balcieren","description":"Easy access to prisma client","archived":true,"fork":false,"pushed_at":"2024-09-05T03:19:51.000Z","size":2841,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T08:02:26.476Z","etag":null,"topics":["database","fastify","fastify-plugin","orm","prisma","prisma-client","prisma2","typescript"],"latest_commit_sha":null,"homepage":"","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/balcieren.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":"2021-06-30T09:18:22.000Z","updated_at":"2024-09-05T19:17:21.000Z","dependencies_parsed_at":"2024-01-16T04:47:23.903Z","dependency_job_id":"e2451660-b367-4c2a-895d-d20cd5063071","html_url":"https://github.com/balcieren/fastify-prisma-client","commit_stats":{"total_commits":124,"total_committers":3,"mean_commits":"41.333333333333336","dds":"0.13709677419354838","last_synced_commit":"de8ce015c052410c58432c8a030cc8874b6b31c5"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balcieren%2Ffastify-prisma-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balcieren%2Ffastify-prisma-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balcieren%2Ffastify-prisma-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balcieren%2Ffastify-prisma-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balcieren","download_url":"https://codeload.github.com/balcieren/fastify-prisma-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246062653,"owners_count":20717676,"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","orm","prisma","prisma-client","prisma2","typescript"],"created_at":"2024-10-03T16:32:18.250Z","updated_at":"2025-03-30T12:31:56.547Z","avatar_url":"https://github.com/balcieren.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-prisma-client\n\n[![Version](https://img.shields.io/npm/v/fastify-prisma-client.svg)](https://www.npmjs.com/package/fastify-prisma-client)\n\neasy access to prisma client\n\n## Warning !\n\nThis package is for ease of access only so you must install prisma.\n\n## Installation\n\n```bash\nyarn add prisma fastify-prisma-client\nor\nnpm install prisma fastify-prisma-client\n```\n\n## Do not forget prisma generate ❗\n\n```bash\nyarn prisma generate\nor\nnpx prisma generate\n```\n\n## Usage\n\nRegister plugin\n\n```js\nimport fastifyPrismaClient from \"fastify-prisma-client\";\n\nfastify.register(fastifyPrismaClient);\n```\n\nIf you use with TypeScript , you have to give this type to avoid error\n\n```js\nimport Fastify, { FastifyInstance } from \"fastify\";\n\nconst fastify: FastifyInstance = Fastify();\n```\n\nPrisma client options are available and you can edit them\n\n```js\nfastify.register(fastifyPrismaClient, {});\n```\n\nUse with fastify decorate\n\n```js\nfastify.get(\"/users\", async (request, reply) =\u003e {\n  const users = await fastify.prisma.users.findMany();\n  return { users };\n});\n```\n\nUse with request decorate\n\n```js\nfastify.get(\"/users\", async (request, reply) =\u003e {\n  const users = await request.prisma.users.findMany();\n  return { users };\n});\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalcieren%2Ffastify-prisma-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalcieren%2Ffastify-prisma-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalcieren%2Ffastify-prisma-client/lists"}