Setup
Integrate Prisma ORM easily into your Nuxt app.
Installation
- Add
@prisma/nuxt
dependency to your project:
npm
npm install -D @prisma/nuxt
- Add it to your
modules
section in yournuxt.config
:
export default defineNuxtConfig({
modules: ['@prisma/nuxt']
})
- Activate the module prompts for setting up Prisma ORM:
npm
npm run dev
The prompts will direct you to:
- install Prisma CLI
- set up a Prisma schema
- run a migration to create database tables with Prisma Migrate
- install and generate Prisma Client to query your database
- integrate Prisma Studio within Nuxt DevTools to conveniently view and edit your data
That's it! You can now use Prisma ORM in your Nuxt app ✨
Options
You can customize the module's behavior by using the prisma
property in nuxt.config
:
nuxt.config.ts
export default defineNuxtConfig({
prisma: {
// Options
}
})
See the module options.
Table of Contents