Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Follow these steps to create a new Prisma Postgres database:

Once your database was provisioned, find your direct Prisma Postgres connection string:

1. Navigate to your active Prisma Postgres instance.
1. Click the **API Keys** tab in the project's sidenav.
1. Click the **Create API key** button.
1. In the popup, provide a **Name** for the API key and click **Create**.
1. Copy the connection string starting with `postgres://`, this is your direct connection string.
1. Open a project in your [Prisma Console](https://console.prisma.io) account (or create a new one)
1. Navigate to a environment with an active Prisma Postgres instance
1. Click the **Dashboard** tab in the project's sidenav
1. Find the **Connect to your database** card and click the **Connect** button
1. Copy the connection string starting with `postgres://`, this is your direct connection string

Save the connection string, you'll need it in the next step.

Expand Down
32 changes: 16 additions & 16 deletions content/200-orm/500-reference/325-prisma-config-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The Prisma Config file configures the Prisma CLI, including subcommands like `mi
You can define your config in either of two ways:

- Using the `defineConfig` helper:

```ts
import path from "node:path";
import { defineConfig } from "prisma/config";
Expand All @@ -26,11 +27,12 @@ You can define your config in either of two ways:
},
typedSql: {
path: path.join("db", "queries"),
}
},
});
```

- Using TypeScript's `satisfies` operator with the `PrismaConfig` type:

```ts
import path from "node:path";
import type { PrismaConfig } from "prisma";
Expand All @@ -45,7 +47,7 @@ You can define your config in either of two ways:
},
typedSql: {
path: path.join("db", "queries"),
}
},
} satisfies PrismaConfig;
```

Expand All @@ -57,10 +59,10 @@ Here is a simplified version of the `PrismaConfig` type:
export declare type PrismaConfig = {
// Whether features with an unstable API are enabled.
experimental: {
adapter: true,
externalTables: true,
studio: true,
},
adapter: true;
externalTables: true;
studio: true;
};

// The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
schema?: string;
Expand Down Expand Up @@ -98,14 +100,13 @@ Prisma Config files can be named as `prisma.config.*` or `.config/prisma.*` with

:::tip[Recommendation]

- Use **`prisma.config.ts`** for small TypeScript projects.
- Use **`.config/prisma.ts`** for larger TypeScript projects with multiple configuration files (following the [`.config` directory proposal](https://github.com/pi0/config-dir)).
- Use **`prisma.config.ts`** for small TypeScript projects.
- Use **`.config/prisma.ts`** for larger TypeScript projects with multiple configuration files (following the [`.config` directory proposal](https://github.com/pi0/config-dir)).

:::

## Options reference


### `schema`

Configures how Prisma ORM locates and loads your schema file(s). Can be a file or folder path. Relative paths are resolved relative to the `prisma.config.ts` file location. See [here](/orm/prisma-schema/overview/location#multi-file-prisma-schema) for more info about schema location options.
Expand All @@ -118,8 +119,8 @@ Configures how Prisma ORM locates and loads your schema file(s). Can be a file o

A function that returns a Prisma driver adapter instance which is used by the Prisma CLI to run migrations. The function should return a `Promise` that resolves to a valid Prisma driver adapter.

| Property | Type | Required | Default |
| ----------------- | -------------------------------------------------------------- | -------- | ------- |
| Property | Type | Required | Default |
| --------- | ------------------------------------------------------ | -------- | ------- |
| `adapter` | `() => Promise<SqlMigrationAwareDriverAdapterFactory>` | No | none |

Example using the Prisma ORM D1 driver adapter:
Expand All @@ -134,7 +135,7 @@ import "dotenv/config";

export default {
experimental: {
adapter: true
adapter: true,
},
schema: path.join("prisma", "schema.prisma"),
async adapter() {
Expand Down Expand Up @@ -176,7 +177,7 @@ import type { PrismaConfig } from "prisma";

export default {
experimental: {
studio: true
studio: true,
},
studio: {
adapter: async (env: Env) => {
Expand Down Expand Up @@ -219,7 +220,7 @@ export default defineConfig({
});
```

Learn more about the [`externalTables` feature here](/orm/prisma-schema/data-model/externally-managed-tables).
Learn more about the [`externalTables` feature here](/orm/prisma-schema/data-model/externally-managed-tables).

### `migrations.path`

Expand Down Expand Up @@ -277,7 +278,7 @@ export default defineConfig({
});
```

Learn more about the [`externalTables` feature here](/orm/prisma-schema/data-model/externally-managed-tables).
Learn more about the [`externalTables` feature here](/orm/prisma-schema/data-model/externally-managed-tables).

### `views.path`

Expand Down Expand Up @@ -409,7 +410,6 @@ Prisma CLI commands such as `prisma validate` or `prisma migrate` use `prisma.co
- Paths defined in the config file (e.g., `schema`, `migrations`) are always resolved **relative to the location of the config file**, not where you run the CLI command from.
- The CLI must first **find the config file** itself, which depends on how Prisma is installed and the package manager used.


### Behavior with `pnpm prisma`

