From e6fb2dd8f6a1d1e9930d3526249c6ef5130562df Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:35:13 +0600 Subject: [PATCH 1/6] fix: broken link DC-6439 --- static/_redirects | 1 + 1 file changed, 1 insertion(+) diff --git a/static/_redirects b/static/_redirects index 73e15e9f5e..bdcc55e6b8 100644 --- a/static/_redirects +++ b/static/_redirects @@ -839,6 +839,7 @@ /reference/errors/migrate-resolve /docs/orm/prisma-migrate/workflows/patching-and-hotfixing#failed-migration /reference/errors/migrate-shadow /docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database +/data-platform/accelerate/concepts* /docs/accelerate ### NO REDIRECTS BELOW THIS LINE. ADD REDIRECTS ABOVE THIS SECTION ### From 01b5e6d17b1e60384614b39383a9b92dfcf4b11c Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:01:58 +0600 Subject: [PATCH 2/6] feat: add new commands to ppg dev --- .../300-database/550-local-development.mdx | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/content/250-postgres/300-database/550-local-development.mdx b/content/250-postgres/300-database/550-local-development.mdx index c3a1f5d5ed..24f4f1e036 100644 --- a/content/250-postgres/300-database/550-local-development.mdx +++ b/content/250-postgres/300-database/550-local-development.mdx @@ -88,6 +88,48 @@ npx prisma dev --name mydb1 Whenever you pass the `--name mydb1` to `prisma dev`, the command will return the same connection string pointing to a local instance called `mydb1`. +### Creating detached instances + +You can create and start new Prisma Postgres instances in detached mode (running in the background) using the `--detach` flag: + +```terminal +npx prisma dev --name mydb --detach +``` + +This creates a new instance and immediately starts it in the background, similar to `docker run`. This is particularly useful for automated workflows and CI/CD pipelines where you need instances to run without interactive terminals. + +## Starting existing Prisma Postgres instances in the background + +You can start existing Prisma Postgres instances in the background using: + +```terminal +npx prisma dev start +``` + +`` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example: + +```terminal +npx prisma dev start mydb # starts a DB called `mydb` in the background +``` + +To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: + +```terminal +npx prisma dev start mydb* # starts all DBs starting with `mydb` +``` + +This command enables you to manage Prisma Postgres instances outside of the VS Code extension, allowing for background instance management in your development workflow. + +## Listing Prisma Postgres instances + +You can view all your local Prisma Postgres instances using: + +```terminal +npx prisma dev ls +``` + +This command lists all available instances on your system, showing their current status and configuration. + ## Stopping Prisma Postgres instances You can stop a running Prisma Postgres instance with this command: @@ -108,6 +150,12 @@ To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), npx prisma dev stop mydb* # stops all DBs starting with `mydb` ``` +:::note + +The `stop` command is interactive and includes safety prompts to prevent accidental operations. You'll be asked to confirm the action by typing a confirmation phrase. + +::: + ## Removing Prisma Postgres instances Prisma Postgres saves the information and data from your local Prisma Postgres instances on your file system. To remove any trace from a database that's not in use any more, you can run the following command: @@ -128,6 +176,12 @@ To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), npx prisma dev rm mydb* # removes all DBs starting with `mydb` ``` +:::note + +The `rm` command is interactive and includes safety prompts to prevent accidental data loss. You'll be asked to confirm the action by typing a confirmation phrase that hints at the risks involved. + +::: + ## Using local Prisma Postgres with any ORM Local Prisma Postgres supports [direct TCP connections](/postgres/database/direct-connections), allowing you to connect to it via any tool. From ae9454da58392d40c93cf498cfee6cf061d92cfc Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:09:56 +0600 Subject: [PATCH 3/6] fix: update cli ref docs DR-6247 --- .../200-prisma-cli-reference.mdx | 53 +++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index 663c2cfcef..36c4ff7b1d 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -846,6 +846,7 @@ The `dev` command starts a [local Prisma Postgres](/postgres/database/local-deve | `--db-port` (or `-P`) | No | Port number the local Prisma Postgres database server will listen on. | `51214` | | `--shadow-db-port` | No | Port number the shadow database server will listen on. | `51215` | | `--debug` | No | Enable debug logging. | `false` | +| `--detach` | No | Create and start the instance in detached mode (running in the background). Useful for automated workflows and CI/CD pipelines. | `false` | ### Examples @@ -879,6 +880,38 @@ Fetching latest updates for this subcommand... +### `dev start` + +Starts existing [local Prisma Postgres](/postgres/database/local-development) instances in the background: + +```terminal +npx prisma dev start +``` + +`` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example: + +```terminal +npx prisma dev start mydb # starts a DB called `mydb` in the background +``` + +To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: + +```terminal +npx prisma dev start mydb* # starts all DBs starting with `mydb` +``` + +This enables background instance management outside of the VS Code extension. + +### `dev ls` + +Lists all available [local Prisma Postgres](/postgres/database/local-development) instances: + +```terminal +npx prisma dev ls +``` + +This command shows all instances on your system with their current status and configuration. + ### `dev stop` Stops one or more [local Prisma Postgres](/postgres/database/local-development) databases: @@ -899,6 +932,12 @@ To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), npx prisma dev stop mydb* # stops all DBs starting with `mydb` ``` +:::note + +The `stop` command is interactive and includes safety prompts to prevent accidental operations. + +::: + ### `dev rm` Removes the data of one or more [local Prisma Postgres](/postgres/database/local-development) databases from your file system: @@ -910,14 +949,20 @@ npx prisma dev rm `` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be removed, for example: ```terminal -npx prisma dev stop mydb # stops a DB called `mydb` +npx prisma dev rm mydb # removes a DB called `mydb` ``` -To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: +To remove all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: +```terminal +npx prisma dev rm mydb* # removes all DBs starting with `mydb` ``` -npx prisma dev stop mydb* # stops all DBs starting with `mydb` -``` + +:::note + +The `rm` command is interactive and includes safety prompts to prevent accidental data loss. + +::: ## `db` From f6490e92bf4cb0799a9560bb475839122aa5ef68 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:59:45 +0600 Subject: [PATCH 4/6] fix: clear detached --- .../200-orm/500-reference/200-prisma-cli-reference.mdx | 1 - .../300-database/550-local-development.mdx | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index 36c4ff7b1d..eaaa40bc9b 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -846,7 +846,6 @@ The `dev` command starts a [local Prisma Postgres](/postgres/database/local-deve | `--db-port` (or `-P`) | No | Port number the local Prisma Postgres database server will listen on. | `51214` | | `--shadow-db-port` | No | Port number the shadow database server will listen on. | `51215` | | `--debug` | No | Enable debug logging. | `false` | -| `--detach` | No | Create and start the instance in detached mode (running in the background). Useful for automated workflows and CI/CD pipelines. | `false` | ### Examples diff --git a/content/250-postgres/300-database/550-local-development.mdx b/content/250-postgres/300-database/550-local-development.mdx index 24f4f1e036..6fcca985fd 100644 --- a/content/250-postgres/300-database/550-local-development.mdx +++ b/content/250-postgres/300-database/550-local-development.mdx @@ -88,16 +88,6 @@ npx prisma dev --name mydb1 Whenever you pass the `--name mydb1` to `prisma dev`, the command will return the same connection string pointing to a local instance called `mydb1`. -### Creating detached instances - -You can create and start new Prisma Postgres instances in detached mode (running in the background) using the `--detach` flag: - -```terminal -npx prisma dev --name mydb --detach -``` - -This creates a new instance and immediately starts it in the background, similar to `docker run`. This is particularly useful for automated workflows and CI/CD pipelines where you need instances to run without interactive terminals. - ## Starting existing Prisma Postgres instances in the background You can start existing Prisma Postgres instances in the background using: From d537bbfcfc9821750df2a874af73ea11444deaee Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:07:26 +0600 Subject: [PATCH 5/6] Update content/200-orm/500-reference/200-prisma-cli-reference.mdx --- content/200-orm/500-reference/200-prisma-cli-reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index eaaa40bc9b..3cc63b78a0 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -890,7 +890,7 @@ npx prisma dev start `` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example: ```terminal -npx prisma dev start mydb # starts a DB called `mydb` in the background +npx prisma dev start mydb # starts a DB called `mydb` in the background if it already exists ``` To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: From d344441255457805afeba680e26313a3242dd149 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:12:23 +0600 Subject: [PATCH 6/6] fix: update docs --- .../200-prisma-cli-reference.mdx | 20 ++++++++++++++++--- .../300-database/550-local-development.mdx | 14 +++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index 3cc63b78a0..b26990b503 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -879,9 +879,23 @@ Fetching latest updates for this subcommand... +**Run `prisma dev` with a specific name** + +```terminal +npx prisma dev --name="mydbname" +``` + +This creates a named instance called `mydbname` that you can later start, stop, or manage using the instance management commands. + ### `dev start` -Starts existing [local Prisma Postgres](/postgres/database/local-development) instances in the background: +Starts existing [local Prisma Postgres](/postgres/database/local-development) instances in the background. + +:::note + +This command only works with instances that already exist. + +::: ```terminal npx prisma dev start @@ -890,13 +904,13 @@ npx prisma dev start `` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example: ```terminal -npx prisma dev start mydb # starts a DB called `mydb` in the background if it already exists +npx prisma dev start mydb # starts a DB called `mydb` in the background (only if it already exists) ``` To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: ```terminal -npx prisma dev start mydb* # starts all DBs starting with `mydb` +npx prisma dev start mydb* # starts all existing DBs starting with `mydb` ``` This enables background instance management outside of the VS Code extension. diff --git a/content/250-postgres/300-database/550-local-development.mdx b/content/250-postgres/300-database/550-local-development.mdx index 6fcca985fd..059443c287 100644 --- a/content/250-postgres/300-database/550-local-development.mdx +++ b/content/250-postgres/300-database/550-local-development.mdx @@ -83,10 +83,10 @@ To transition to production, you only need to update the database URL in the `.e You can target a specific, local Prisma Postgres instance via the `--name` (`-n`) option of the `prisma dev` command, for example: ```terminal -npx prisma dev --name mydb1 +npx prisma dev --name="mydb1" ``` -Whenever you pass the `--name mydb1` to `prisma dev`, the command will return the same connection string pointing to a local instance called `mydb1`. +Whenever you pass the `--name="mydb1"` to `prisma dev`, the command will return the same connection string pointing to a local instance called `mydb1`. This creates a named instance that you can later manage using the instance management commands. ## Starting existing Prisma Postgres instances in the background @@ -96,16 +96,22 @@ You can start existing Prisma Postgres instances in the background using: npx prisma dev start ``` +:::note + +The `dev start` command only works with instances that already exist. + +::: + `` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example: ```terminal -npx prisma dev start mydb # starts a DB called `mydb` in the background +npx prisma dev start mydb # starts a DB called `mydb` in the background (only if it already exists) ``` To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: ```terminal -npx prisma dev start mydb* # starts all DBs starting with `mydb` +npx prisma dev start mydb* # starts all existing DBs starting with `mydb` ``` This command enables you to manage Prisma Postgres instances outside of the VS Code extension, allowing for background instance management in your development workflow.