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..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,6 +879,52 @@ 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. + +:::note + +This command only works with instances that already exist. + +::: + +```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 (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 existing 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 +945,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 +962,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` diff --git a/content/250-postgres/300-database/550-local-development.mdx b/content/250-postgres/300-database/550-local-development.mdx index c3a1f5d5ed..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,48 @@ 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 + +You can start existing Prisma Postgres instances in the background using: + +```terminal +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 (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 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. + +## 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 @@ -108,6 +146,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 +172,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. 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 ###