Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mxbai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
- name: Upload Docs
run: pnpm dlx @mixedbread/cli store sync "${MIXEDBREAD_VECTOR_STORE_ID}" "apps/docs/content/docs/**/*.mdx" --yes --strategy fast
env:
MIXEDBREAD_API_KEY: ${{ secrets.MIXEDBREAD_API_KEY }}
MXBAI_API_KEY: ${{ secrets.MIXEDBREAD_API_KEY }}
MIXEDBREAD_VECTOR_STORE_ID: ${{ secrets.MIXEDBREAD_VECTOR_STORE_ID }}
6 changes: 3 additions & 3 deletions apps/docs/content/docs.v6/orm/more/internals/engines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ A Prisma engine is the **direct interface to the database**, any higher-level in

As an example, when using Rust-based engines, Prisma Client connects to the query engine in order to read and write data in a database:

![Prisma engine](/docs/v6/orm/more/internals/typical-flow-query-engine-at-runtime.png)
![Prisma engine](/img/v6/orm/more/internals/typical-flow-query-engine-at-runtime.png)

### Using custom engine libraries or binaries

Expand Down Expand Up @@ -188,7 +188,7 @@ This section applies **only to Rust-based engines**. Prisma ORM v7 defaults to t
When using Rust-based engines, Prisma Client loads the query engine as a [Node-API library](https://nodejs.org/api/n-api.html) by default. You can alternatively [configure Prisma to use the query engine compiled as an executable binary](#configuring-the-query-engine), which is run as a sidecar process alongside your application.
The Node-API library approach is recommended since it reduces the communication overhead between Prisma Client and the query engine.

![Diagram showing the query engine and Node.js at runtime](/docs/v6/orm/more/internals/query-engine-node-js-at-runtime.png)
![Diagram showing the query engine and Node.js at runtime](/img/v6/orm/more/internals/query-engine-node-js-at-runtime.png)

The query engine is started when the first Prisma Client query is invoked or when the [`$connect()`](/v6/orm/prisma-client/setup-and-configuration/databases-connections/connection-management) method is called on your `PrismaClient` instance. Once the query engine is started, it creates a [connection pool](/v6/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool) and manages the physical connections to the database. From that point onwards, Prisma Client is ready to send [queries](/v6/orm/prisma-client/queries/crud) to the database (e.g. `findUnique()`, `findMany`, `create`, ...).

Expand All @@ -208,7 +208,7 @@ The following diagram depicts a "typical flow":
1. The query engine closes the database connections
1. The query engine is stopped

![Typical flow of the query engine at run time](/docs/v6/orm/more/internals/typical-flow-query-engine-at-runtime.png)
![Typical flow of the query engine at run time](/img/v6/orm/more/internals/typical-flow-query-engine-at-runtime.png)

## Responsibilities of the query engine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ You can [read about the performance and DX improvements](https://www.prisma.io/b

:::

![Query flow from the user application to the database with Prisma Client](/docs/v6/orm/overview/databases/images/drivers/qe-query-execution-flow.png)
![Query flow from the user application to the database with Prisma Client](/img/v6/orm/overview/databases/images/drivers/qe-query-execution-flow.png)

## Driver adapters

Prisma Client can connect and run queries against your database using JavaScript database drivers using **driver adapters**. Adapters act as _translators_ between Prisma Client and the JavaScript database driver.

Prisma Client will use the Query Engine to transform the Prisma Client query to SQL and run the generated SQL queries via the JavaScript database driver.

![Query flow from the user application to the database using Prisma Client and driver adapters](/docs/v6/orm/overview/databases/images/drivers/qe-query-engine-adapter.png)
![Query flow from the user application to the database using Prisma Client and driver adapters](/img/v6/orm/overview/databases/images/drivers/qe-query-engine-adapter.png)

There are two different types of driver adapters:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ The MongoDB database connector uses transactions to support nested writes. Trans

The MongoDB connection URL can be configured in different ways depending on how you are hosting your database. The standard configuration is made up of the following components:

![Structure of the MongoDB connection URL](/docs/v6/orm/overview/databases/mongodb.png)
![Structure of the MongoDB connection URL](/img/v6/orm/overview/databases/mongodb.png)

#### Base URL and path

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs.v6/orm/overview/databases/mysql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const prisma = new PrismaClient({ adapter });

Here's an overview of the components needed for a MySQL connection URL:

![Structure of the MySQL connection URL](/docs/v6/orm/overview/databases/mysql-connection-string.png)
![Structure of the MySQL connection URL](/img/v6/orm/overview/databases/mysql-connection-string.png)

#### Base URL and path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const adapter = new PrismaPg({ connectionString }, { schema: "myPostgresSchema"

Prisma ORM follows the connection URL format specified by [PostgreSQL's official guidelines](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING), but does not support all arguments and includes additional arguments such as `schema`. Here's an overview of the components needed for a PostgreSQL connection URL:

![Structure of the PostgreSQL connection URL](/docs/v6/orm/overview/databases/postgresql-connection-string.png)
![Structure of the PostgreSQL connection URL](/img/v6/orm/overview/databases/postgresql-connection-string.png)

#### Base URL and path

Expand Down
8 changes: 4 additions & 4 deletions apps/docs/content/docs.v6/orm/overview/databases/turso.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,21 @@ Turso supports [embedded replicas](https://turso.tech/blog/introducing-embedded-

When your app initially establishes a connection to your database, the primary database will fulfill the query:

![Embedded Replica: First remote read](/docs/v6/orm/overview/databases/images/embedded-replica-remote-read.png)
![Embedded Replica: First remote read](/img/v6/orm/overview/databases/images/embedded-replica-remote-read.png)

Turso will (1) create an embedded replica inside your application and (2) copy data from your primary database to the replica so it is locally available:

![Embedded Replica: Remote DB Copy](/docs/v6/orm/overview/databases/images/embedded-replica-create-replica.png)
![Embedded Replica: Remote DB Copy](/img/v6/orm/overview/databases/images/embedded-replica-create-replica.png)

The embedded replica will fulfill subsequent read queries. The libSQL client provides a [`sync()`](https://docs.turso.tech/sdk/ts/reference#manual-sync) method which you can invoke to ensure the embedded replica's data remains fresh.

![Embedded Replica: Local DB reads](/docs/v6/orm/overview/databases/images/embedded-replica-read.png)
![Embedded Replica: Local DB reads](/img/v6/orm/overview/databases/images/embedded-replica-read.png)

With embedded replicas, this setup guarantees a responsive application, because the data will be readily available locally and faster to access.

Like a read replica setup you may be familiar with, write operations are forwarded to the primary remote database and executed before being propagated to all embedded replicas.

![Embedded Replica: Write operation propagation](/docs/v6/orm/overview/databases/images/embedded-replica-write-propagation.png)
![Embedded Replica: Write operation propagation](/img/v6/orm/overview/databases/images/embedded-replica-write-propagation.png)

1. Write operations propagation are forwarded to the database.
1. Database responds to the server with the updates from 1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The remaining parts of this page discuss how Prisma ORM compares to existing dat

The main problem with the database tools that currently exist in the Node.js and TypeScript ecosystem is that they require a major tradeoff between _productivity_ and _control_.

![Productivity vs Control in ORMs, SQL query builders, and SQL](/docs/v6/orm/overview/introduction/node-js-db-tools-tradeoffs.png)
![Productivity vs Control in ORMs, SQL query builders, and SQL](/img/v6/orm/overview/introduction/node-js-db-tools-tradeoffs.png)

### Raw SQL: Full control, low productivity

Expand Down Expand Up @@ -90,4 +90,4 @@ Developers should be able to ask for the data they need instead of having to wor

Prisma ORM's main goal is to make application developers more productive when working with databases. Considering the tradeoff between productivity and control again, this is how Prisma ORM fits in:

![Prisma ORM makes developers productive](/docs/v6/orm/overview/introduction/prisma-makes-devs-productive.png)
![Prisma ORM makes developers productive](/img/v6/orm/overview/introduction/prisma-makes-devs-productive.png)
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ In reality, not all Data Mapper ORMs adhere to this pattern strictly. For exampl

Given the following `User` table in the database:

![Database User table schema with id, first_name, last_name, and email columns.](/docs/v6/orm/overview/introduction/user-table.png)
![Database User table schema with id, first_name, last_name, and email columns.](/img/v6/orm/overview/introduction/user-table.png)

This is what the corresponding entity class would look like:

Expand Down Expand Up @@ -263,7 +263,7 @@ Here's a break down of the example above:

The `User` / `Post` relation can be visualized with the following diagram:

![1-n relation between User and Post](/docs/v6/orm/overview/introduction/user-post-relation-1-n.png)
![1-n relation between User and Post](/img/v6/orm/overview/introduction/user-post-relation-1-n.png)

At a Prisma ORM level, the `User` / `Post` relation is made up of:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metaDescription: This page gives an overview of the most important things when b

When building REST APIs, Prisma Client can be used inside your _route controllers_ to send databases queries.

![REST APIs with Prisma Client](/docs/v6/orm/overview/introduction/prisma-rest-apis.png)
![REST APIs with Prisma Client](/img/v6/orm/overview/introduction/prisma-rest-apis.png)

## Supported libraries

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ If you are storing your database connection string and other environment variabl
netlify open --admin
```
2. Click **Site settings**:
![Netlify admin UI](/docs/v6/orm/prisma-client/deployment/serverless/images/500-06-deploy-to-netlify-site-settings.png)
![Netlify admin UI](/img/v6/orm/prisma-client/deployment/serverless/images/500-06-deploy-to-netlify-site-settings.png)
3. Navigate to **Build & deploy** in the sidebar on the left and select **Environment**.
4. Click **Edit variables** and create a variable with the key `DATABASE_URL` and set its value to your database connection string.
![Netlify environment variables](/docs/v6/orm/prisma-client/deployment/serverless/images/500-07-deploy-to-netlify-environment-variables-settings.png)
![Netlify environment variables](/img/v6/orm/prisma-client/deployment/serverless/images/500-07-deploy-to-netlify-environment-variables-settings.png)
5. Click **Save**.

</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ To prevent this, use a _second_ hosted database to handle preview deployments. O

3. Add an environment variable with a key of `DATABASE_URL` and select only the **Preview** environment option:

![Add an environment variable for the preview environment](/docs/v6/orm/prisma-client/deployment/serverless/images/300-60-deploy-to-vercel-preview-environment-variable.png)
![Add an environment variable for the preview environment](/img/v6/orm/prisma-client/deployment/serverless/images/300-60-deploy-to-vercel-preview-environment-variable.png)

4. Set the value to the connection string of your second database:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The application has the following components:
- **Backend**: Node.js REST API built with Express.js with resource endpoints that use Prisma Client to handle database operations against a PostgreSQL database (e.g., hosted on Heroku).
- **Frontend**: Static HTML page to interact with the API.

![Heroku deployment architecture diagram showing a Node.js backend with Prisma Client, static frontend, and PostgreSQL database.](/docs/v6/orm/prisma-client/deployment/traditional/images/heroku-architecture.png)
![Heroku deployment architecture diagram showing a Node.js backend with Prisma Client, static frontend, and PostgreSQL database.](/img/v6/orm/prisma-client/deployment/traditional/images/heroku-architecture.png)

The focus of this guide is showing how to deploy projects using Prisma ORM to Heroku. The starting point will be the [Prisma Heroku example](https://github.com/prisma/prisma-examples/tree/latest/deployment-platforms/heroku), which contains an Express.js server with a couple of preconfigured REST endpoints and a simple frontend.

Expand Down Expand Up @@ -230,7 +230,7 @@ You can use the static frontend to interact with the API you deployed via the pr

Open up the preview URL in your browser, the URL should like this: `https://APP_NAME.herokuapp.com`. You should see the following:

![Deployed Prisma app frontend in browser showing Check API status, Seed data, and Load feed buttons.](/docs/v6/orm/prisma-client/deployment/traditional/images/heroku-deployed.png)
![Deployed Prisma app frontend in browser showing Check API status, Seed data, and Load feed buttons.](/img/v6/orm/prisma-client/deployment/traditional/images/heroku-deployed.png)

The buttons allow you to make requests to the REST API and view the response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The application has the following components:
- **Backend**: Node.js REST API built with Express.js with resource endpoints that use Prisma Client to handle database operations against a PostgreSQL database (e.g., hosted on Heroku).
- **Frontend**: Static HTML page to interact with the API.

![Koyeb deployment architecture diagram showing a Node.js backend with Prisma Client, static frontend, and PostgreSQL database.](/docs/v6/orm/prisma-client/deployment/traditional/images/koyeb-architecture.png)
![Koyeb deployment architecture diagram showing a Node.js backend with Prisma Client, static frontend, and PostgreSQL database.](/img/v6/orm/prisma-client/deployment/traditional/images/koyeb-architecture.png)

The focus of this guide is showing how to deploy projects using Prisma ORM to Koyeb. The starting point will be the [Prisma Koyeb example](https://github.com/koyeb/example-prisma), which contains an Express.js server with a couple of preconfigured REST endpoints and a simple frontend.

Expand Down Expand Up @@ -133,7 +133,7 @@ Last, give your application a name and click the **Create App** button.

**Checkpoint:** Open the deployed app by clicking on the screenshot of the deployed app. Once the page loads, click on the **Check API status** button, which should return: `{"up":true}`

![Koyeb app creation interface showing environment variables configuration and Create App button.](/docs/v6/orm/prisma-client/deployment/traditional/images/koyeb-app-creation.png)
![Koyeb app creation interface showing environment variables configuration and Create App button.](/img/v6/orm/prisma-client/deployment/traditional/images/koyeb-app-creation.png)

Congratulations! You have successfully deployed the app to Koyeb.

Expand All @@ -147,7 +147,7 @@ You can use the static frontend to interact with the API you deployed via the pr

Open up the preview URL in your browser, the URL should like this: `https://APP_NAME-ORG_NAME.koyeb.app`. You should see the following:

![Deployed Prisma app frontend in browser showing Check API status, Seed data, and Load feed buttons.](/docs/v6/orm/prisma-client/deployment/traditional/images/koyeb-deployed.png)
![Deployed Prisma app frontend in browser showing Check API status, Seed data, and Load feed buttons.](/img/v6/orm/prisma-client/deployment/traditional/images/koyeb-deployed.png)

The buttons allow you to make requests to the REST API and view the response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Your application is now deploying to Railway, but it won't properly run without

In the next section, you'll configure a database and set the `DATABASE_URL` environment variable in Railway.

![Railway deploying application](/docs/v6/orm/prisma-client/deployment/traditional/images/railway-deploying.png)
![Railway deploying application](/img/v6/orm/prisma-client/deployment/traditional/images/railway-deploying.png)

## Configure your database

Expand All @@ -59,7 +59,7 @@ You'll need a Prisma Postgres connection string. There are two ways to obtain on
5. Paste your database connection string as the value
6. Click **Deploy** to redeploy your application with the new environment variable

![Railway environment variables setup](/docs/v6/orm/prisma-client/deployment/traditional/images/railway-env-vars.png)
![Railway environment variables setup](/img/v6/orm/prisma-client/deployment/traditional/images/railway-env-vars.png)

### 3. Access your application

Expand All @@ -69,7 +69,7 @@ Once the deployment completes with the database URL configured:
2. Under **Networking**, click **Generate Domain**
3. Your application will be available at the generated URL

![Railway networking settings](/docs/v6/orm/prisma-client/deployment/traditional/images/railway-networking.png)
![Railway networking settings](/img/v6/orm/prisma-client/deployment/traditional/images/railway-networking.png)

Go to the generated URL and you'll see your deployed app!

Expand All @@ -79,7 +79,7 @@ If you used the example project, you should see three api endpoints already set
- Load feed (`/api/feed`)
- Seed data (`/api/seed`)

![Railway deployed application](/docs/v6/orm/prisma-client/deployment/traditional/images/railway-final-product.png)
![Railway deployed application](/img/v6/orm/prisma-client/deployment/traditional/images/railway-final-product.png)

If you see any errors:

Expand Down
Loading
Loading