From fb3c3f4ecb680f9401129e92710e3102d5cbf0b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:42:45 -0600 Subject: [PATCH 01/10] chore(deps-dev): bump wrangler in the dev-deps group (#6534) Bumps the dev-deps group with 1 update: [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler). Updates `wrangler` from 3.95.0 to 3.96.0 - [Release notes](https://github.com/cloudflare/workers-sdk/releases) - [Changelog](https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/CHANGELOG.md) - [Commits](https://github.com/cloudflare/workers-sdk/commits/wrangler@3.96.0/packages/wrangler) --- updated-dependencies: - dependency-name: wrangler dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 34 ++++------------------------------ package.json | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b7307f0cb..2a0a65cea5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.95.0" + "wrangler": "^3.96.0" }, "engines": { "node": ">=18.0" @@ -2101,31 +2101,6 @@ "node": ">=16" } }, - "node_modules/@cloudflare/workers-shared": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.11.0.tgz", - "integrity": "sha512-A+lQ8xp7992qSeMmuQ0ssL6CPmm+ZmAv6Ddikan0n1jjpMAic+97l7xtVIsswSn9iLMFPYQ9uNN/8Fl0AgARIQ==", - "dev": true, - "dependencies": { - "mime": "^3.0.0", - "zod": "^3.22.3" - }, - "engines": { - "node": ">=16.7.0" - } - }, - "node_modules/@cloudflare/workers-shared/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -19410,13 +19385,12 @@ } }, "node_modules/wrangler": { - "version": "3.95.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.95.0.tgz", - "integrity": "sha512-3w5852i3FNyDz421K2Qk4v5L8jjwegO5O8E1+VAQmjnm82HFNxpIRUBq0bmM7CTLvOPI/Jjcmj/eAWjQBL7QYg==", + "version": "3.96.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.96.0.tgz", + "integrity": "sha512-KjbHTUnwTa5eKl3hzv2h6nHBfAsbUkdurL7f6Y288/Bdn6tcEis13jLVR/nw/eWa3tNCBG1xOMZJboUyzWcC1g==", "dev": true, "dependencies": { "@cloudflare/kv-asset-handler": "0.3.4", - "@cloudflare/workers-shared": "0.11.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "blake3-wasm": "^2.1.5", diff --git a/package.json b/package.json index aa08326075..e106fc7c40 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.95.0" + "wrangler": "^3.96.0" }, "browserslist": { "production": [ From ce615adbdb955a370b9523ed15bf7728c0c0e40a Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:05:25 +0600 Subject: [PATCH 02/10] feat: add recommendation timestamp(0) (#6533) --- content/700-optimize/300-recordings.mdx | 1 + .../900-avoid-timestamp-timestampz-0.mdx | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 content/700-optimize/400-recommendations/900-avoid-timestamp-timestampz-0.mdx diff --git a/content/700-optimize/300-recordings.mdx b/content/700-optimize/300-recordings.mdx index e9a9204f34..cf2de72cc1 100644 --- a/content/700-optimize/300-recordings.mdx +++ b/content/700-optimize/300-recordings.mdx @@ -42,6 +42,7 @@ When a recording session ends, Optimize generates recommendations such as: - [Repeated query](/optimize/recommendations/repeated-query) - [Overfetching](/optimize/recommendations/select-returning) - [Using `@db.Money`](/optimize/recommendations/avoid-db-money) +- [Using `timestamp(0)` or `timestamptz(0)`](/optimize/recommendations/avoid-timestamp-timestampz-0) :::info Use [Prisma AI](/optimize/prisma-ai) to ask follow-up questions about a recommendation. diff --git a/content/700-optimize/400-recommendations/900-avoid-timestamp-timestampz-0.mdx b/content/700-optimize/400-recommendations/900-avoid-timestamp-timestampz-0.mdx new file mode 100644 index 0000000000..ebdd7a9eec --- /dev/null +++ b/content/700-optimize/400-recommendations/900-avoid-timestamp-timestampz-0.mdx @@ -0,0 +1,26 @@ +--- +title: 'Using timestamp(0) or timestamptz(0)' +metaTitle: 'Optimize Recommendations: Avoid usage of `timestamp(0)` or `timestamptz(0)`' +metaDescription: "Learn about the recommendation provided by Optimize for using `timestamp(0)` or `timestamptz(0)` native type." +tocDepth: 3 +toc: true +--- + +Optimize provides recommendations to help you identify and resolve performance issues caused by the use of `@db.Timestamp(0)` and `@db.Timestamptz(0)` native types in PostgreSQL. + +The `@db.Timestamp(0)` and `@db.Timestamptz(0)` native types have been used within the following `User` model: + +```prisma +model User { + // ... + date DateTime @db.Timestamp(0) + deletedAt DateTime @db.Timestamptz(0) + // ... +} +``` + +### Why this is a problem + +When using a `@db.Timestamp(n)` or `@db.Timestamptz(n)` column with a precision of `0`, the database rounds the time to the nearest whole second, which can lead to unexpected results. + +For example, if you insert the current time, such as `15:30:45.678`, into a column with this precision, it will round up to `15:30:46`. This behavior can cause the recorded time to appear up to half a second in the future compared to the original time, which may be surprising when precise time accuracy is critical. \ No newline at end of file From 8051e6dffe35dc8dbca2d7846bbf28717c019062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:02:35 -0600 Subject: [PATCH 03/10] chore(deps-dev): bump wrangler in the dev-deps group (#6536) Bumps the dev-deps group with 1 update: [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler). Updates `wrangler` from 3.96.0 to 3.97.0 - [Release notes](https://github.com/cloudflare/workers-sdk/releases) - [Changelog](https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/CHANGELOG.md) - [Commits](https://github.com/cloudflare/workers-sdk/commits/wrangler@3.97.0/packages/wrangler) --- updated-dependencies: - dependency-name: wrangler dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 46 ++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a0a65cea5..228dff576b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.96.0" + "wrangler": "^3.97.0" }, "engines": { "node": ">=18.0" @@ -7338,6 +7338,12 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true + }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -13687,6 +13693,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mlly": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.3.tgz", + "integrity": "sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "pathe": "^1.1.2", + "pkg-types": "^1.2.1", + "ufo": "^1.5.4" + } + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -14490,6 +14508,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pkg-types": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", + "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", + "dev": true, + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.2", + "pathe": "^1.1.2" + } + }, "node_modules/pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -18474,12 +18503,13 @@ }, "node_modules/unenv": { "name": "unenv-nightly", - "version": "2.0.0-20241204-140205-a5d5190", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241204-140205-a5d5190.tgz", - "integrity": "sha512-jpmAytLeiiW01pl5bhVn9wYJ4vtiLdhGe10oXlJBuQEX8mxjxO8BlEXGHU4vr4yEikjFP1wsomTHt/CLU8kUwg==", + "version": "2.0.0-20241212-153011-af71c96", + "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241212-153011-af71c96.tgz", + "integrity": "sha512-Yugb9yPs/EZsPOY+IHloqVVEcZeJ0uwwViTedsZjOtVeYO8I29B1rzU/p84FMT0R1Ht3bHsKkNV/rzrjSd07QA==", "dev": true, "dependencies": { "defu": "^6.1.4", + "mlly": "^1.7.3", "ohash": "^1.1.4", "pathe": "^1.1.2", "ufo": "^1.5.4" @@ -19385,9 +19415,9 @@ } }, "node_modules/wrangler": { - "version": "3.96.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.96.0.tgz", - "integrity": "sha512-KjbHTUnwTa5eKl3hzv2h6nHBfAsbUkdurL7f6Y288/Bdn6tcEis13jLVR/nw/eWa3tNCBG1xOMZJboUyzWcC1g==", + "version": "3.97.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.97.0.tgz", + "integrity": "sha512-NkFAigqZWe4NOK0gYROcpvdugaYJE/JRFrIZ+c5Q5/uie+25WH8OVbRvvmiXhWVhso56cZs2W2TPmAxT/sgHkw==", "dev": true, "dependencies": { "@cloudflare/kv-asset-handler": "0.3.4", @@ -19404,7 +19434,7 @@ "resolve": "^1.22.8", "selfsigned": "^2.0.1", "source-map": "^0.6.1", - "unenv": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190", + "unenv": "npm:unenv-nightly@2.0.0-20241212-153011-af71c96", "workerd": "1.20241205.0", "xxhash-wasm": "^1.0.1" }, diff --git a/package.json b/package.json index e106fc7c40..71f6f421dc 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.96.0" + "wrangler": "^3.97.0" }, "browserslist": { "production": [ From 3d0a9dda8e4c365a34f2418a6e5af036282d60b3 Mon Sep 17 00:00:00 2001 From: Nurul Sundarani Date: Thu, 19 Dec 2024 19:59:34 +0530 Subject: [PATCH 04/10] Update 600-faq.mdx (#6539) Add a new FAQ clarifying how queries are counted for billing purposes in Accelerate. --- content/300-accelerate/600-faq.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/300-accelerate/600-faq.mdx b/content/300-accelerate/600-faq.mdx index 52ce80f4e6..dad5c25ad4 100644 --- a/content/300-accelerate/600-faq.mdx +++ b/content/300-accelerate/600-faq.mdx @@ -195,4 +195,8 @@ The [cache invalidate API](/accelerate/caching#on-demand-cache-invalidation) is - **Inventory management**: In real-time applications, like inventory or booking systems, where stock levels, availability, or reservation statuses must reflect the latest information. - **High-priority data**: For time-sensitive data, like breaking news or urgent notifications, where it’s essential for users to see the most current information right away. -Using on-demand cache invalidation in these scenarios helps keep only the necessary data refreshed, preserving system performance while ensuring accurate, up-to-date information for users. \ No newline at end of file +Using on-demand cache invalidation in these scenarios helps keep only the necessary data refreshed, preserving system performance while ensuring accurate, up-to-date information for users. + +## How does Accelerate count queries for billing? + +Accelerate counts queries at the Prisma Client invocation level. A single Prisma query may translate into multiple SQL statements under the hood, but it will only count as one query for billing purposes. This ensures straightforward, predictable billing that reflects the Prisma Client usage rather than the complexity of the underlying SQL operations. From 6261489be395c035a2303268a853f568e122dd3c Mon Sep 17 00:00:00 2001 From: Nurul Sundarani Date: Thu, 19 Dec 2024 22:58:46 +0530 Subject: [PATCH 05/10] Adds Optimize, Prisma Postgres in our Console Overview section (#6540) --- content/500-platform/10-about.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/500-platform/10-about.mdx b/content/500-platform/10-about.mdx index a886a72cfa..3d245c2893 100644 --- a/content/500-platform/10-about.mdx +++ b/content/500-platform/10-about.mdx @@ -12,6 +12,8 @@ The [Console](https://console.prisma.io/login) enables you to manage and configu - [Accelerate](/accelerate): Speeds up your queries with a global database cache with scalable connection pooling. - [Pulse](/pulse): Enables you to build event-driven and real-time applications by letting you stream database change events in a type-safe way. +- [Optimize](/optimize): Provides you recommendations that can help you make your database queries faster. +- [Prisma Postgres](/orm/overview/databases/prisma-postgres): A managed PostgreSQL database that is optimized for Prisma. ## Concepts From 4999b44364c444d11be6dd2d4fc1ba40612f65e6 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:39:08 -0600 Subject: [PATCH 06/10] correct posthog app url (#6542) --- docusaurus.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index afe816f28c..1f5e258c5d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -82,8 +82,8 @@ const config: Config = { [path.resolve(__dirname, 'client-plugins', 'posthog-docusaurus'), { apiKey: DOCUSAURUS_POST_HOG_KEY, - appUrl: DOCUSAURUS_BASE_URL, - person_profiles: "identified_only", + appUrl: 'https://proxyhog.prisma-data.net', // this is safe to have in version control + person_profiles: 'identified_only', enableInDevelopment: false }, ], From d3ebd72fd79814efa4271a0eea8f52f945153e6c Mon Sep 17 00:00:00 2001 From: Raphael Etim Date: Fri, 20 Dec 2024 19:17:47 +0100 Subject: [PATCH 07/10] Add Limitation for Result Client Extension (#6544) This PR introduces a new Limitation section in the documentation of Prisma Client extensions, specifically addressing the limitation that relation fields are not supported within the Result Client Extension component. This is based on this [discord](https://discord.com/channels/937751382725886062/1319424725767819264) conversation. --- .../300-client-extensions/130-result.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx b/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx index 3c44d4d415..04543b1989 100644 --- a/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx +++ b/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx @@ -202,3 +202,22 @@ const user = await xprisma.user.findFirstOrThrow({ }) ``` In this case, omitting both `password` and `sanitizedPassword` will exclude both from the result as well as prevent the `password` field from being read from the database. + +## Limitation +As of now, Prisma Client's result extension component does not support relation fields. This means that you cannot create custom fields or methods based on related models or fields in a relational relationship (e.g., user.posts, post.author). The needs parameter can only reference scalar fields within the same model. Follow [issue #20091 on GitHub](https://github.com/prisma/prisma/issues/20091). + + +```ts +const prisma = new PrismaClient().$extends({ + result: { + user: { + postsCount: { + needs: { posts: true }, // This will not work because posts is a relation field + compute(user) { + return user.posts.length; // Accessing a relation is not allowed + }, + }, + }, + }, +}) +``` From e44a3deb91b18ce00e7de0808e12483ecaab06bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:13:00 -0600 Subject: [PATCH 08/10] chore(deps-dev): bump wrangler in the dev-deps group (#6543) Bumps the dev-deps group with 1 update: [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler). Updates `wrangler` from 3.97.0 to 3.99.0 - [Release notes](https://github.com/cloudflare/workers-sdk/releases) - [Changelog](https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/CHANGELOG.md) - [Commits](https://github.com/cloudflare/workers-sdk/commits/wrangler@3.99.0/packages/wrangler) --- updated-dependencies: - dependency-name: wrangler dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 106 +++++++++++++++++----------------------------- package.json | 2 +- 2 files changed, 39 insertions(+), 69 deletions(-) diff --git a/package-lock.json b/package-lock.json index 228dff576b..67306a14e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.97.0" + "wrangler": "^3.99.0" }, "engines": { "node": ">=18.0" @@ -2022,9 +2022,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241205.0.tgz", - "integrity": "sha512-TArEZkSZkHJyEwnlWWkSpCI99cF6lJ14OVeEoI9Um/+cD9CKZLM9vCmsLeKglKheJ0KcdCnkA+DbeD15t3VaWg==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241218.0.tgz", + "integrity": "sha512-8rveQoxtUvlmORKqTWgjv2ycM8uqWox0u9evn3zd2iWKdou5sncFwH517ZRLI3rq9P31ZLmCQBZ0gloFsTeY6w==", "cpu": [ "x64" ], @@ -2038,9 +2038,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241205.0.tgz", - "integrity": "sha512-u5eqKa9QRdA8MugfgCoD+ADDjY6EpKbv3hSYJETmmUh17l7WXjWBzv4pUvOKIX67C0UzMUy4jZYwC53MymhX3w==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241218.0.tgz", + "integrity": "sha512-be59Ad9nmM9lCkhHqmTs/uZ3JVZt8NJ9Z0PY+B0xnc5z6WwmV2lj0RVLtq7xJhQsQJA189zt5rXqDP6J+2mu7Q==", "cpu": [ "arm64" ], @@ -2054,9 +2054,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241205.0.tgz", - "integrity": "sha512-OYA7S5zpumMamWEW+IhhBU6YojIEocyE5X/YFPiTOCrDE3dsfr9t6oqNE7hxGm1VAAu+Irtl+a/5LwmBOU681w==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241218.0.tgz", + "integrity": "sha512-MzpSBcfZXRxrYWxQ4pVDYDrUbkQuM62ssl4ZtHH8J35OAeGsWFAYji6MkS2SpVwVcvacPwJXIF4JSzp4xKImKw==", "cpu": [ "x64" ], @@ -2070,9 +2070,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241205.0.tgz", - "integrity": "sha512-qAzecONjFJGIAVJZKExQ5dlbic0f3d4A+GdKa+H6SoUJtPaWiE3K6WuePo4JOT7W3/Zfh25McmX+MmpMUUcM5Q==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241218.0.tgz", + "integrity": "sha512-RIuJjPxpNqvwIs52vQsXeRMttvhIjgg9NLjjFa3jK8Ijnj8c3ZDru9Wqi48lJP07yDFIRr4uDMMqh/y29YQi2A==", "cpu": [ "arm64" ], @@ -2086,9 +2086,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241205.0.tgz", - "integrity": "sha512-BEab+HiUgCdl6GXAT7EI2yaRtDPiRJlB94XLvRvXi1ZcmQqsrq6awGo6apctFo4WUL29V7c09LxmN4HQ3X2Tvg==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241218.0.tgz", + "integrity": "sha512-tO1VjlvK3F6Yb2d1jgEy/QBYl//9Pyv3K0j+lq8Eu7qdfm0IgKwSRgDWLept84/qmNsQfausZ4JdNGxTf9xsxQ==", "cpu": [ "x64" ], @@ -7338,12 +7338,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true - }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -13611,9 +13605,9 @@ } }, "node_modules/miniflare": { - "version": "3.20241205.0", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241205.0.tgz", - "integrity": "sha512-Z0cTtIf6ZrcAJ3SrOI9EUM3s4dkGhNeU6Ubl8sroYhsPVD+rtz3m5+p6McHFWCkcMff1o60X5XEKVTmkz0gbpA==", + "version": "3.20241218.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241218.0.tgz", + "integrity": "sha512-spYFDArH0wd+wJSTrzBrWrXJrbyJhRMJa35mat947y1jYhVV8I5V8vnD3LwjfpLr0SaEilojz1OIW7ekmnRe+w==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "0.8.1", @@ -13624,7 +13618,7 @@ "glob-to-regexp": "^0.4.1", "stoppable": "^1.1.0", "undici": "^5.28.4", - "workerd": "1.20241205.0", + "workerd": "1.20241218.0", "ws": "^8.18.0", "youch": "^3.2.2", "zod": "^3.22.3" @@ -13693,18 +13687,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/mlly": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.3.tgz", - "integrity": "sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==", - "dev": true, - "dependencies": { - "acorn": "^8.14.0", - "pathe": "^1.1.2", - "pkg-types": "^1.2.1", - "ufo": "^1.5.4" - } - }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -14508,17 +14490,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pkg-types": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", - "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", - "dev": true, - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.2", - "pathe": "^1.1.2" - } - }, "node_modules/pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -18503,13 +18474,12 @@ }, "node_modules/unenv": { "name": "unenv-nightly", - "version": "2.0.0-20241212-153011-af71c96", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241212-153011-af71c96.tgz", - "integrity": "sha512-Yugb9yPs/EZsPOY+IHloqVVEcZeJ0uwwViTedsZjOtVeYO8I29B1rzU/p84FMT0R1Ht3bHsKkNV/rzrjSd07QA==", + "version": "2.0.0-20241204-140205-a5d5190", + "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241204-140205-a5d5190.tgz", + "integrity": "sha512-jpmAytLeiiW01pl5bhVn9wYJ4vtiLdhGe10oXlJBuQEX8mxjxO8BlEXGHU4vr4yEikjFP1wsomTHt/CLU8kUwg==", "dev": true, "dependencies": { "defu": "^6.1.4", - "mlly": "^1.7.3", "ohash": "^1.1.4", "pathe": "^1.1.2", "ufo": "^1.5.4" @@ -19395,9 +19365,9 @@ "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==" }, "node_modules/workerd": { - "version": "1.20241205.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241205.0.tgz", - "integrity": "sha512-vso/2n0c5SdBDWiD+Sx5gM7unA6SiZXRVUHDqH1euoP/9mFVHZF8icoYsNLB87b/TX8zNgpae+I5N/xFpd9v0g==", + "version": "1.20241218.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241218.0.tgz", + "integrity": "sha512-7Z3D4vOVChMz9mWDffE299oQxUWm/pbkeAWx1btVamPcAK/2IuoNBhwflWo3jyuKuxvYuFAdIucgYxc8ICqXiA==", "dev": true, "hasInstallScript": true, "bin": { @@ -19407,17 +19377,17 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20241205.0", - "@cloudflare/workerd-darwin-arm64": "1.20241205.0", - "@cloudflare/workerd-linux-64": "1.20241205.0", - "@cloudflare/workerd-linux-arm64": "1.20241205.0", - "@cloudflare/workerd-windows-64": "1.20241205.0" + "@cloudflare/workerd-darwin-64": "1.20241218.0", + "@cloudflare/workerd-darwin-arm64": "1.20241218.0", + "@cloudflare/workerd-linux-64": "1.20241218.0", + "@cloudflare/workerd-linux-arm64": "1.20241218.0", + "@cloudflare/workerd-windows-64": "1.20241218.0" } }, "node_modules/wrangler": { - "version": "3.97.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.97.0.tgz", - "integrity": "sha512-NkFAigqZWe4NOK0gYROcpvdugaYJE/JRFrIZ+c5Q5/uie+25WH8OVbRvvmiXhWVhso56cZs2W2TPmAxT/sgHkw==", + "version": "3.99.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.99.0.tgz", + "integrity": "sha512-k0x4rT3G/QCbxcoZY7CHRVlAIS8WMmKdga6lf4d2c3gXFqssh44vwlTDuARA9QANBxKJTcA7JPTJRfUDhd9QBA==", "dev": true, "dependencies": { "@cloudflare/kv-asset-handler": "0.3.4", @@ -19428,14 +19398,14 @@ "date-fns": "^4.1.0", "esbuild": "0.17.19", "itty-time": "^1.0.6", - "miniflare": "3.20241205.0", + "miniflare": "3.20241218.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.3.0", "resolve": "^1.22.8", "selfsigned": "^2.0.1", "source-map": "^0.6.1", - "unenv": "npm:unenv-nightly@2.0.0-20241212-153011-af71c96", - "workerd": "1.20241205.0", + "unenv": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190", + "workerd": "1.20241218.0", "xxhash-wasm": "^1.0.1" }, "bin": { @@ -19449,7 +19419,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20241205.0" + "@cloudflare/workers-types": "^4.20241218.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { diff --git a/package.json b/package.json index 71f6f421dc..917203b9b6 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@docusaurus/types": "^3.5.2", "prettier": "3.4.2", "typescript": "~5.7.2", - "wrangler": "^3.97.0" + "wrangler": "^3.99.0" }, "browserslist": { "production": [ From 422830881b278603a7898b5959cbf3d81572b489 Mon Sep 17 00:00:00 2001 From: Nurul Sundarani Date: Mon, 23 Dec 2024 15:44:31 +0530 Subject: [PATCH 09/10] Fixes incorrect description in "Filter a list of relations" section (#6547) --- .../200-prisma-client/100-queries/037-relation-queries.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx index a65f4ea724..7aaed50598 100644 --- a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx +++ b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx @@ -414,7 +414,7 @@ const relationCount = await prisma.user.findMany({ When you use `select` or `include` to return a subset of the related data, you can **filter and sort the list of relations** inside the `select` or `include`. -For example, the following query returns all users and a list of titles of the unpublished posts associated with each user: +For example, the following query returns list of titles of the unpublished posts associated with the user: ```ts const result = await prisma.user.findFirst({ From 0cd813fe6af0dc162298d77c9f660d6fc52317d2 Mon Sep 17 00:00:00 2001 From: Nurul Sundarani Date: Mon, 23 Dec 2024 16:36:39 +0530 Subject: [PATCH 10/10] Add instruction about specifiying timeout value in Interactive Transactions (#6548) --- content/300-accelerate/250-connection-pooling.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/300-accelerate/250-connection-pooling.mdx b/content/300-accelerate/250-connection-pooling.mdx index 9ace98004e..54794400ff 100644 --- a/content/300-accelerate/250-connection-pooling.mdx +++ b/content/300-accelerate/250-connection-pooling.mdx @@ -91,6 +91,19 @@ Accelerate has a default global timeout of `15s` for each [interactive transacti See the [troubleshooting guide](/accelerate/troubleshoot#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information. +When you set a higher interactive transaction timeout in the Prisma Console, you **must also** specify a matching `timeout` value in your interactive transaction query via timeout [transaction option](/orm/prisma-client/queries/transactions#transaction-options). Otherwise, transactions will still time out at the lower default (e.g., 5 seconds limit when no timeout value is specified). Here’s an example of how to set a 30-second timeout in your code: + +```ts +await prisma.$transaction( + async (tx) => { + // Your queries go here + }, + { + timeout: 30000, // 30s + } +); +``` + :::warning While you can increase the interactive transaction timeout limit, it’s recommended to inspect and optimize your database transactions if they take longer than 15 seconds. Long-running transactions can negatively impact performance and often signal the need for optimization. Learn more in the [troubleshooting guide](/accelerate/troubleshoot#p6004-querytimeout) and review the [warning in the Interactive Transactions section](/orm/prisma-client/queries/transactions#interactive-transactions-1) in our documentation. :::