Skip to content
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

fix(deps): update prisma monorepo to v5 (major) #12846

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 24, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/client (source) 4.16.2 -> 5.13.0 age adoption passing confidence
prisma (source) ^4.15.0 -> ^5.0.0 age adoption passing confidence

Release Notes

prisma/prisma (@​prisma/client)

v5.13.0

Compare Source

Today, we are excited to share the 5.13.0 stable release 🎉

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

Highlights
omit fields from Prisma Client queries (Preview)

We’re excited to announce Preview support for the omit option within the Prisma Client query options. The highly-requested omit feature now allows you to exclude fields that you don’t want to retrieve from the database on a per-query basis.

By default, when a query returns records, the result includes all scalar fields of the models defined in the Prisma schema. select can be used to return specific fields, while omit can now be used to exclude specific fields. omit lives at the same API level and works on all of the same Prisma Client model queries as select. Note, however, that omit and select are mutually exclusive. In other words, you can’t use both in the same query.

To get started using omit, enable the omitApi Preview feature in your Prisma schema:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["omitApi"]
}

Be sure to re-generate Prisma Client afterwards:

npx prisma generate

Here is an example of using omit:

// Includes all fields except password
await prisma.user.findMany({
  omit: {
   password: true
  },
})

Here is an example of using omit with include:

// Includes all user fields except user's password and title of user's posts
await prisma.user.findMany({
  omit: {
   password: true
  },
  include: {
    posts: {
      omit: {
        title: true
      },
    },
  },
})
Expand to view the example Prisma schema
model User {
  id       Int     @​id @​default(autoincrement())
  email    String  @​unique
  name     String?
  password String
  posts    Post[]
}

model Post {
  id       Int    @​id @​default(autoincrement())
  title    String
  author   User   @​relation(fields: [authorId], references: [id])
  authorId Int
}

Many users have requested a global implementation of omit. This request will be accommodated in the future. In the meantime, you can follow the issue here.

📣 Share your feedback: omitApi Preview feature

📚 Documentation: omit - Prisma Client API Reference

Fixes and improvements
Prisma Migrate
Prisma Client
Credits

Huge thanks to @​ospfranco, @​pranayat, @​yubrot, @​skyzh, @​anuraaga, @​yehonatanz, @​arthurfiorette, @​elithrar, @​tockn, @​Kuhave, @​obiwac for helping!

v5.12.1

Compare Source

Today, we are issuing the 5.12.1 patch release to fix two small problems with our new Cloudflare D1 support.

Fixes in Prisma CLI
Windows-only fix for new D1 specific flags for migrate diff and db pull

The flags --from-local-d1 and --to-local-d1 for migrate diff and --local-d1 to db pull we added in 5.12.0 were not working as expected when running on Windows only. This is now fixed.

📚 Documentation: Deploying a Cloudflare worker with D1 and Prisma ORM

New option for migrate diff: -o or --output

We added a new parameter --output to migrate diff that can be used to provide a filename into which the output of the command will be written. This is particularly useful for Windows users, using PowerShell, as using > to write into a file creates a UTF-16 LE file that can not be read by wrangler d1 migrations apply. Using this new option, this problem can be avoided:

npx prisma migrate diff --script --from-empty --to-schema-datamodel ./prisma/schema.prisma --output ./schema.sql

Related issues:

v5.12.0

Compare Source

Today, we are excited to share the 5.12.0 stable release 🎉

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

Highlights

Cloudflare D1 (Preview)

This release brings Preview support for Cloudflare D1 with Prisma ORM 🥳

D1 is Cloudflare’s SQLite database that can be used when deploying applications with Cloudflare.

When using Prisma ORM with D1, you can continue to: model your database with Prisma schema language, specify sqlite as your database provider in your Prisma schema, and interact with your database using Prisma Client.