When Prisma is installed locally and run via `pnpm prisma`, the config file is detected automatically whether you run the command from the project root or a subdirectory.
Expand Down
2 changes: 1 addition & 1 deletion content/200-orm/800-more/350-ai-tools/100-cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ With its built-in database management interface, the [Prisma VS Code extension](

The UI enables the following workflows:

- Authenticate with the [Prisma Console](https://console.prisma.io)
- Authenticate with the [Prisma Console](https://console.prisma.io) (not required for local Prisma Postgres workflows)
- View, create and delete Prisma Postgres instances (local & remote)
- "Push to cloud": Easily deploy a local Prisma Postgres instance
- View and edit data via an embedded Prisma Studio
Expand Down
2 changes: 1 addition & 1 deletion content/200-orm/800-more/350-ai-tools/200-tabnine.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ With its built-in database management interface, the [Prisma VS Code extension](

The UI enables the following workflows:

- Authenticate with the [Prisma Console](https://console.prisma.io)
- Authenticate with the [Prisma Console](https://console.prisma.io) (not required for local Prisma Postgres workflows)
- View, create and delete Prisma Postgres instances (local & remote)
- "Push to cloud": Easily deploy a local Prisma Postgres instance
- View and edit data via an embedded Prisma Studio
Expand Down
2 changes: 1 addition & 1 deletion content/200-orm/800-more/350-ai-tools/300-windsurf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ With its built-in database management interface, [the Prisma VS Code extension](

The UI enables the following workflows:

- Authenticate with the [Prisma Console](https://console.prisma.io)
- Authenticate with the [Prisma Console](https://console.prisma.io) (not required for local Prisma Postgres workflows)
- View, create and delete Prisma Postgres instances (local & remote)
- "Push to cloud": Easily deploy a local Prisma Postgres instance
- View and edit data via an embedded Prisma Studio
Expand Down
11 changes: 5 additions & 6 deletions content/250-postgres/100-introduction/200-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ prisma generate --no-engine
You can access Prisma Postgres with any ORM or database tool of your choice via [direct TCP connections](/postgres/database/direct-connections).

In order to get a direct TCP connection string, you need to:
1. open a project in your [Prisma Console](https://console.prisma.io) account (or create a new one)
1. navigate to a environment with an active Prisma Postgres instance
1. click the **API Keys** tab in the project's sidenav
1. click the **Create API key** button
1. in the popup, provide a **Name** for the API key and click **Create**
1. copy the connection string starting with `postgres://`, this is your direct TCP connection string
1. Open a project in your [Prisma Console](https://console.prisma.io) account (or create a new one)
1. Navigate to a environment with an active Prisma Postgres instance
1. Click the **Dashboard** tab in the project's sidenav
1. Find the **Connect to your database** card and click the **Connect** button
1. Copy the connection string starting with `postgres://`, this is your direct connection string

Once you have the connection string, you can follow the setup docs for PostgreSQL of any ORM or database tool:

Expand Down
13 changes: 12 additions & 1 deletion content/250-postgres/100-introduction/250-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ toc: true

It supports the following workflows:

- Schema migrations and queries (via [Prisma ORM](https://www.prisma.io/orm))
- Schema migrations and queries (via [Prisma ORM](https://www.prisma.io/orm) or any other ORM/database library)
- Connection pooling and caching (via [Prisma Accelerate](https://www.prisma.io/accelerate))
- Local database workflows via [`prisma dev`](/postgres/database/local-development)

## Usage metrics

You can view the following usage metrics in your Console Dashboard:

- Cumulative usage over time
- Total count of requests
- Storage used per project in your workspace
- Operations used per day
- Databases per project

## Billing

Expand Down
2 changes: 1 addition & 1 deletion content/250-postgres/1100-integrations/500-vscode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Prisma VS Code extension includes a dedicated UI to manage Prisma Postgres i

The UI enables the following workflows:

- Authenticate with the [Prisma Console](https://console.prisma.io)
- Authenticate with the [Prisma Console](https://console.prisma.io) (not required for local Prisma Postgres workflows)
- View, create and delete Prisma Postgres instances (local & remote)
- "Push to cloud": Easily deploy a local Prisma Postgres instance
- View and edit data via an embedded Prisma Studio
Expand Down
6 changes: 2 additions & 4 deletions content/250-postgres/300-database/650-direct-connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metaTitle: "Direct connections (TCP)"
metaDescription: "Learn about connecting directly to your Prisma Postgres database via direct TCP."
tocDepth: 3
toc: true
sidebar_class_name: preview-badge
---

## Overview
Expand All @@ -19,9 +18,8 @@ In order to get a direct connection string, you need to:

1. Open a project in your [Prisma Console](https://console.prisma.io) account (or create a new one)
1. Navigate to a environment with an active Prisma Postgres instance
1. Click the **API Keys** tab in the project's sidenav
1. Click the **Create API key** button
1. In the popup, provide a **Name** for the API key and click **Create**
1. Click the **Dashboard** tab in the project's sidenav
1. Find the **Connect to your database** card and click the **Connect** button
1. Copy the connection string starting with `postgres://`, this is your direct connection string

## Connection string
Expand Down
Loading