{"id":13847311,"url":"https://github.com/notiz-dev/nestjs-prisma","last_synced_at":"2025-05-14T07:08:08.072Z","repository":{"id":38256987,"uuid":"285317400","full_name":"notiz-dev/nestjs-prisma","owner":"notiz-dev","description":"Easy Prisma support for your NestJS application","archived":false,"fork":false,"pushed_at":"2025-02-25T11:02:34.000Z","size":1861,"stargazers_count":649,"open_issues_count":10,"forks_count":54,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T11:42:33.654Z","etag":null,"topics":["nestjs","prisma"],"latest_commit_sha":null,"homepage":"https://nestjs-prisma.dev","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/notiz-dev.png","metadata":{"funding":{"github":"notiz-dev","patreon":"notiz_dev"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2020-08-05T14:42:39.000Z","updated_at":"2025-05-10T11:13:13.000Z","dependencies_parsed_at":"2023-10-04T15:12:56.503Z","dependency_job_id":"7b2820be-8549-462d-90f5-4414283a205c","html_url":"https://github.com/notiz-dev/nestjs-prisma","commit_stats":{"total_commits":333,"total_committers":15,"mean_commits":22.2,"dds":"0.24024024024024027","last_synced_commit":"c17a1d30dc07b05cbe3e5df2709082d74357a29a"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notiz-dev%2Fnestjs-prisma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notiz-dev%2Fnestjs-prisma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notiz-dev%2Fnestjs-prisma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notiz-dev%2Fnestjs-prisma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notiz-dev","download_url":"https://codeload.github.com/notiz-dev/nestjs-prisma/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000903,"owners_count":21997445,"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":["nestjs","prisma"],"created_at":"2024-08-04T18:01:16.426Z","updated_at":"2025-05-14T07:08:08.024Z","avatar_url":"https://github.com/notiz-dev.png","language":"TypeScript","funding_links":["https://github.com/sponsors/notiz-dev","https://patreon.com/notiz_dev"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003enestjs-prisma\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    Easy \u003ca href=\"https://github.com/prisma/prisma\" target=\"_blank\" rel=\"noopener\"\u003ePrisma\u003c/a\u003e support for your \u003ca href=\"https://github.com/nestjs/nest\" target=\"_blank\" rel=\"noopener\"\u003eNestJS\u003c/a\u003e application.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/notiz-dev/nestjs-prisma/actions/workflows/node.js.yml\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://github.com/notiz-dev/nestjs-prisma/actions/workflows/node.js.yml/badge.svg?branch=main\"alt=\"Build Status\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-prisma\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dt/nestjs-prisma.svg\" alt=\"Total Downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-prisma\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/nestjs-prisma.svg\" alt=\"npm package\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/notiz-dev/nestjs-prisma/blob/main/LICENSE\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/nestjs-prisma.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n### Automatic Install\n\nUse the [nest add](https://nestjs-prisma.dev/docs/schematics) command to automatically setup the library, Prisma and Docker (optionally):\n\n```sh\nnest add nestjs-prisma\n```\n\n### Manual Install\n\nAdd `nestjs-prisma` library to your [NestJS application](https://docs.nestjs.com/#installation):\n\n```sh\n# npm\nnpm install nestjs-prisma\n\n# yarn\nyarn add nestjs-prisma\n```\n\nFurthermore, setup [Prisma](https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgres#set-up-prisma) in your NestJS application, if you haven't already.\n\n```sh\nnpm i -D prisma\nnpm install @prisma/client\n\nnpx prisma init\n```\n\n## Basic usage\n\nAdd `PrismaModule` to the `imports` section in your `AppModule` or other modules to gain access to `PrismaService`.\n\n```ts\nimport { Module } from '@nestjs/common';\nimport { PrismaModule } from 'nestjs-prisma';\n\n@Module({\n  imports: [PrismaModule.forRoot()],\n})\nexport class AppModule {}\n```\n\nUse the `PrismaService` via dependency injection in your controller, resolver, services, guards and more:\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { PrismaService } from 'nestjs-prisma';\n\n@Injectable()\nexport class AppService {\n  constructor(private prisma: PrismaService) {}\n\n  users() {\n    return this.prisma.user.findMany();\n  }\n\n  user(userId: string) {\n    return this.prisma.user.findUnique({\n      where: { id: userId },\n    });\n  }\n}\n```\n\nYou have access to all exposed methods and arguments of the generated `PrismaClient` through `PrismaService`.\n\n## Documentation\n\nVisit our [official documentation](https://nestjs-prisma.dev/docs/installation).\n\n## Contributing\n\nYou are welcome to contribute to this project.\n\nThe code is split up into three directories:\n\n```\n+-- docs\n+-- examples\n+-- lib\n+-- schematics\n```\n\nThe `docs` directory contains an astro website and the [docs content](./docs/src/content/docs).\n\nThe `examples` directory contains example applications.\n\nThe `lib` directory contains everything exposed by `nestjs-prisma` as a library.\n\nThe `schematics` directory contains the blue prints for installing the library with the schematic command.\n\nHere are some tips if you like to make changes to the schematics.\n\nInstall `@angular-devkit/schematics-cli` to be able to use `schematics` command\n\n```bash\nnpm i -g @angular-devkit/schematics-cli\n```\n\nNow build the schematics and run the schematic.\n\n```bash\nnpm run build:schematics\n# or\nnpm run dev:schematics\n\n# dry-run\nschematics .:nest-add\n\n# execute schematics\nschematics .:nest-add --debug false\n# or\nschematics .:nest-add --dry-run false\n```\n\nHelpful article about [Custom Angular Schematics](https://medium.com/@tomastrajan/total-guide-to-custom-angular-schematics-5c50cf90cdb4) which also applies to Nest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotiz-dev%2Fnestjs-prisma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotiz-dev%2Fnestjs-prisma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotiz-dev%2Fnestjs-prisma/lists"}