To use Prisma ORM and D1 on Cloudflare Workers or Cloudflare Pages, you need to set sqlite as your database provider and use the @prisma/adapter-d1 database adapter via the driverAdapters Preview feature, released back in version 5.4.0.

Here is an example of sending a query to your D1 database using Prisma Client in your Worker:

// src/index.ts file
import { PrismaClient } from '@​prisma/client'
import { PrismaD1 } from '@​prisma/adapter-d1'

// Add the D1Database to the Env interface
export interface Env {
// This must match the binding name defined in your wrangler.toml configuration
  DB: D1Database
}

export default {
  async fetch(
    request: Request,
    env: Env,
    ctx: ExecutionContext
  ): Promise<Response> {
    // Make sure the database name matches the binding name in wrangler.toml and Env interface
    const adapter = new PrismaD1(env.DB)
    // Instantiate PrismaClient using the PrismaD1 driver adapter
    const prisma = new PrismaClient({ adapter })

    const users = await prisma.user.findMany()
    const result = JSON.stringify(users)
    return new Response(result)
  },
}

📚 Documentation: Deploying a Cloudflare worker with D1 and Prisma ORM

✍️ Blog post: Build Applications at the Edge with Prisma ORM & Cloudflare D1 (Preview)

📣 Share your feedback: D1 Driver Adapter

🚀 Example project: Deploy a Cloudflare Worker with D1

createMany() for SQLite

Bringing support for createMany() in SQLite has been a long-awaited and highly requested feature

createMany() is a method on Prisma Client, released back in version 2.16.0, that lets you insert multiple records into your database at once. This can be really useful when seeding your database or inserting bulk data.

Here is an example of using createMany() to create new users:

const users = await prisma.user.createMany({
  data: [
    { name: 'Sonali', email: 'sonali@prisma.io' },
    { name: 'Alex', email: 'alex@prisma.io' },
    { name: 'Yewande', email: 'yewande@prisma.io' },
    { name: 'Angelina', email: 'angelina@prisma.io' },
  ],
})

Before this release, if you wanted to perform bulk inserts with SQLite, you would have most likely used $queryRawUnsafe to execute raw SQL queries. But now you don’t have to go through all that trouble 🙂

With SQLite, createMany() works exactly the same way from an API standpoint as it does with other databases except it does not support the skipDuplicates option. At the behavior level, SQLite will split createMany() entries into multiple INSERT queries when the model in your schema contains fields with attributes like @default(dbgenerated()) or @default(autoincrement()) and when the fields are not consistently provided with values across the entries.

📚Documentation: createMany() - Prisma Client API Reference

Fixes and Improvements

Prisma Client

Credits

Huge thanks to @​yubrot, @​skyzh, @​anuraaga, @​onichandame, @​LucianBuzzo, @​RobertCraigie, @​arthurfiorette, @​elithrar for helping!

v5.11.0

Compare Source

Today, we are excited to share the 5.11.0 stable release 🎉

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

Highlights
Edge function support for Cloudflare and Vercel (Preview)

We’re thrilled to announce that support for edge function deployments with Prisma ORM is now in Preview 🥳 As of this release, you can deploy your apps that are using Prisma ORM to:

  • Vercel Edge Functions and Vercel Edge Middleware
  • Cloudflare Workers and Cloudflare Pages

In order to deploy to an edge function, you’ll need to use a compatible database driver (along with its Prisma driver adapter):

  • Neon Serverless Driver (for PostgreSQL databases hosted via Neon)
  • PlanetScale Serverless Driver (for MySQL databases hosted via PlanetScale)
  • pg driver (for traditional PostgreSQL databases)
  • @libsql/client driver (for SQLite databases hosted via Turso)

Check out our documentation to learn how you can deploy an edge function using any combination of supported edge function provider and database.

Performance improvements in nested create operations

With Prisma ORM, you can create multiple new records in nested queries, for example:

const user = await prisma.user.update({
  where: { id: 9 },
  data: {
    name: 'Elliott',
    posts: {
      create: {
        data: [{ title: 'My first post' }, { title: 'My second post' }],
      },
    },
  },
})

