Skip to content

fix(deps): update prisma monorepo to v6.6.0 #7820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 16, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/adapter-d1 (source) 6.5.0 -> 6.6.0 age adoption passing confidence
@prisma/adapter-libsql (source) 6.5.0 -> 6.6.0 age adoption passing confidence
@prisma/client (source) 6.5.0 -> 6.6.0 age adoption passing confidence
prisma (source) 6.5.0 -> 6.6.0 age adoption passing confidence

Release Notes

prisma/prisma (@​prisma/adapter-d1)

v6.6.0

Compare Source

Today, we are excited to share the 6.6.0 stable release 🎉 This version comes packed with exciting features, we can't wait to see what you're going to build with it! Read our announcement blog post for more details: Prisma ORM 6.6.0: ESM Support, D1 Migrations & MCP Server

🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release. 🌟

Highlights
ESM support with more flexible prisma-client generator (Early Access)

We are excited to introduce a new prisma-client generator that's more flexible, comes with ESM support and removes any magic behaviours that may cause friction with the current prisma-client-js generator.

Note: The prisma-client generator is currently in Early Access and will likely have some breaking changes in the next releases.

Here are the main differences:

  • Requires an output path; no “magic” generation into node_modules any more
  • Supports ESM and CommonJS via the moduleFormat field
  • Outputs plain TypeScript that's bundled just like the rest of your application code

Here's how you can use the new prisma-client generator in your Prisma schema:

// prisma/schema.prisma
generator client {
  provider     = "prisma-client"           // no `-js` at the end
  output       = "../src/generated/prisma" // `output` is required
  moduleFormat = "esm"                     // or `"cjs"` for CommonJS
}

In your application, you can then import the PrismaClient constructor (and anything else) from the generated folder:

// src/index.ts
import { PrismaClient } from './generated/prisma/client'

⚠️ Important: We recommend that you add the output path to .gitignore so that the query engine that's part of the generated Prisma Client is kept out of version control:

##### .gitignore
./src/generated/prisma

📚 Learn more in the docs.

Cloudflare D1 & Turso/LibSQL migrations (Early Access)

Cloudflare D1 and Turso are popular database providers that are both based on SQLite. While you can query them using the respective driver adapter for D1 or Turso, previous versions of Prisma ORM weren't able to make schema changes against these databases.

With today's release, we're sharing the first Early Access version of native D1 migration support for the following commands:

  • prisma db push: Updates the schema of the remote database based on your Prisma schema
  • prisma db pull: Introspects the schema of the remote database and updates your local Prisma schema
  • prisma migrate diff: Outputs the difference between the schema of the remote database and your local Prisma schema

Note: Support for prisma migrate dev and prisma migrate deploy will come very soon!

To use these commands, you need to connect the Prisma CLI to your D1 or Turso instance by using the driver adapter in your prisma.config.ts file. Here is an example for D1:

import path from 'node:path'
import type { PrismaConfig } from 'prisma'
import { PrismaD1HTTP } from '@​prisma/adapter-d1'

// import your .env file
import 'dotenv/config'

type Env = {
  CLOUDFLARE_D1_TOKEN: string
  CLOUDFLARE_ACCOUNT_ID: string
  CLOUDFLARE_DATABASE_ID: string
}

export default {
  earlyAccess: true,
  schema: path.join('prisma', 'schema.prisma'),

  migrate: {
    async adapter(env) {
      return new PrismaD1HTTP({
        CLOUDFLARE_D1_TOKEN: env.CLOUDFLARE_D1_TOKEN,
        CLOUDFLARE_ACCOUNT_ID: env.CLOUDFLARE_ACCOUNT_ID,
        CLOUDFLARE_DATABASE_ID: env.CLOUDFLARE_DATABASE_ID,
      })
    },
  },
} satisfies PrismaConfig<Env>

With that setup, you can now execute schema changes against your D1 instance by running:

npx prisma db push

📚 Learn more in the docs:

MCP server to manage Prisma Postgres via LLMs (Preview)

