Prisma

P

Prisma

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

Join

TypedSQL in pipeline?

Hello! I am currently switching my Express.js app from using the prisma-client-js to prisma-client provider. Which means I generate my prisma files into /src/generated/prisma and then use them. Now I also needed a TypedSQL query so I use npx prisma generate --sql to create the corresponting file in the "generated" dir (this dir is gitignored as instructed in the docs). Now my pipeline obviously fails, because in it, I dont have an active database connection, which makes me wonder: - What is the recommended way of handling Prisma in a pipeline with the prisma-client provider. Am I really expected to make a connection to a database, everytime a commit is pushed to the repo? Thank you...

Type safety with queries

Hi, I am using Primsa ORM, and I am having some problem with the type of the data returned from the query. For the types which can be a null value or string, it always returns as type string, but it can be null as well. Here is my model: ```ts...

Create different environment with the Vercel Integration (Prisma Postgres)

Hey, I'm using Prisma Postgres, it works great. I need to have a production and preview env. I can do it without the Vercel integration in /workspace, but i don't have the option when it's connected. How to do it? In the Starter Prisma Postgres Vercel plan they say we can use up to 10 databases. Thank you !...
No description

Error: P1001Can't reach database server at `mydomain:5432

1. The psql connection works fine (both pooled and direct) 2. Prisma db pull works with DEBUG=prisma:* but fails normally I have this problem from my local machine only. it works from server. ...
No description

Failed to apply cleanly to the shadow database - Migration Problems

``Error: P3006 Migration 0_init` failed to apply cleanly to the shadow database. Error code: P1001 Error:...

I keep getting this error `Object literal may only specify known properties, and 'adapter' CF D1

I am using Cloudflare D1 and I keep getting this error Object literal may only specify known properties, and 'adapter' does not exist in type 'Subset<PrismaClientOptions, PrismaClientOptions>'.ts(2353) Using this code: ``` const adapter = new PrismaD1(env.database);...

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' }...