diff --git a/content/200-orm/800-more/600-help-and-troubleshooting/100-help-articles/900-prisma-nuxt-module.mdx b/content/200-orm/800-more/600-help-and-troubleshooting/100-help-articles/900-prisma-nuxt-module.mdx index 0820bdae57..11ab0e2c89 100644 --- a/content/200-orm/800-more/600-help-and-troubleshooting/100-help-articles/900-prisma-nuxt-module.mdx +++ b/content/200-orm/800-more/600-help-and-troubleshooting/100-help-articles/900-prisma-nuxt-module.mdx @@ -1,9 +1,7 @@ --- - title: 'Using the Nuxt Prisma Module' metaTitle: 'Add Prisma ORM Easily to Your Nuxt Apps' metaDescription: 'Learn how to easily add Prisma ORM to your Nuxt apps, use its features, and understand its limitations.' - --- The Nuxt Prisma module simplifies the integration of Prisma ORM into your Nuxt applications. @@ -187,17 +185,6 @@ If you're using [Nuxt server components](https://nuxt.com/docs/guide/directory-s ``` -#### Using the auto-imported Prisma Client instance in your API route - -You can use the auto-imported Prisma Client instance, prisma, in your Nuxt API route as follows: -```typescript -export default defineEventHandler(async (event) => { - return { - user: await prisma.user.findFirst(), - }; -}); -``` - ### Option B: `lib/prisma.ts` After running through the initial setup prompts, this module creates the `lib/prisma.ts` file which contains a global instance of Prisma Client. @@ -299,6 +286,9 @@ export default defineNuxtConfig({ | **formatSchema** | `boolean` | true | Whether to [format](/orm/reference/prisma-cli-reference#format) the [Prisma Schema](/orm/prisma-schema) file. | | **installStudio** | `boolean` | true | Whether to install and start [Prisma Studio](https://www.prisma.io/studio) in the Nuxt Devtools. | | **autoSetupPrisma** | `boolean` | false | Whether to skip all prompts during setup. This option is useful for automating Prisma setup in scripts or CI/CD pipelines. | +| **skipPrompts** | `false` | false | Skips all prompts | +| **prismaRoot** | `string` | false | Required when using [Nuxt layers](https://nuxt.com/docs/getting-started/layers). For example, if you have a Nuxt layer called `database`, the `prismaRoot` would be `./database` in the base nuxt config. This refers to the folder where Prisma will be initialized or checked. | +| **prismaSchemaPath** | `string` | `undefined` | Required when using [Nuxt layers](https://nuxt.com/docs/getting-started/layers). For example, if you have a Nuxt layer called `database`, the `prismaSchemaPath` would be `./database/prisma/schema.prisma` in the base nuxt config. | ## Limitations @@ -355,4 +345,10 @@ export default defineNuxtConfig({ }) ``` -This configuration ensures that the module specifier is correctly mapped to the appropriate file. \ No newline at end of file +This configuration ensures that the module specifier is correctly mapped to the appropriate file. + +### Limitations in package manager support + +The module is designed to work with popular package managers, including npm, Yarn, and pnpm. However, as of `v0.2`, it is not fully compatible with Bun due to an issue causing an indefinite installation loop. + +Additionally, this package has not been tested with Deno and is therefore not officially **supported.**