In previous versions, Prisma ORM would translate this into multiple SQL INSERT queries, each requiring its own roundtrip to the database. As of this release, these nested create queries are optimized and the INSERT queries are sent to the database in bulk in a single roundtrip. These optimizations apply to one-to-many as well as many-to-many relations.

With this change, using the nested create option to create multiple records effectively becomes equivalent to using a nested createMany operation (except that createMany only works with one-to-many relations, whereas create works both with one-to-many and many-to-many).

Note: Only the deepest nested operation is optimized. If a user specified create (1) -> create (2) -> create (3) in their query, only create (3) will be optimized.

Fixes and improvements
Prisma Client
Prisma Migrate
Prisma Engines

v5.10.2

Compare Source

Today, we are issuing the 5.10.2 patch release.

Fix in Prisma CLI

v5.10.1

Compare Source

Today, we are issuing the 5.10.1 patch release.

Fix in Prisma Client / Prisma CLI

v5.10.0

Compare Source

Today, we are excited to share the 5.10.0 stable release 🎉

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

Highlights
Optimized relation queries in MySQL (Preview)

This release brings the optimizations for relation queries from the previous releases to MySQL as well! This means that by enabling the relationJoins Preview feature with the mysql database provider, you now also get access to the relationLoadStrategy option in relation queries that let you choose whether you want to merged relations on the application- or database-level.

If you enable the relationJoins Preview feature, you can choose between the join and query options:

  • join (default): Sends a single query to the database and joins the data on the database-level.
  • query: Sends multiple queries to the database and joins the data on the application-level.

To get started, enable the Preview feature in your Prisma schema:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["relationJoins"]
}

Be sure to re-generate Prisma Client afterwards:

npx prisma generate

And finally, specify the relation loading strategy for your relation query via the relationLoadStrategy option as follows:

await prisma.user.findMany({
  relationLoadStrategy: 'join', // or 'query' 
  include: {
    posts: true,
  },
})

Note that in the example above, the relationLoadStrategy could be omitted altogether because join is used as the default value.

A few notes about relationLoadStrategy support on MySQL:

  • relationLoadStrategy is supported for MySQL v8.0.14 and higher. MariaDB is not supported.
  • Prisma ORM uses correlated sub-queries for MySQL (as opposed to LATERAL JOINs which are used on PostgreSQL).
Configure transaction options in the PrismaClient constructor

This feature enables you to configure the following transaction options on a global level via the PrismaClient constructor:

  • isolationLevel: Sets the transaction isolation level. By default, this is set to the value currently configured in your database.
  • timeout: The maximum amount of time the interactive transaction can run before being canceled and rolled back. The default value is 5 seconds.
  • maxWait: The maximum amount of time Prisma Client will wait to acquire a transaction from the database. The default value is 2 seconds.

Here is an example of how you can set this value globally for all transactions:

const prisma = new PrismaClient({
  transactionOptions: {
    isolationLevel: 'ReadCommitted',
    timeout: 1_000, // 1 sec
    maxWait: 2_000  // 2 sec
  }
})

Thanks a lot to our fantastic community member @tockn, who took the initiative to implement this feature in Prisma ORM 🎉

Note that you can still override the global values by setting them on a particular transaction.

New P2037 code for “Too many database connections opened” errors

We introduced a new error code for “Too many database connections opened” errors: P2037. You can find all error codes in our documentation.

Access the Prisma Data Platform via Prisma CLI

Now available in Early Access, you can manage your workspace and configure Prisma Accelerate and Prisma Pulse directly from the terminal.

Visit our docs to learn more about the integration and try it out for yourself!

Fixes and improvements
Prisma Client

v5.9.1

Compare Source

Today, we are issuing the 5.9.1 patch release.

Fixes in Prisma Client

