Prisma

P

Prisma

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

Join

Handling sqlite locally and d1 production db?

How do I handle these two environments?

Need to clarify where to import Prisma from

In the past the prisma client was generated inside node_modules. So I always imported everything from @prisma/client. But now since the Prisma Client is generated in a custom path outside node_modules I should be importing it like this right? I am using Next.js and according to this page I create the Prisma Client instance like below. This is the correct way right? Instead of importing the PrismaClient from @prisma/client like we did in the past now I import it from the generated output? ```ts import { PrismaClient } from "../generated/prisma"...

Prisma generate error

Is it just me or is this happening to everybody. Using prisma has been returning errors lately, now on multiple databases - Cockroachlabs and now Cloudflare: ``` Shell npx prisma generate [in d1-api-worker] (Generate prisma client) Prisma schema loaded from prisma/schema.prisma
Error: Could not resolve @prisma/client despite the installation that we just tried. Please try to install it by hand with npm i @prisma/client and rerun npx "prisma generate"🙏. ...

Question about Prisma Migrations and "public" Schema

Hi! I noticed that in my recent Prisma migrations, the generated SQL now includes "public"."table_name" for table creation and foreign keys, but in my older migrations, it was just "table_name" without the schema prefix. I haven’t changed anything in my schema.prisma regarding schemas. Why does Prisma now add the "public". prefix in migration SQL? Is this a new default behavior in recent Prisma versions? Is there any impact or best practice I should be aware of?...
No description

Errors with transaction

Hi, i've facing a lot of prisma errors with transactions and connection pool. My environment is: - PostgreSQL on GCP, connection string parameters: ?connection_limit=50&pool_timeout=20 - Default connection with prisma client....

Rust-free ORM still download engine binary

Hello đź‘‹ Some (important) context first: I'm developing a Prisma-powered project and I'm switching between 2 laptops:...

Embedded studio question

Does the embedded mode work with every db or just ppg? Are there any examples for different ones, and would you mind pointing me to the resources if any (besides the ppg reference demo)?

Can't connect Prisma Accelerate to MySQL on Railway

I'm trying to connect Prisma Accelerate to a MySQL database hosted on Railway, but I keep running into issues. When I use Prisma normally (without Accelerate), the connection works fine using this URL: mysql://[user]:[password]@auto.proxy.rlwy.net:44574/mydb ...
No description

prisma skips environment variable loading with config file?

is there a way to pass the environment variables in the config file https://www.prisma.io/docs/orm/reference/prisma-config-reference instead of using dotenv(). this originally automatically worked specifying the env varible in schema.prisma but breaks with the config file

Prisma Accelerate’s Ghost Cache: Refusing to Drop UUID+Email for Int+Username

I’m wrestling with a stubborn spirit in the pool that won’t let go of my old schema. Here’s the saga: Environment DB: Neon PostgreSQL (pooled URL, sslmode=require) ...

Generated Prisma Client

Hi, I've recently tried to move to generated prisma client but got stuck with lot's of typescript errors mostly to lack of infering (I guess). I needed to type few things myself but I am still strugling with others. For example I am using trpc, I have trpc prodedure names protectedProcuder that ensure that user is authorized to access. Inside I use some prisma calls and got this error: "The inferred type of 'protectedProcedure' cannot be named without a reference to '../node_modules/@acme/db/dist/generated/prisma/enums'. This is likely not portable. A type annotation is necessary." ...

How to use connect with relations in Prisma (normal case explained)

I can't understand why some time connect work and some time not. I can't understand how and when it work? Please help me. In user connect work properly but in institute the connect not work for address.
No description

Error validating datasource `db`: the URL must start with the protocol `prisma://` or `prisma+postgr

Attempting to run e2e tests in a docker environment against a standalone nextjs server container. I use prisma accelerate in production, but for tests these will run in a server environment - so accelerate is not desired. I am working on a dynamic build and runtime that allows for dynamically using accelerate depending on the environment, but for debugging this issue I've simplified things and I've removed prisma accelerate completely from this branch to try and isolate the cause of this issue. This error is appearing in both 'test' and 'development' environments, also from Cypress runtime. But the db url is valid, the db is up, and I'm not using accelerate, i'm generating with --no-engine=false. So I don't understand why prisma is trying to use accelerate. Is there some way to have prisma print out why it's attempting to look for an accelerate url? error log...

Migrate to Prisma Postgres

How is the easiest way to migrate my current postgres to a prisma postgres (already use prisma as orm)? Is there a way to import a backup file or whatever?

How do I setup different database environments using the Vercel integration

I saw your blog post about Platform Environments, and enabled the feature on my project. But it seems that it's expecting a remote database; and I was expecting it to create a new DB. How do folks typically create a production and pre-production DB environments to work with Vercel? My fallback is just to integrate a new project for each environment....

Error "@prisma/client did not initialize yet." in Nuxt 4

So tl;dr of the issue is that when calling any API endpoint that uses Prisma I get following error
'@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.\n'
'@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.\n'
My project is using Nuxt 4 with new directory structure and Supabase. Prisma Studio is working normally so in some level the connection between prisma and the database is there. I have attached screenshot of my directory structure. Anything that looks odd there? I highlighted the prisma related stuff and the API endpoint using it that triggers the error....
No description

My Prisma client 6.3.1 is started failing to build, anything related to new release?

All of a sudden, the pipeline is failing for our service. Client is at 6.3.1 and prisma at 6.3.1 Please suggest a way or any docs, for me to refere. Thanks

Tiberius integrated authentication broken on Unix platforms with libgssapi

Hello! We are using your Tiberius library and are currently in the process of migrating from Windows to Linux. However, the integrated authentication is broken when using debug mode to build due to safeties added in Rust. This is fixed in Libgssapi (https://github.com/estokes/libgssapi/pull/23). Therefore this library needs to be bumped. There is currently an active PR with a fix: https://github.com/prisma/tiberius/pull/372 but it seems it has been there for some time without any activity. Is this something you guys are willing to fix?...

Cannot seed or pg_restore prisma-postgres db

I have set up a prisma postgres project, and have successfully deployed my schema to it. I can not run prisma seed against it as I get "Permission denied for Table xyz" error, and when trying to import a backup from my previous local postgres DB via tunnel I get errors "Table/Function" etc already exists". What am I missing? I followed all steps on the dashboard, just wanna see if the paid solution is any good with deep nested includes, wher the ORM for a locally hosted DB fails. I also get all sorts of errors in the UI for console.prisma.io...

Get an omitted field back for one query

Hello there, so I have globally configured that the password field for the User model will always be omitted. However, on authentication, I want #findFirst to return all of it's fields including the password. I know I can achieve that by just select:'ing all fields and the password, but is there a way to not hardcode that?
So that the following does return the whole User object instead of just the password or null? ```typescript const user = await this.prismaService.user.findFirst({ ...