Prisma Postgres is the first serverless database without cold starts. Designed for optimal efficiency and high performance, it's the perfect database to be used alongside AI tools like Cursor, Windsurf, Lovable or co.dev. In this ORM release, we're adding a command to start a Prisma MCP server that you can integrate in your AI development environment. Thanks to that MCP server, you can now:

  • tell your AI agent to create new DB instances
  • design your data model
  • chat through a database migration

… and much more.

To get started, add this snippet to the MCP configuration of your favorite AI tool and get started:

{
  "mcpServers": {
    "Prisma": {
      "command": "npx",
      "args": ["-y", "prisma", "mcp"]
    }
  }
}

📚 Learn more in the docs.

New --prompt option on prisma init

You can now pass a --prompt option to the prisma init command to have it scaffold a Prisma schema for you and deploy it to a fresh Prisma Postgres instance:

npx prisma init --prompt "Simple habit tracker application"

For everyone, following social media trends, we also created an alias called --vibe for you 😉

npx prisma init --vibe "Cat meme generator"
Improved API for using driver adapters

In this release, we are introducing a nice DX improvement for driver adapters. Driver adapters let you access your database using JS-native drivers with Prisma ORM.

Before 6.6.0

Earlier versions of Prisma ORM required you to first instantiate the driver itself, and then use that instance to create the Prisma driver adapter. Here is an example using the @libsql/client driver for LibSQL:

import { createClient } from '@&#8203;libsql/client'
import { PrismaLibSQL } from '@&#8203;prisma/adapter-libsql'
import { PrismaClient } from '@&#8203;prisma/client'

// Old way of using driver adapters (before 6.6.0)
const driver = createClient({
  url: env.LIBSQL_DATABASE_URL,
  authToken: env.LIBSQL_DATABASE_TOKEN,
})
const adapter = new PrismaLibSQL(driver)

const prisma = new PrismaClient({ adapter })
6.6.0 and later

As of this release, you instantiate the driver adapter directly with the options of your preferred JS-native driver.:

import { PrismaLibSQL } from '@&#8203;prisma/adapter-libsql'
import { PrismaClient } from '../prisma/prisma-client'

const adapter = new PrismaLibSQL({
  url: env.LIBSQL_DATABASE_URL,
  authToken: env.LIBSQL_DATABASE_TOKEN,
})

const prisma = new PrismaClient({ adapter })
Other changes
prismaSchemaFolder breaking changes

If you are using the prismaSchemaFolder Preview feature to split your Prisma schema into multiple files, you may encounter some breaking changes in this version.

Explicit declaration of schema folder location

You now must always provide the path to the schema folder explicitly. You can do this in either of three ways:

  • pass the the --schema option to your Prisma CLI command (e.g. prisma migrate dev --schema ./prisma/schema)
  • set the prisma.schema field in package.json:
    // package.json
    {
      "prisma": {
        "schema": "./schema"
      }
    }
  • set the schema property in prisma.config.ts:
    import path from 'node:path'
    import type { PrismaConfig } from 'prisma'
    
    export default {
      earlyAccess: true,
      schema: path.join('prisma', 'schema'),
    } satisfies PrismaConfig<Env>
migrations folder must live next to .prisma file with datasource block

Your migrations directory must live next to the .prisma file that defines your datasource blog. If you relied on the implicit schema folder location of ./prisma/schema make sure to move your migrations folder from ./prisma/migrations to ./prisma/schema/migrations.

Assuming schema.prisma defines the datasource in this example, here's how how need to place the migrations folder:

##### `migrations` and `schema.prisma` are on the same level
.
├── migrations
├── models
│   ├── posts.prisma
│   └── users.prisma
└── schema.prisma

See this PR for more details.

No more Bun issues if Node.js is not installed

Bun users reported an issue that prisma generate would hang if Node.js installed on their machine. This is now fixed and Bun users can generate Prisma Client without issues.

Company news
Enterprise support

Prisma offers an enterprise support plan for Prisma ORM. Get direct help from our team and a joint slack channel! With Prisma ORM 7 on the horizon, this is a great time to upgrade your support today.

We are hiring: Developer Support Engineer

If you care about making developers successful, join us as a Developer Support Engineer.


Configuration

📅 Schedule: Branch creation - "before 8am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants