From 382c04a3e89cbe483f9ef59b413343f0b7dc9bc6 Mon Sep 17 00:00:00 2001 From: Joseph Roddy Date: Tue, 24 Oct 2023 04:21:59 -0400 Subject: [PATCH 1/6] Update 120-query.mdx (#5394) apply age clause after object spread, prevents user overriding age rule --- .../02-prisma-client/053-client-extensions/120-query.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/053-client-extensions/120-query.mdx b/content/200-concepts/100-components/02-prisma-client/053-client-extensions/120-query.mdx index 9006c36075..dc7ae038ac 100644 --- a/content/200-concepts/100-components/02-prisma-client/053-client-extensions/120-query.mdx +++ b/content/200-concepts/100-components/02-prisma-client/053-client-extensions/120-query.mdx @@ -57,8 +57,8 @@ const prisma = new PrismaClient().$extends({ query: { user: { async findMany({ model, operation, args, query }) { - // set `age` and fill with the rest of `where` - args.where = { age: { gt: 18 }, ...args.where } + // take incoming `where` and set `age` + args.where = { ...args.where, age: { gt: 18 } } return query(args) }, From f301ce2800e0e7d6aa9fbbb3e5537bc3448756df Mon Sep 17 00:00:00 2001 From: Susheel Thapa Date: Tue, 24 Oct 2023 14:09:10 +0545 Subject: [PATCH 2/6] Chore: Fix typo in multiple files (#5389) --- .../200-concepts/100-components/01-prisma-schema/09-indexes.mdx | 2 +- .../100-components/02-prisma-client/054-middleware/index.mdx | 2 +- .../200-upgrading-versions/800-upgrading-to-prisma-3/index.mdx | 2 +- .../100-help-articles/425-nextjs-prisma-client-monorepo.mdx | 2 +- .../200-api-reference/050-prisma-client-reference.mdx | 2 +- content/800-data-platform/200-pulse/400-api-reference.mdx | 2 +- .../900-troubleshooting/050-connection-to-db-timed-out.mdx | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/200-concepts/100-components/01-prisma-schema/09-indexes.mdx b/content/200-concepts/100-components/01-prisma-schema/09-indexes.mdx index 67c85af10a..e0bf2109fa 100644 --- a/content/200-concepts/100-components/01-prisma-schema/09-indexes.mdx +++ b/content/200-concepts/100-components/01-prisma-schema/09-indexes.mdx @@ -330,7 +330,7 @@ As an example, the following model adds a `Brin` index to the `value` field with model Example { id Int @id value Int - // ^ field type macthing the operator class + // ^ field type matching the operator class @@index([value(ops: Int4BloomOps)], type: Brin) // ^ operator class ^ index type diff --git a/content/200-concepts/100-components/02-prisma-client/054-middleware/index.mdx b/content/200-concepts/100-components/02-prisma-client/054-middleware/index.mdx index 2c8c870837..e8377ac882 100644 --- a/content/200-concepts/100-components/02-prisma-client/054-middleware/index.mdx +++ b/content/200-concepts/100-components/02-prisma-client/054-middleware/index.mdx @@ -42,7 +42,7 @@ prisma.$use(async (params, next) => { -Do not invoke next multiple times within a middleware when using [batch transactions](/concepts/components/prisma-client/transactions#sequential-prisma-client-operations). This will cause you to break out of the transaction and lead to unexepected results. +Do not invoke next multiple times within a middleware when using [batch transactions](/concepts/components/prisma-client/transactions#sequential-prisma-client-operations). This will cause you to break out of the transaction and lead to unexpected results. diff --git a/content/300-guides/300-upgrade-guides/200-upgrading-versions/800-upgrading-to-prisma-3/index.mdx b/content/300-guides/300-upgrade-guides/200-upgrading-versions/800-upgrading-to-prisma-3/index.mdx index 593d7a704d..343fe58e27 100644 --- a/content/300-guides/300-upgrade-guides/200-upgrading-versions/800-upgrading-to-prisma-3/index.mdx +++ b/content/300-guides/300-upgrade-guides/200-upgrading-versions/800-upgrading-to-prisma-3/index.mdx @@ -120,7 +120,7 @@ prisma.log.create({ This API change does not apply to the MongoDB connector where there is not a difference between a JSON null and a database NULL. -They also do not apply to the `array_contains` operator becuase there can only be a JSON null within an JSON array. Since there cannot be a database NULL within a JSON array, `{ array_contains: null }` is not ambiguous. +They also do not apply to the `array_contains` operator because there can only be a JSON null within an JSON array. Since there cannot be a database NULL within a JSON array, `{ array_contains: null }` is not ambiguous. diff --git a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/425-nextjs-prisma-client-monorepo.mdx b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/425-nextjs-prisma-client-monorepo.mdx index 871dbace66..bc9802b4b7 100644 --- a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/425-nextjs-prisma-client-monorepo.mdx +++ b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/425-nextjs-prisma-client-monorepo.mdx @@ -13,7 +13,7 @@ Error: Your schema.prisma could not be found, and we detected that you are using Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs ``` -If you are using a Prisma version earlier than 4.11.0, the error message you will recieve will look similar to the message below: +If you are using a Prisma version earlier than 4.11.0, the error message you will receive will look similar to the message below: ``` Error: ENOENT: no such file or directory, open '/prisma-next-mono-reproduction/packages/service/.next/cache/webpack/client-development/schema.prisma' diff --git a/content/400-reference/200-api-reference/050-prisma-client-reference.mdx b/content/400-reference/200-api-reference/050-prisma-client-reference.mdx index c2499445c5..557a323f1a 100644 --- a/content/400-reference/200-api-reference/050-prisma-client-reference.mdx +++ b/content/400-reference/200-api-reference/050-prisma-client-reference.mdx @@ -913,7 +913,7 @@ When Prisma does an upsert, it first checks whether that record already exists i - If the record does not exist, then Prisma creates that record. - If the record exists, then Prisma updates it. -When your application tries to perform two or more concurrent upsert operations, then a race condition might happen where two or more operations do not find the record and therefore try to create that record. In this situation, one of the operations succesfully creates the new record but the other operations fail and return a unique key constraint error. +When your application tries to perform two or more concurrent upsert operations, then a race condition might happen where two or more operations do not find the record and therefore try to create that record. In this situation, one of the operations successfully creates the new record but the other operations fail and return a unique key constraint error. ##### Solution diff --git a/content/800-data-platform/200-pulse/400-api-reference.mdx b/content/800-data-platform/200-pulse/400-api-reference.mdx index 1fdff50885..e095508220 100644 --- a/content/800-data-platform/200-pulse/400-api-reference.mdx +++ b/content/800-data-platform/200-pulse/400-api-reference.mdx @@ -162,7 +162,7 @@ Pulse allows you to subscribe to change events based on filter conditions and op You must wrap your filter criteria inside a `before` or `after` object depending on the type of event your subscription is listening for: - `before`: `delete` events -- `after`: `create` and `udpate` events +- `after`: `create` and `update` events This makes it explicit that the specified filter criteria apply to the `before` or `after` state of the change event. diff --git a/content/800-data-platform/600-classic-projects/100-platform/900-troubleshooting/050-connection-to-db-timed-out.mdx b/content/800-data-platform/600-classic-projects/100-platform/900-troubleshooting/050-connection-to-db-timed-out.mdx index edc256a605..ef2ecdabdd 100644 --- a/content/800-data-platform/600-classic-projects/100-platform/900-troubleshooting/050-connection-to-db-timed-out.mdx +++ b/content/800-data-platform/600-classic-projects/100-platform/900-troubleshooting/050-connection-to-db-timed-out.mdx @@ -27,7 +27,7 @@ Several reasons related to the Data Proxy or database configuration might cause - The time it took the database to process the query pushed it over the timeout limit - The payload response is large and could not be processed within the timeout limit -- The depth of the query is large (it includes mutliple relational fields) +- The depth of the query is large (it includes multiple relational fields) ## **Solution** From 88b19da29b625c710779afcdb084cf02f92c0240 Mon Sep 17 00:00:00 2001 From: MorenoMdz Date: Tue, 24 Oct 2023 05:25:03 -0300 Subject: [PATCH 3/6] docs: Add disclaimer to GH action example (#5381) * Update 550-deploy-database-changes-with-prisma-migrate.mdx Add URL disclaimer * Update content/300-guides/200-deployment/550-deploy-database-changes-with-prisma-migrate.mdx Co-authored-by: Jan Piotrowski --------- Co-authored-by: Jan Piotrowski --- .../550-deploy-database-changes-with-prisma-migrate.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/300-guides/200-deployment/550-deploy-database-changes-with-prisma-migrate.mdx b/content/300-guides/200-deployment/550-deploy-database-changes-with-prisma-migrate.mdx index 814dd269ce..f05ca8337d 100644 --- a/content/300-guides/200-deployment/550-deploy-database-changes-with-prisma-migrate.mdx +++ b/content/300-guides/200-deployment/550-deploy-database-changes-with-prisma-migrate.mdx @@ -64,3 +64,5 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} ``` + +Ensure you have the `DATABASE_URL` variable [set as a secret in your repository](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions), without quotes around the connection string. From e9208208dc8da5f5690f861b6bbbcb6be48af44d Mon Sep 17 00:00:00 2001 From: Zhandos Mukatayev <77268705+zhandosm@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:29:04 +0900 Subject: [PATCH 4/6] Update 400-nextjs-prisma-client-dev-practices.mdx (#5384) * Update 400-nextjs-prisma-client-dev-practices.mdx - Add extension to the `db` file as file=./db was a bit misleading Result: file=./db.ts * Update content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx --------- Co-authored-by: Alex Ruheni <33921841+ruheni@users.noreply.github.com> --- .../400-nextjs-prisma-client-dev-practices.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx index 1f055a4a92..7e7906bd2f 100644 --- a/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx +++ b/content/300-guides/500-other/880-troubleshooting-orm/100-help-articles/400-nextjs-prisma-client-dev-practices.mdx @@ -20,7 +20,7 @@ In development, the command `next dev` clears Node.js cache on run. This in turn The solution in this case is to instantiate a single instance `PrismaClient` and save it on the [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) object. Then we keep a check to only instantiate `PrismaClient` if it's not on the `globalThis` object otherwise use the same instance again if already present to prevent instantiating extra `PrismaClient` instances. -```ts file=./db +```ts file=db.ts import { PrismaClient } from '@prisma/client' const prismaClientSingleton = () => { From 85be5b926b601c42f3597c1c984f07cec1872d28 Mon Sep 17 00:00:00 2001 From: Nilufar Bava Date: Tue, 24 Oct 2023 11:38:45 +0200 Subject: [PATCH 5/6] update: remove footer links (#5393) --- src/components/footer.tsx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/components/footer.tsx b/src/components/footer.tsx index 7b8e62c5f9..70b0dc89a4 100644 --- a/src/components/footer.tsx +++ b/src/components/footer.tsx @@ -282,20 +282,6 @@ const FooterSec = ({ > Migrate - - Data Browser - - - Data Proxy - Date: Tue, 24 Oct 2023 15:46:11 +0200 Subject: [PATCH 6/6] docs: Document new `prisma init` CLI parameters (#5395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add note about datasourceUrl in datasources section * Merge branch 'main' of github.com:prisma/docs * docs: document new `prisma init` CLI parameters * Apply suggestions from code review * Update content/400-reference/200-api-reference/200-command-reference.mdx Co-authored-by: Joël Galeran * format table --------- Co-authored-by: Joël Galeran --- .../200-api-reference/200-command-reference.mdx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/content/400-reference/200-api-reference/200-command-reference.mdx b/content/400-reference/200-api-reference/200-command-reference.mdx index 1e35fe8733..b40edadfdc 100644 --- a/content/400-reference/200-api-reference/200-command-reference.mdx +++ b/content/400-reference/200-api-reference/200-command-reference.mdx @@ -306,10 +306,13 @@ The `init` command does not interpret any existing files. Instead, it creates a #### Arguments -| Argument | Required | Description | Default | -| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -| `--datasource-provider` | No | Specifies the default value for the `provider` field in the `datasource` block. Options are `sqlite`, `postgresql`, `mysql`, `sqlserver`, `mongodb` and `cockroachdb`. | `postgresql` | -| `--url` | No | Define a custom datasource url. | | +| Argument | Required | Description | Default | +|-------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------| +| `--datasource-provider` | No | Specifies the default value for the `provider` field in the `datasource` block. Options are `sqlite`, `postgresql`, `mysql`, `sqlserver`, `mongodb` and `cockroachdb`. | `postgresql` | +| `--url` | No | Define a custom datasource url. | | +| `--generator-provider` | No | Define the default generator provider to use. | `prisma-client-js` | +| `--preview-features` | No | Define the default Preview features to use. [Learn more](/concepts/components/preview-features) | | +| `--output` | No | Specifies the default output location for the generated client. [Learn more](/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client#using-a-custom-output-path) | `node_modules/.prisma/client` | #### Examples