Prisma

P

Prisma

The official Discord server of Prisma! Find us online at prisma.io

Join

Easy way to programmatically access Prisma schema for AI assistant integration?

I'm building an AI assistant for my Next.js app that needs to know about my database schema to generate proper queries. Current challenge: I need a way to programmatically extract model/table definitions from my Prisma schema at runtime without manually hardcoding the schema description every time my models change. I've seen that Prisma has a DMMF (Data Model Meta Format) that can be accessed via Prisma.dmmf, but it feels overly complex for my use case. I also have Zod also don't know how to generate something that the ai can use at runtime....

Are cloud Prisma Postgres instances encrypted at rest?

When using Prisma's cloud-hosted Prisma Postgres service, is the database encrypted at rest? (on all pricing tiers?)

Problem with Studio in the console (Data Platform)

Hello, I'm currently trying to set up a way for non-tech people in my team to use prisma studio. I thought to use your console feature, but I'm getting a completely blank screen and an error in the browser's console. Studio works perfectly locally and the db works perfectly in the app both locally and in prod, so I'm not sure if this is on my side. I've run prisma validate and the schema came out as valid too. This is a Postgres database on supabase, if that information helps at all....
No description

Prisma Studio does not show additional spaces in between two works.

Original: https://discord.com/channels/937751382725886062/1146889757364850791/1371493729243893861 Does Prisma get rid of additional spaces between entries? For example, I saved abc Hrl123 but it's being returned as abc Hrl123 This is showing one space instead of 7....

I’m running into an issue with Prisma + SQL Server when using a custom schema (not dbo)

Here’s what I’m doing: • I’m using a custom schema called custom_schema and mapped my models with @@map or @map("custom_schema.TableName"). • I manually created the schema custom_schema in the database before running the initial migration. • Running the initial migration with prisma migrate dev on a clean database worked fine. It created the custom_schema tables and the _prisma_migrations table, and the migration completed successfully. • Later, when I tried to create a second migration using pnpm prisma migrate dev --name test_migration, I ran into this error: ...

migrate dev not working in prisma 6.7.0

Hi, I'm having issuew with @prisma/client types... After running the migrate dev command, types are not generated... Error...

Next.js 15 build error

Next.js 15 project using Prisma Mongodb on Windows 10, this error occurs when build the project. It is okay in development. How to fix it?
No description

rift detected: Your database schema is not in sync with your migration history

Hello, I need some help with some drift happening with my production database with Prisma (6.5), Postgre SQL and Next.js. Seems like its considering almost all tables to be new tables, while they are actually the same....
No description

Problem with Prisma initialization

Hello, I am pretty new to programing and I am having trouble connecting Prisma DB to my Next.js application. I am trying to connect, but everytime that i run my app, it crashes on an error: "@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again." I have a prisma.ts file with a piece of code i found on Prisma web, but it seems like it crashes on calling the new PrismaClient class. And yes, i've tried using npx prisma generate, and that looks like it works, which made me so desperate to write here 😄...

Does Prisma consider a transaction as one operation?

```ts await prisma.$transaction (async (tx) => { await tx.user.create(...); await tx.password.create(...); });...

Dynamic require of "node:fs" is not supported

After upgrading prisma to the latest version and exporting the client into a custom folder, when I build the application with esbuild I do have this node:fs problem. schema.prisma: ``` generator client {...

ReferenceError: __dirname is not defined in ES module scope

prisma.ts import { PrismaClient } from '../../generated/prisma' const globalForPrisma = globalThis as unknown as {...

TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute

In the prisma file, I put import { PrismaClient } from './prisma-wrapper' const prisma = globalThis.prisma || new PrismaClient() if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma...

I upgraded to version 6.7.0 (not expected) and now env is not workin

I literally ran pnpm add chart.js and all my packages upgraded, part of those were Prisma to 6.7.0 and now it just can't read my env("DATABASE_URL") and claims that it is not set and therefor defaulting to localhost. It worked a minute ago, but no matter how much I restart the server or do prisma generate I get same error: [Error: No database host or connection string was set, and key parameters have default values (host: localhost, user: didrikbirkemalm, db: didrikbirkemalm, password: null). Is an environment variable missing? Alternatively, if you intended to connect with these parameters, please set the host to 'localhost' explicitly.] { clientVersion: '6.7.0', digest: '3846124726' }...

Subject: Prisma Migration: Adding Non-Nullable Field to Existing Table (vs. TypeORM)

I'm new to Prisma (coming from TypeORM) and have a question about migrations. I added a new, non-nullable field to my User model, which already had data. When I ran prisma migrate dev, it errored out, as expected, because existing rows wouldn't have a value for the new required field. Prisma suggested using --create-only and manually editing the SQL. This is different from my TypeORM experience, where adding a required field and generating/applying a migration was more direct....

Generated Prisma Client (prisma-client generator) still imports from @prisma/client/runtime/library

I'm using the new prisma-client generator (Early Access) with the following generator block in my schema.prisma: generator client { provider = "prisma-client" output = "../src/generated/prisma"...

Vercel Build Failing with Prisma + Supabase + Next.js API Routes

Hey, I'm deploying a backend-only Next.js project using API routes (no frontend) with Prisma (connected to Supabase), and everytime there's build failures on Vercel. Everything works locally, but Vercel throws errors like: - @prisma/client has no exported member 'PrismaClient' Cannot find module 'express' npm run build exited with code 1 I’ve already tried:npx prisma generate works, Installed all needed deps (@prisma/client, prisma, typescript, etc.), Set CI=false in Vercel env vars, Cleaned project structure and removed old Express files. Still getting the build error. Any idea what I might be missing? Here’s what I’ve got: schema.prisma ```prisma generator client {...

How to build TS application that uses prismaGenerated files

Whenever my typescript project is compiled and built, I've noticed that the application is not outputting my prismaGenerated originally in the src directory into the build directory e.g. dist/project folder, if someone can help me navigate how it's normally done in production that'd be great thank you

prisma 6.7.0 not working in vercel

I’m encountering an issue after upgrading to a new Prisma version. When calling prisma.form.create(), I get the following error: prisma:error Invalid prisma.form.create() invocation: ...

How to compile or get client generation result in memory?

```typescript const schema = await fs.promises.readFile("schema.prisma", "utf8"); const document = await getDMMF({ datamodel: schema }); const result = await compile(dmmf); ...