Prisma

P

Prisma

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

Join

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({ ...

Prisma Query Performance Question

I have a nextjs application built with trpc endpoints and Prisma (also using Prisma Postgres - here is my schema). Most of my queries are pretty quick and dont give me any concern about performance, but one of my queries is noticeably slow (get all). This request is made from a trpc endpoint. I think it is fair to assume that this query could be slower than others given it is loading more data, but it is incredibly slow (initial load sometimes taking 3+ seconds and I only have 24 recipes in the db) relative to the rest of my queries. What is even more interesting is this query is shared between pages, and it seems to only be slow on one page. I know there are a handful of variables at play here, but looking at my schema and query, are there any obvious issues I have/improvements to be made (schema index’s, etc). To test this out live here are the 2 deployed pages on my site:...

DB Error?

introspect, 22:14:23 Error SQL Query select "ns"."nspname" as "schema", "cls"."relname" as "name", (select coalesce(json_agg(agg), '[]') from (select "att"."attname" as "name", "typ"."typname" as "datatype", "tns"."nspname" as "datatype_schema", "fk_ns"."nspname" as "foreign_key_schema", "fk_cls"."relname" as "foreign_key_table", "fk_att"."attname" as "foreign_key_column", "pk_con"."conkey" is not null as "pk", "att"."attgenerated" != '' as "computed", "att"."attnotnull" != true as "nullable", coalesce((select json_agg("enm"."enumlabel") as "o" from "pg_catalog"."pg_enum" as "enm" where "enm"."enumtypid" = "typ"."oid"), '[]') as "options" from "pg_catalog"."pg_attribute" as "att" inner join "pg_catalog"."pg_type" as "typ" on "typ"."oid" = "att"."atttypid" inner join "pg_catalog"."pg_namespace" as "tns" on "tns"."oid" = "typ"."typnamespace" left join "pg_catalog"."pg_constraint" as "pk_con" on "pk_con"."contype" = 'p' and "pk_con"."conrelid" = "cls"."oid" and "att"."attnum" = any("pk_con"."conkey") left join "pg_catalog"."pg_constraint" as "fk_con" on "fk_con"."contype" = 'f' and "fk_con"."conrelid" = "cls"."oid" and "att"."attnum" = any("fk_con"."conkey") left join "pg_catalog"."pg_class" as "fk_cls" on "fk_cls"."oid" = "fk_con"."confrelid" left join "pg_catalog"."pg_namespace" as "fk_ns" on "fk_ns"."oid" = "fk_cls"."relnamespace" left join "pg_catalog"."pg_attribute" as "fk_att" on "fk_att"."attrelid" = "fk_cls"."oid" and "fk_att"."attnum" = any("fk_con"."confkey") where "att"."attrelid" = "cls"."oid" and "att"."attnum" >= 0 and "att"."attisdropped" != true) as agg) as "columns" from "pg_catalog"."pg_class" as "cls" inner join "pg_catalog"."pgnamespace" as "ns" on "cls"."relnamespace" = "ns"."oid" where "ns"."nspname" !~ '^pg' and "ns"."nspname" != 'information_schema' and "cls"."relkind" in ('r', 'v')...

Horrendous performance with relationalJoins active for deep includes through models/views

I have difficulties finding out why out prisma queries are running so slow. Im firing 15 queries simultanously and they seem to return in batches of 6 each block being 600ms delayed. We use the default postgres docker-image but our schema is fairly complex. I have no idea where the batch of 6 is coming from and also why a single prisma sql query would even take 600ms to begin with for a db that doesnt even have 2000 rows. I am aware that the inbcludes im doing sometimes are like model.include.model.include.view.include.model.include.model . SO like 5 deep sometimes with multiple sibling includes aswell. But i would expec this to be good performance. I dont think the schema would fit in here due to length limits and privacy reasons, but generally: we have ...

Help with Error in Schema engine with Planetscale.

I've recently changed to schema folder structure and now can't push a new table to db... ? When I try and push npx prisma db push I get an error "Oops, an unexpected error occurred! Error in Schema engine. Reason: [schema-engine/sql-schema-describer/src/mysql... [more...]" Prisma generates correctly, types for the new table are generated with no errors, prisma Studio recognises the new table but I cann't push it....

Getting Reading from "node:async_hooks" is not handled by plugins onnextJs server actions

Here is my config: - custom generated path inside my packages/db monorepo package - the prisma package is "type": "module" - The error only happens on nextJs server actions (I believe because of different runti then server components) Can anyone help me? Two days trying to figure this out already....

6.12 failing when using typedSql and tsx

I'm trying out prisma 6.12 and have switched over to using prisma-client and ran npx prisma generate as well as npx prisma generate --sql for my typedSql files. I can see that the generated folder get's created and my two sql related files are there. I then run npx tsx --test and for some reason my generated/prisma/sql folder's contents get deleted and my tests using typedSql fail. Any ideas as to what's happening?

Basic Prisma Optimize Is Not Working

Hi, I'm am trying to debug some bad query performance in our application. I was going to use prisma optimize, but no matter what I it absolutely refuses to push anything the website. I have a VERY minimal example that does not work: ```ts...

Prisma push to PlanetScale development branches crashing schema engine

Running prisma db push to a PlanetScale development branch is crashing the schema engine: (Vitess) ``` Environment variables loaded from prisma/.env Prisma schema loaded from prisma/schema.prisma...

MismatchedTokenException when migrating from neon/docker to prisma postgres

For some reason im getting a schema parsing error when moving from docker (locally) + neon to prisma postgres. I started with bunx prisma dev to spin up a local dev database. After running prisma generate + prisma migrate, I'm getting the following error MismatchedTokenException: Expecting --> '{' <-- but found --> 'non-linear' <-- I'm not sure why switching db providers would cause the schema to be invalid...

getting error "prisma:error Must call super constructor ..." at a simple insert

So, I get this error "prisma:error Must call super constructor in derived class before accessing 'this' or returning from derived constructor" when doing this insert: ``` const form = await prisma.forms.create({ data: formData...

Can't Null a Compound-unique Value

I have something like this: ``` model MyModel { fieldOne String fieldTwo String...

Warning: consolidate your env vars

Hi developers, I am new to prisma and started enjoying it, the whole ecosystem is amazing, however since i am new, started facing some initial hiccups. I just have a single .env file in my root directory, but whenever i get any prisma issue, it also put a warning with a code snippet, seems like not everyone is facing this and hence couldn't find much details online. may be its my tech stack :shrug: (Hono + Bun + Prisma) Can someone please guide me how to get rid of this. ...