Skip to content

Commit b821fba

Browse files
authored
patch: update docs (#7374)
* fix: broken link DC-6439 * feat: add new commands to ppg dev * fix: update cli ref docs DR-6247 * fix: clear detached * Update content/200-orm/500-reference/200-prisma-cli-reference.mdx * fix: update docs
1 parent 56e49e9 commit b821fba

File tree

3 files changed

+115
-6
lines changed

3 files changed

+115
-6
lines changed

content/200-orm/500-reference/200-prisma-cli-reference.mdx

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,52 @@ Fetching latest updates for this subcommand...
879879

880880
</CodeWithResult>
881881

882+
**Run `prisma dev` with a specific name**
883+
884+
```terminal
885+
npx prisma dev --name="mydbname"
886+
```
887+
888+
This creates a named instance called `mydbname` that you can later start, stop, or manage using the instance management commands.
889+
890+
### `dev start`
891+
892+
Starts existing [local Prisma Postgres](/postgres/database/local-development) instances in the background.
893+
894+
:::note
895+
896+
This command only works with instances that already exist.
897+
898+
:::
899+
900+
```terminal
901+
npx prisma dev start <glob>
902+
```
903+
904+
`<glob>` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example:
905+
906+
```terminal
907+
npx prisma dev start mydb # starts a DB called `mydb` in the background (only if it already exists)
908+
```
909+
910+
To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob:
911+
912+
```terminal
913+
npx prisma dev start mydb* # starts all existing DBs starting with `mydb`
914+
```
915+
916+
This enables background instance management outside of the VS Code extension.
917+
918+
### `dev ls`
919+
920+
Lists all available [local Prisma Postgres](/postgres/database/local-development) instances:
921+
922+
```terminal
923+
npx prisma dev ls
924+
```
925+
926+
This command shows all instances on your system with their current status and configuration.
927+
882928
### `dev stop`
883929

884930
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`),
899945
npx prisma dev stop mydb* # stops all DBs starting with `mydb`
900946
```
901947

948+
:::note
949+
950+
The `stop` command is interactive and includes safety prompts to prevent accidental operations.
951+
952+
:::
953+
902954
### `dev rm`
903955

904956
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 <glob>
910962
`<glob>` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be removed, for example:
911963

912964
```terminal
913-
npx prisma dev stop mydb # stops a DB called `mydb`
965+
npx prisma dev rm mydb # removes a DB called `mydb`
914966
```
915967

916-
To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob:
968+
To remove all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob:
917969

970+
```terminal
971+
npx prisma dev rm mydb* # removes all DBs starting with `mydb`
918972
```
919-
npx prisma dev stop mydb* # stops all DBs starting with `mydb`
920-
```
973+
974+
:::note
975+
976+
The `rm` command is interactive and includes safety prompts to prevent accidental data loss.
977+
978+
:::
921979

922980

923981
## `db`

content/250-postgres/300-database/550-local-development.mdx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,48 @@ To transition to production, you only need to update the database URL in the `.e
8383
You can target a specific, local Prisma Postgres instance via the `--name` (`-n`) option of the `prisma dev` command, for example:
8484

8585
```terminal
86-
npx prisma dev --name mydb1
86+
npx prisma dev --name="mydb1"
8787
```
8888

89-
Whenever you pass the `--name mydb1` to `prisma dev`, the command will return the same connection string pointing to a local instance called `mydb1`.
89+
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.
90+
91+
## Starting existing Prisma Postgres instances in the background
92+
93+
You can start existing Prisma Postgres instances in the background using:
94+
95+
```terminal
96+
npx prisma dev start <glob>
97+
```
98+
99+
:::note
100+
101+
The `dev start` command only works with instances that already exist.
102+
103+
:::
104+
105+
`<glob>` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example:
106+
107+
```terminal
108+
npx prisma dev start mydb # starts a DB called `mydb` in the background (only if it already exists)
109+
```
110+
111+
To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob:
112+
113+
```terminal
114+
npx prisma dev start mydb* # starts all existing DBs starting with `mydb`
115+
```
116+
117+
This command enables you to manage Prisma Postgres instances outside of the VS Code extension, allowing for background instance management in your development workflow.
118+
119+
## Listing Prisma Postgres instances
120+
121+
You can view all your local Prisma Postgres instances using:
122+
123+
```terminal
124+
npx prisma dev ls
125+
```
126+
127+
This command lists all available instances on your system, showing their current status and configuration.
90128

91129
## Stopping Prisma Postgres instances
92130

@@ -108,6 +146,12 @@ To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`),
108146
npx prisma dev stop mydb* # stops all DBs starting with `mydb`
109147
```
110148

149+
:::note
150+
151+
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.
152+
153+
:::
154+
111155
## Removing Prisma Postgres instances
112156

113157
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`),
128172
npx prisma dev rm mydb* # removes all DBs starting with `mydb`
129173
```
130174

175+
:::note
176+
177+
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.
178+
179+
:::
180+
131181
## Using local Prisma Postgres with any ORM
132182

133183
Local Prisma Postgres supports [direct TCP connections](/postgres/database/direct-connections), allowing you to connect to it via any tool.

static/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@
839839
/reference/errors/migrate-resolve /docs/orm/prisma-migrate/workflows/patching-and-hotfixing#failed-migration
840840
/reference/errors/migrate-shadow /docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database
841841

842+
/data-platform/accelerate/concepts* /docs/accelerate
842843

843844
### NO REDIRECTS BELOW THIS LINE. ADD REDIRECTS ABOVE THIS SECTION ###
844845

0 commit comments

Comments
 (0)