VS Code extension
Overview
The Prisma VS Code extension is a powerful tool when you're building applications with Prisma Postgres with VS Code as your editor.
Database management UI
The Prisma VS Code extension includes a dedicated UI to manage Prisma Postgres instances (local and remote).
Workflows
The UI enables the following workflows:
- Authenticate with the
- View local Prisma Postgres instances
- Create and delete remote Prisma Postgres instances
- View and edit data via an embedded Prisma Studio
Usage
To manage Prisma Postgres instances via the UI in the Prisma VS Code extension:
- Ensure you have the latest version of the Prisma VS Code extension installed
- Find the Prisma logo in the Activity Bar
- Click the Sign in to get started button
- Authenticate with the via the popup and select a target workspace
Agent mode
VS Code includes an agent mode (powered by GitHub Copilot) that automatically performs code changes and executes Prisma CLI commands based on your prompts.
Capabilities
The Prisma VS Code extension enables support for VS Code agent mode.
VS Code agent mode can perform the following tasks:
- Check migration status (e.g. Flag unapplied migrations)
- Create and apply schema migrations automatically
- Sign in to the Prisma Data Platform
- Provision Prisma Postgres instances, letting you start coding right away
How to enable and use the VS Code agent
The latest version of the Prisma VS Code extension fully supports agent mode. Since extensions update automatically, no manual action is required to enable it.
We recommend you to use the latest version of Prisma ORM.
To use the agent mode:
- Open GitHub Copilot Chat in VS Code and switch to Agent mode.
- With GitHub Copilot Chat open and the Prisma extension updated, you can simply type a request such as: "Create a new database for me and add the connection string to the .env file".
- The agent will request permission to make changes in your workspace.
- It automatically handles login to your Prisma Data Platform account before proceeding.
- Upon approval, the agent creates the new database and adds the connection string to your
.env
file. - You can also use agent mode to run migrations, generate the Prisma Client, and perform other tasks.
Currently, the agent mode uses your default workspace in the Prisma Data Platform.
Querying Prisma docs from VS Code using GitHub Copilot
Complementing the agent, the Prisma Copilot extension allows you to query Prisma documentation directly within VS Code.
You need to install the Prisma for Copilot extension from the GitHub marketplace.
Then, switch to Ask mode in GitHub Copilot Chat and type your question using the @prisma-for-github-copilot
namespace.
For more details, refer to our GitHub Copilot documentation.