Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into revamp-search
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell committed Jan 10, 2025
2 parents 5249839 + effb6e7 commit 545b556
Show file tree
Hide file tree
Showing 10 changed files with 4,601 additions and 2,931 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-optimise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: |
github.event_name != 'pull_request' &&
steps.calibre.outputs.markdown != ''
uses: peter-evans/[email protected].5
uses: peter-evans/[email protected].6
with:
title: Auto Compress Images
branch-suffix: timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ The following example would result in a cascading delete, if the `User` is delet

#### A blog schema example

```prisma highlight=4;add showLineNumbers
```prisma showLineNumbers
model Post {
id Int @id @default(autoincrement())
title String
Expand Down Expand Up @@ -504,7 +504,9 @@ async function main() {
})
} catch (error) {
if (error instanceof Prisma.PrismaClientKnownRequestError) {
//delete-next-line
if (error.code === 'P2014') {
//add-next-line
if (error.code === 'P2003') {
console.log(error.message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ For example, the following query returns `User` that meet the following criteria
- No posts with more than 100 views
- All posts have less than, or equal to 50 likes

```ts highlight=3-14;normal
```ts
const users = await prisma.user.findMany({
where: {
//highlight-start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ metaDescription: 'Share extensions or import shared extensions into your Prisma
toc_max_heading_level: 4
---

<TopBlock>

You can share your [Prisma Client extensions](/orm/prisma-client/client-extensions) with other users, either as packages or as modules, and import extensions that other users create into your project.

If you would like to build a shareable extension, we also recommend using the [`prisma-client-extension-starter`](https://github.com/prisma/prisma-client-extension-starter) template.
If you would like to build a shareable extension, we also recommend using the [`prisma-client-extension-starter`](https://github.com/prisma/prisma-client-extension-starter) template.

</TopBlock>
To explore examples of Prisma's official Client extensions and those made by the community, visit [this](/orm/prisma-client/client-extensions/extension-examples) page.

## Install a shared, packaged extension

Expand Down
13 changes: 6 additions & 7 deletions content/200-orm/500-reference/050-prisma-client-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4837,11 +4837,11 @@ Use `every` to filter for lists of composite types where every item in the list
##### Find the first product where every photo has a `height` of `200`

```ts
const product = prisma.product.findFirst({
const product = await prisma.product.findFirst({
where: {
photos: {
every: {
{ height: 200 },
height: 200,
}
}
},
Expand All @@ -4857,11 +4857,11 @@ Use `some` to filter for lists of composite types where one or more items in the
##### Find the first product where one or more photos have a `url` of `2.jpg`

```ts
const product = prisma.product.findFirst({
const product = await prisma.product.findFirst({
where: {
photos: {
some: {
{ url: "2.jpg" },
url: "2.jpg",
}
}
},
Expand All @@ -4877,16 +4877,15 @@ Use `none` to filter for lists of composite types where no items in the list mat
##### Find the first product where no photos have a `url` of `2.jpg`

```ts
const product = prisma.product.findFirst({
const product = await prisma.product.findFirst({
where: {
photos: {
none: {
{ url: "2.jpg" },
url: "2.jpg",
}
}
},
})

```

## Atomic number operations
Expand Down
2 changes: 1 addition & 1 deletion content/200-orm/500-reference/375-supported-databases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ Note that a fixed version of SQLite is shipped with every Prisma ORM release.
| Neon Serverless Postgres | \* |
| PlanetScale | \* |
| Cloudflare D1 (Preview) | \* |

| Aiven (MySQL & Postgres) | \* |
&sup1; This does not include support for [Data API for Aurora Serverless](https://github.com/prisma/prisma/issues/1964).
2 changes: 1 addition & 1 deletion content/500-platform/60-platform-cli/20-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To get started, ensure you have the [Prisma CLI](/orm/tools/prisma-cli) updated

#### `auth login`

Opens a browser window that allows you to log into your Prisma Data Platform account or create a new one.
Opens a browser window that allows you to log into your Prisma Data Platform account or create a new one. Currently, GitHub is the only supported login method. We do have plan to add support for signing in with Google and email/password.

```bash
npx prisma platform auth login --early-access
Expand Down
16 changes: 15 additions & 1 deletion content/700-optimize/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ They are counted based on viewed recommendations. Once you click on a recommenda

## Can I use Prisma Optimize in production?

No, Prisma Optimize is not intended for production use. It is specifically designed for local development, providing valuable insights and optimizations during that phase. While it’s technically possible to run it in a production environment, doing so could result in performance problems or unexpected behaviors, as Optimize is not built to handle the complexity and scale of production workloads. For the best experience, we recommend using Prisma Optimize solely in your development environment.
No, Prisma Optimize is not intended for production use. It is specifically designed for local development, providing valuable insights and optimizations during that phase. While it’s technically possible to run it in a production environment, doing so could result in performance problems or unexpected behaviors, as Optimize is not built to handle the complexity and scale of production workloads. For the best experience, we recommend using Prisma Optimize solely in your development environment.

You can use the `enable` property in the Optimize extension to run Optimize only in development environment. By default, the `enable` property is set to `true`.

```ts file=script.ts copy showLineNumbers
import { PrismaClient } from '@prisma/client'
import { withOptimize } from "@prisma/extension-optimize"

const prisma = new PrismaClient().$extends(
withOptimize({
apiKey: process.env.OPTIMIZE_API_KEY,
enable: process.env.ENVIRONMENT === 'development',
})
);
```
Loading

0 comments on commit 545b556

Please sign in to comment.