You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/250-postgres/300-database/550-local-development.mdx
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,10 +83,10 @@ To transition to production, you only need to update the database URL in the `.e
83
83
You can target a specific, local Prisma Postgres instance via the `--name` (`-n`) option of the `prisma dev` command, for example:
84
84
85
85
```terminal
86
-
npx prisma dev --namemydb1
86
+
npx prisma dev --name="mydb1"
87
87
```
88
88
89
-
Whenever you pass the `--namemydb1` 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
90
91
91
## Starting existing Prisma Postgres instances in the background
92
92
@@ -96,16 +96,22 @@ You can start existing Prisma Postgres instances in the background using:
96
96
npx prisma dev start <glob>
97
97
```
98
98
99
+
:::note
100
+
101
+
The `dev start` command only works with instances that already exist.
102
+
103
+
:::
104
+
99
105
`<glob>` is a placeholder for a glob pattern to specify which local Prisma Postgres instances should be started, for example:
100
106
101
107
```terminal
102
-
npx prisma dev start mydb # starts a DB called `mydb` in the background
108
+
npx prisma dev start mydb # starts a DB called `mydb` in the background (only if it already exists)
103
109
```
104
110
105
111
To start all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob:
106
112
107
113
```terminal
108
-
npx prisma dev start mydb* # starts all DBs starting with `mydb`
114
+
npx prisma dev start mydb* # starts all existing DBs starting with `mydb`
109
115
```
110
116
111
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.
0 commit comments