In 5.9.0 we have changed our conditional exports in @prisma/client. This resulted in broken types for TypesScript users using certain combinations of module/moduleResolution settings. Additionally, it also caused a regression for Next.js users which have encountered invalid error messages from our side.

You can now try out 5.9.1 and let us know if you find a bug at https://pris.ly/prisma-prisma-bug-report

Note: many issues are duplicates.

v5.9.0

Compare Source

Today, we are excited to share the 5.9.0 stable release 🎉 

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

This release brings a number of small improvements as we continue our work on larger features which you will hear more about in the coming weeks:

  • Improve the performance of relation queries by introducing JOINs (see last release).
  • Support deployment to edge functions (already available in Early Access, you can apply for trying it out by taking our survey).
Highlights
Optimized result sets for more efficient queries

We continue our efforts of the performance of Prisma Client queries. In 5.1.0, we introduced the RETURNING keyword for several queries on PostrgeSQL and CockroachDB. We now expanded the use of RETURNING to SQLite and a broader range of queries for existing databases (e.g. delete on PostgreSQL and MongoDB). You can learn more about the optimizations of the result sets in these PRs:

SQL Server: Return proper error for unreachable database

When trying migrate/introspect a SQL server instance that’s unreachable, Prisma ORM now returns the correct P1001 error instead of failing without an error. Learn more in this PR: SQL Server: Migrate/Introspection engine doesn't return P1001 error for unreachable url.

Fixes and improvements
Prisma Client
Prisma Migrate
Language tools (e.g. VS Code)
Company news
Test edge functions support in Early Access

Today, the only way how to use Prisma ORM in edge functions (e.g. Cloudflare Workers or Vercel Edge Functions) is by using Prisma Accelerate. However, we are actively working on making Prisma ORM compatible with edge functions natively as well. If you want to become an early tester, you can apply for the private Early Accessing program by taking this survey.

We Transitioned Prisma Accelerate to IPv6 Without Anyone Noticing

Last year, AWS announced the decision to begin charging for IPv4 addresses beginning in February 2024. This move had a major impact on Prisma Accelerate, prompting us to go all-in on IPv6. Learn more in this technical deep dive into how we approached our IPv6 migration, lessons learned, and the outcome for users of Prisma Accelerate.

Credits

Huge thanks to @​laplab, @​Druue, @​anuraaga, @​onichandame, @​LucianBuzzo, @​RobertCraigie, @​almeidx, @​victorgdb, @​tinola, @​sampolahtinen, @​AikoRamalho, @​petradonka for helping!

v5.8.1

Compare Source

Today, we are issuing the 5.8.1 patch release.

Fix in Prisma Client

v5.8.0

Compare Source

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

Highlights

Happy New Year from your friends at Prisma! 🎊

In the last 4 weeks, we resolved some bugs on the ORM and made some progress on some exciting features that we’re not yet ready to announce. Stay tuned for the upcoming releases, in which we’ll be announcing new features. 😉

relationJoins improvements: Relation loading strategy per query (Preview)

In version 5.7.0, we released relationJoins into Preview. The relationJoins feature enables support for JOINs for relation queries.

This release adds support for the ability to specify the strategy used to fetch relational data per query when the Preview feature is enabled. This will enable you to choose the most efficient strategy for fetching relation data depending on your use case.

You can now load relation data using either of the following strategies:

  • join — uses JOINs to fetch relation data
  • query — uses sub-queries to fetch relation data

When the relationJoins Preview feature is enabled, by default, the relation fetching strategy used is join. You can override the default behavior by using the relationLoadStrategy query option.

To get started, enable the Preview feature:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["relationJoins"]
}

… and specify the relation loading strategy for your query as follows:

await prisma.user.findMany({
  relationLoadStrategy: 'query',
  include: {
    posts: true,
  },
})

Try it out and share your feedback and create a bug report if you encounter any issues.

Survey: Edge functions support

