<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Benny Halperin</title>
    <description>The latest articles on DEV Community by Benny Halperin (@bhalperin).</description>
    <link>https://dev.to/bhalperin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1219768%2F436221fa-0062-4192-bf99-76b3e60fbb46.jpeg</url>
      <title>DEV Community: Benny Halperin</title>
      <link>https://dev.to/bhalperin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhalperin"/>
    <language>en</language>
    <item>
      <title>Breaking changes in Prisma Client v6.14</title>
      <dc:creator>Benny Halperin</dc:creator>
      <pubDate>Wed, 13 Aug 2025 05:29:11 +0000</pubDate>
      <link>https://dev.to/bhalperin/breaking-changes-in-prisma-client-v614-45k0</link>
      <guid>https://dev.to/bhalperin/breaking-changes-in-prisma-client-v614-45k0</guid>
      <description>&lt;p&gt;If you are using Prisma ORM in your NestJS project and created your own custom Prisma service that extends the generated Prisma client, please read on.&lt;/p&gt;

&lt;p&gt;Up until Prisma v6.13, your custom service followed this pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { PrismaClient } from 'my/generated/prisma/client/path';

export class PrismaService extends PrismaClient implements OnModuleInit {
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compiling this code with Prisma v6.14 generates an error. To fix it, your custom service should no longer &lt;code&gt;extend PrismaClient&lt;/code&gt;. Instead, declare a public property of type &lt;code&gt;PrismaClient&lt;/code&gt; and instantiate it in the constructor. This will be the client referenced elsewhere in your code to run database queries.&lt;/p&gt;

&lt;h4&gt;
  
  
  The new pattern:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { PrismaClient } from 'my/generated/prisma/client/path';

export class PrismaService implements OnModuleInit {
    readonly client: PrismaClient;

    constructor() {
        this.client = new PrismaClient();
    }
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then elsewhere in your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Injectable()
export class UsersService {
    constructor(
        private prisma: PrismaService,
    ) {}

    async getUsers() {
        return await this.prisma.client.user.findMany();
        /* PREVIOUSLY: return await this.prisma.user.findMany(); */
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hopes this helps.&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>prisma</category>
      <category>typescript</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
