@nathapp/nestjs-oauth-prisma 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -3
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -51,14 +51,19 @@ from the fragment.
51
51
 
52
52
  ```ts
53
53
  import { Module } from '@nestjs/common';
54
- import { PrismaClient } from '@prisma/client';
54
+ import { PrismaPg } from '@prisma/adapter-pg'; // MySQL: PrismaMariaDb from '@prisma/adapter-mariadb' (host/port/user/password/database, no connectionString)
55
+ import { PrismaClient } from './generated/prisma/client'; // your generator `output`
55
56
  import { ClockModule, IdGeneratorModule } from '@nathapp/nestjs-common';
56
57
  import { PrismaModule } from '@nathapp/nestjs-prisma';
57
58
  import { OAuthPrismaModule } from '@nathapp/nestjs-oauth-prisma';
58
59
 
59
60
  @Module({
60
61
  imports: [
61
- PrismaModule.forRoot({ client: PrismaClient, transaction: true }),
62
+ PrismaModule.forRoot({
63
+ client: PrismaClient,
64
+ clientOptions: { adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL! }) },
65
+ transaction: true,
66
+ }),
62
67
  ClockModule.register(), // provides CLOCK, required by PrismaSigningKeyProvider
63
68
  IdGeneratorModule.register(), // provides ID_GENERATOR, same requirement
64
69
  OAuthPrismaModule.register(),
@@ -156,7 +161,8 @@ which is exported from this package if you need to name the type.
156
161
 
157
162
  ## Transactions
158
163
 
159
- Multi-write flows need `PrismaModule.forRoot({ client: PrismaClient, transaction: true })`.
164
+ Multi-write flows need `PrismaModule.forRoot({ client: PrismaClient, transaction: true })`
165
+ with `PrismaClient` imported from your generated client (Prisma 7 `prisma-client` generator).
160
166
  Every repository resolves its client per operation from the `TRANSACTION_MANAGER`
161
167
  token, and the two `PrismaModule` registration paths fail differently when
162
168
  `transaction` is omitted:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nestjs-oauth-prisma",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Prisma adapter for @nathapp/nestjs-oauth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,15 +30,15 @@
30
30
  "peerDependencies": {
31
31
  "@nestjs/common": "^11.0.0 || ^12.1.0",
32
32
  "@nestjs/core": "^11.0.0 || ^12.1.0",
33
- "@nathapp/nestjs-prisma": "^3.3.0 || ^4.0.2"
33
+ "@nathapp/nestjs-prisma": "^4.1.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "@nathapp/nestjs-oauth": "1.0.0",
37
- "@nathapp/nestjs-data": "^3.3.0 || ^4.0.2",
38
- "@nathapp/nestjs-common": "^3.3.0 || ^4.0.2"
37
+ "@nathapp/nestjs-data": "^3.3.0 || ^4.0.3",
38
+ "@nathapp/nestjs-common": "^3.3.0 || ^4.0.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@nathapp/nestjs-prisma": "^4.0.2",
41
+ "@nathapp/nestjs-prisma": "^4.1.0",
42
42
  "eslint": "^8.57.0",
43
43
  "typescript": "^5"
44
44
  }