We’re working on bringing Edge function support to Prisma ORM and we would appreciate your input by submitting a response to our survey. By filling out the survey, you will be considered for our Early Access cohort as soon as we have something for you to try out.

Fixes and improvements
Prisma Client
Prisma Migrate
Language tools (e.g. VS Code)
Credits

Huge thanks to @​anuraaga, @​onichandame, @​LucianBuzzo, @​RobertCraigie, @​fqazi, @​KhooHaoYit, @​alencardc, @​Oreilles, @​tinola, @​AikoRamalho, @​luxaritas for helping!

Company news
🎉 A billion queries and counting: Prisma Accelerate

Prisma Accelerate, our global database cache has served over 1 billion queries since its General Availability launch.

We’d like to give a shoutout to our team and everyone who’s been with us on this journey. Stay tuned for some exciting products and features in the pipeline for 2024!

🔮 Prisma ORM Ecosystem

Are you building a cool tool, extension, generator, CLI tool or anything else, for Prisma ORM? Let us know.

We would like to learn about it and feature it on our Ecosystem page.

💼 We’re hiring

If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. Check out our Careers page for open positions.

v5.7.1

Compare Source

Today, we are issuing the 5.7.1 patch release.

This patch fixes multiple small problems in our relationJoins preview feature. If you ran into problems when testing relationJoins before, please give it another go with 5.7.1 and share your feedback or create a bug report if you encounter any issues.

Fixes in Prisma Client

v5.7.0

Compare Source

🌟 Help us spread the word about Prisma by starring the repo or posting on X (formerly Twitter) about the release.

Highlights

✨ In this release, we improved the SQL queries Prisma Client generates for you with two new Preview features, the driver adapters, and support for the database drivers we currently support. 5.7.0 will be the last release of the year. Stay tuned for the next one in January! ✨

Preview support for JOINs for relation queries for PostgreSQL and CockroachDB

We’re excited to announce Preview support for JOINs in Prisma Client when querying relations. Support for JOINs has been a long-standing feature request, and this release adds support for PostgreSQL and CockroachDB. The upcoming releases will expand support for other databases Prisma supports.

To get started using JOINs, enable the Preview feature in your Prisma schema:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["relationJoins"]
}

Run prisma generate to regenerate Prisma Client and enable the Preview feature.

Prisma Client will use a JOIN in your query to fetch relation data for a majority of the cases.

Example queries

1-1 relation queries example

Prisma Client query

await prisma.user.findUnique({
	where: {
		id: 1
	},
	include: {
		profile: true
	}
})

SQL

SELECT
	"t1"."id",
	"t1"."name",
	"User_profile"."__prisma_data__" AS "profile"
FROM
	"public"."User" AS "t1"
	LEFT JOIN LATERAL (
		SELECT
			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
		FROM
			(
				SELECT
					"t4"."__prisma_data__"
				FROM
					(
						SELECT
							JSON_BUILD_OBJECT(
								'id',
								"t3"."id",
								'bio',
								"t3"."bio",
								'userId',
								"t3"."userId"
							) AS "__prisma_data__"
						FROM
							(
								SELECT
									"t2".*
								FROM
									"public"."Profile" AS "t2"
								WHERE
									"t1"."id" = "t2"."userId"
							) AS "t3"
					) AS "t4"
			) AS "t5"
	) AS "User_profile" ON TRUE
WHERE "t1"."id" = $1
LIMIT $2
1-m relation queries example

Prisma Client query

await prisma.user.findUnique({
	where: {
		id: 1
	},
	include: {
		posts: true
	}
})

SQL

SELECT
	"t1"."id",
	"t1"."name",
	"User_posts"."__prisma_data__" AS "posts"
FROM
	"public"."User" AS "t1"
	LEFT JOIN LATERAL (
		SELECT
			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
		FROM
			(
				SELECT
					"t4"."__prisma_data__"
				FROM
					(
						SELECT
							JSON_BUILD_OBJECT(
								'id',
								"t3"."id",
								'title',
								"t3"."title",
								'content',
								"t3"."content",
								'published',
								"t3"."published",
								'authorId',
								"t3"."authorId"
							) AS "__prisma_data__"
						FROM
							(
								SELECT
									"t2".*
								FROM
									"public"."Post" AS "t2"
								WHERE
									"t1"."id" = "t2"."authorId"
									/* root select */
							) AS "t3"
							/* inner select */
					) AS "t4"
					/* middle select */
			) AS "t5"
			/* outer select */
	) AS "User_posts" ON TRUE
WHERE "t1"."id" = $1
LIMIT $2
m-n relation queries example

Prisma Client query

await prisma.post.findUnique({
	where: {
		id: 1
	},
	include: {
		tags: true
	}
})

SQL

SELECT
	"t1"."id",
	"t1"."title",
	"t1"."content",
	"t1"."published",
	"t1"."authorId",
	"Post_tags_m2m"."__prisma_data__" AS "tags"
FROM
	"public"."Post" AS "t1"
	LEFT JOIN LATERAL (
		SELECT
			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
		FROM
			(
				SELECT
					"Post_tags"."__prisma_data__"
				FROM
					"public"."_PostToTag" AS "t2"
					LEFT JOIN LATERAL (
						SELECT
							JSON_BUILD_OBJECT('id', "t4"."id", 'name', "t4"."name") AS "__prisma_data__",
							"t4"."id"
						FROM
							(
								SELECT
									"t3".*
								FROM
									"public"."Tag" AS "t3"
								WHERE
									"t2"."B" = "t3"."id"
									/* root select */
							) AS "t4"
					) AS "Post_tags" ON TRUE
				WHERE
					"t2"."A" = "t1"."id"
			) AS "Post_tags_m2m_1"
	) AS "Post_tags_m2m" ON TRUE
WHERE "t1"."id" = $1
LIMIT $2

Share your feedback and create a bug report if you encounter any issues.

Prisma’s distinct option now uses SQL queries (Preview)

From this release, Prisma Client’s distinct option now uses the native SQL DISTINCT ON for unordered queries with PostgreSQL and CockroachDB. The upcoming releases will expand support for the other databases that Prisma supports.

Prisma Client already supports querying for distinct records. However, Prisma Client took care of the post-processing for distinct records in memory.

To get started, enable the Preview feature in your Prisma schema:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["nativeDistinct"]
}

Regenerate your Prisma Client to get started using the Preview feature.

Given the following Prisma Client query:

await prisma.user.findMany({
    distinct: ['role'],
    select: {
      role: true,
    },
})

Before 5.7.0

Previously, Prisma Client handled the post-processing to select distinct records in-memory. Therefore, the following query was generated and executed against your database:

SELECT
	"public"."User"."id",
	"public"."User"."role"::text
FROM
	"public"."User"
WHERE
	1 = 1 OFFSET $1

After 5.7.0

SELECT DISTINCT ON ("public"."User"."role")
	"public"."User"."id",
	"public"."User"."role"::text
FROM
	"public"."User"
WHERE
	1 = 1 OFFSET $1

Share your feedback and create a bug report if you encounter any issues.

Improved support for Netlify using Node.js v20

In this release, we improved Prisma support when deploying to Netlify on Node.js v20. Previously, the Prisma Client could not resolve the location of the Query Engine after deploying to Netlify when using Node.js v20. If you run into this issue, we recommend updating to Prisma v5.7.0.

We recommend giving this comment on GitHub a read if you are not yet able to upgrade Prisma, to learn how to get around the error.

Fixes and improvements
Prisma Client
Prisma
Prisma Migrate
Credits

Huge thanks to @​anuraaga, @​onichandame, @​LucianBuzzo, @​RobertCraigie, @​fqazi, @​KhooHaoYit, @​alencardc, @​Oreilles, @​christianledgard, @​skyzh, @​alula, @​AikoRamalho, @​petradonka for helping!

Company news
💼 We’re hiring!

If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.

We're hiring for the following roles:

v5.6.0

Compare Source

🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟

Highlights
Driver adapters improvements (Preview)

In version 5.4.0, we released driverAdapters into Preview. The driverAdapters feature enables Prisma Client to access your database using JavaScript or Serverless database drivers.

In this release, we fixed many bugs for the existing driver adapters. We appreciate all the community feedback that has helped us improve this feature!

PlanetScale serverless driver adapter improvements

This release also introduces a small breaking change to the @prisma/adapter-planetscale package to improve its stability and performance. The serverless driver adapter will now use a connection pool instead of a single connection from PlanetScale’s serverless driver.

In case you’re using the @prisma/adapter-planetscale, update your Prisma Client instance with the following:

-import { connect } from '@&#8203;planetscale/database'
+import { Client } from '@&#8203;planetscale/database'
import { PrismaPlanetScale } from '@&#8203;prisma/adapter-planetscale'
import { PrismaClient } from '@&#8203;prisma/client'
import { fetch as undiciFetch } from 'undici';

-const connection = connect({ url: connectionString, fetch: undiciFetch })
+const client = new Client({ url: connectionString, fetch: undiciFetch })

-const adapter = new PrismaPlanetScale(connection)
+const adapter = new PrismaPlanetScale(client)

const prisma = new PrismaClient({ adapter })
Request for feedback

We encourage you to try out the driver adapters and share your feedback to help us move it to General Availability in either of the following GitHub discussions:

Refer to our docs to learn more about driver adapters.

New prisma debug command

This release introduces a new command: prisma debug. The command provides debugging information such as environment variables that Prisma Client, Prisma Migrate, Prisma CLI, and Prisma Studio use. The command is also useful when creating a bug report as the information complements the output of the prisma -v command.

You can learn more about the command in our docs.

Read replicas extension improvements

We also released version 0.3.0 of the @prisma/extension-read-replicas package that contains the following improvements:

  • A new $replica() method that explicitly enables you to use a replica for your query.

    For example, by default, the queryRaw and executeRaw methods are forwarded to the primary database, as they could try to write to the database. You can use the $replica() method with either of the *Raw methods to explicitly execute your query against a replica instead of your primary database.

  • Validation for when there’s an empty list of replicas.

  • Webpack bundling fixes

We want to thank you, our community members, for your contributions! 🙏

You can find additional information on the changes in the extension’s release. You can learn more about the extension in the announcement blog post.

Package provenance

npm has introduced provenance statements to improve supply-chain security and transparency of packages. This allows developers to verify where and how packages are built.

Starting with the 5.6.0 release, all npm packages for Prisma ORM will be published with provenance statements. If you maintain a Prisma Client extension or generator, we encourage you to enable provenance statements when publishing to npm.

Fixes and improvements
Prisma Migrate
Prisma Client
Prisma CLI
Credits

Huge thanks to @​onichandame, @​LucianBuzzo, @​RobertCraigie, @​fqazi, @​KhooHaoYit, @​alencardc, @​Oreilles, @​christianledgard, @​skyzh, @​alula, @​luxaritas, @​Nasfame, @​lukahartwig, @​steebchen, @​icanipa for helping!

Miscellaneous
Prisma Accelerate is now Generally Available

We're excited to share that Prisma Accelerate is now Generally Available. Prisma Accelerate is a global database cache that's available in over 280 locations and provides scalable connection pooling for serverless and edge applications.

Learn more in the announcement blog post. Sign up and try out Prisma Accelerate

💼 We’re hiring!

If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.

We're hiring for an Engineering Manager: Prisma Data Platform.

v5.5.2

Compare Source

Today, we are issuing the 5.5.2 patch release.

Fix in Pris

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Nov 24, 2023
@coveralls
Copy link

coveralls commented Nov 24, 2023

Pull Request Test Coverage Report for Build a69e7f7d-bf00-409d-bca7-246931efc1df

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.124%

Totals Coverage Status
Change from base Build b32e22d6-f72e-486a-85a2-044c2b5df08f: 0.0%
Covered Lines: 6737
Relevant Lines: 7313

💛 - Coveralls

@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch from 91bd519 to a177aba Compare December 8, 2023 01:00
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 5 times, most recently from aa5b3d2 to 09fc82e Compare December 19, 2023 08:22
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch from 09fc82e to 7abec82 Compare January 2, 2024 12:42
Copy link
Contributor Author

renovate bot commented Jan 3, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: sample/22-graphql-prisma/package-lock.json
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: nest-typescript-starter@1.0.0
npm WARN Found: reflect-metadata@0.1.13
npm WARN node_modules/reflect-metadata
npm WARN   reflect-metadata@"0.2.1" from the root project
npm WARN   4 more (@nestjs/graphql, @nestjs/mapped-types, @nestjs/common, @nestjs/core)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer reflect-metadata@"^0.1.13" from @nestjs/graphql@12.0.11
npm WARN node_modules/@nestjs/graphql
npm WARN   @nestjs/graphql@"12.0.11" from the root project
npm WARN   1 more (@nestjs/apollo)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: nest-typescript-starter@1.0.0
npm WARN Found: reflect-metadata@0.1.13
npm WARN node_modules/reflect-metadata
npm WARN   reflect-metadata@"0.2.1" from the root project
npm WARN   4 more (@nestjs/graphql, @nestjs/mapped-types, @nestjs/common, @nestjs/core)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer reflect-metadata@"^0.1.13" from @nestjs/graphql@12.0.11
npm WARN node_modules/@nestjs/graphql
npm WARN   @nestjs/graphql@"12.0.11" from the root project
npm WARN   1 more (@nestjs/apollo)
npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @nestjs/graphql@12.0.11
npm ERR! Found: ts-morph@21.0.1
npm ERR! node_modules/ts-morph
npm ERR!   dev ts-morph@"21.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ts-morph@"^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" from @nestjs/graphql@12.0.11
npm ERR! node_modules/@nestjs/graphql
npm ERR!   @nestjs/graphql@"12.0.11" from the root project
npm ERR!   peer @nestjs/graphql@"^12.0.0" from @nestjs/apollo@12.0.11
npm ERR!   node_modules/@nestjs/apollo
npm ERR!     @nestjs/apollo@"12.0.11" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: ts-morph@20.0.0
npm ERR! node_modules/ts-morph
npm ERR!   peerOptional ts-morph@"^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" from @nestjs/graphql@12.0.11
npm ERR!   node_modules/@nestjs/graphql
npm ERR!     @nestjs/graphql@"12.0.11" from the root project
npm ERR!     peer @nestjs/graphql@"^12.0.0" from @nestjs/apollo@12.0.11
npm ERR!     node_modules/@nestjs/apollo
npm ERR!       @nestjs/apollo@"12.0.11" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate/cache/others/npm/_logs/2024-04-23T13_35_30_748Z-debug-0.log

@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 2 times, most recently from a194eec to 98e9c35 Compare January 9, 2024 20:22
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch from 98e9c35 to 6e57913 Compare January 15, 2024 13:47
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 2 times, most recently from 6bc177c to fc5dd4a Compare February 1, 2024 16:17
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 2 times, most recently from 22a7951 to 56cb0e2 Compare February 12, 2024 08:36
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 4 times, most recently from bb42ed8 to d1d93a4 Compare February 21, 2024 19:01
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 2 times, most recently from 8da299c to 8a45f82 Compare March 18, 2024 09:17
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch 2 times, most recently from 93033ce to 5e2296a Compare April 4, 2024 14:56
@renovate renovate bot force-pushed the renovate/major-prisma-monorepo branch from 5e2296a to 7b01527 Compare April 23, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant