Prisma

P

Prisma

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

Join

Cant setup prisma accelerate, on the site when i try to enable accelerate I get error

When i try to click enable accelerate with my database connection string i get this error: We were unable to process your request. Please refresh and try again. my database in a MySql one running on Aiven

[React Native] Creating client with Supabase crashes

with db.ts like so (pretty basic) ```tsx import { PrismaClient } from '@prisma/client/react-native' import '@prisma/react-native' ...

Prisma extension in vscode too slow

vscode: 1.95.2 prisma ext: v5.22.0...

Help Needed with sorting/filtering data over Timeframe Based on Aggregated results

I'm working on a feature that involves querying daily event data and aggregating metrics over a specified timeframe (e.g., last 30 days or 90 days) for each event. Based on these aggregates, I need to filter and sort the events according to certain thresholds, such as total revenue or average price within the selected timeframe. Here’s a more detailed breakdown of my issue: Data Structure: Events table: Stores information about each event, like its name and category....

Issues with raw queries (was working) - Postgres

Hi everyone, I've a very weird issue within my setup, it was working but since the switch from npm to Yarn (but I think is not related) I'm facing this issue with a very simple script: ```js const { PrismaClient } = require('@prisma/client'); const prisma = new PrismaClient(); ...

How generete enum type from hasura?

Solution:
If i understand your question correctly, Prisma actually does generate TypeScript types based on your database schema, which you can use in your application. See this section of the documentation
No description

Prisma trace questions

Some performance findings and questions for a Prisma/Zenstack project, using Supabase for the database. This is using Prisma's tracing feature to investigate some slow queries. I did a comparison of the traces of the same query (1) connecting to my local supabase instance vs (2) connecting to our remote supabase project. My local supabase instance was unsurprisingly much quicker, as my remote instance is in Germany and I am currently based in Thailand. However I expected this location difference to increase latency in the Prisma trace ‘prisma:engine:connection’ which Prisma defines as ‘Represents how long it takes for Prisma Client to get a database connection’. While this trace did increase, I’m also seeing huge increases in ‘prisma:engine:db_query’ (Represents the database query that was executed against the database). It should not be taking almost 400ms for a find query that is querying via the primary key. In contrast the same query against my local db took 700us....
No description

Security concern

Hello everyone, I'm using Prisma ORM in my current project. 1. I have many dynamic GET queries, where the query specifies which table/column will serve as the operative field for filtering and sorting results....

Problem with array of strings on Postgres

I have model where I need to store array of strings, it uses Postgresql and the migration also see as TEXT[], but when I create the record, it say unknown.
Unknown argument `attachments`. Available options are marked with ?.
Unknown argument `attachments`. Available options are marked with ?.
...
No description

Nothing is written in a SQLite database when i try to insert anything

I don't understand why this happen
Solution:
I forgot to await await prisma.test.create({ data: { skibidi: "ohio" } });
No description

Querying a SQLite database will just hang forever

Why ?
Solution:
Solved: I had to install a matching version of @prisma/client and prisma client. ```json { "name": "", "version": "1.0.0",...

Error when updating Record

I just set up prisma postgres and when I try to update a relationship I get the following error. PostgresError { code: "55000", message: "cannot delete from table \"_LocationToLocationType\" because it does not have a replica identity and publishes deletes", severity: "ERROR", detail: None, column: None, hint: Some("To enable deleting from the table, set REPLICA IDENTITY using ALTER TABLE.") how to fix this using prisms ORM?...

Migration File Accidentally Deleted

1. A developer created changes to the prisma.schema file and commited these changes to a supabase database 2. The developer deleted the migration.sql file in the migrations folder before committing it to version control. This file is unrecoverable 3. We are now unable to interact with our database...

new optional field failing

introduced a new column into one of my models model MyModel { ... myKey String? @default(uuid()) }...

Dockerize Svelte with Prisma

Hi! Is there any example or recommendation on how to create a Dockerfile for a Svelte 5 app using Prisma for Supabase? I keep getting the error: /app/node_modules/.pnpm/@[email protected]/node_modules/.prisma/client/default.js:43 throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); ...

Soft delete & include

I recently impemented soft-delete with prisma ClientExtentions and it works wonderfully, but: When handling relational joins I cannot simply add a {where: {isDeleted: false}} to every include statement with a deep patch function, cause to-one relations dont have where. Is there a generic way to add a where statement to every include?...

enum @map value

I have this enum mapping but it doesn't generate the same value instead it uses the key as the value. ```ts enum Gender { MALE @map("M") FEMALE @map("F")...
No description

Psql Timeout connecting a new connection from collection pool

Hello, I used to get this error like a couple of times a day, which would crash my whole server. Today, it's been happening way more often. As soon as I start my server, my CPU usage goes too 100% and after a few mins, my servers crashes with the same error My chat app has like 1.5k users. Is there anyway to troubleshoot why this is happening?...

Seeking Work

I'm a US citizen looking to immigrate to Germany, and Prisma was suggested to me as a good place to look for work on my way in. I hope this is not a bad place to ask as I couldn't find a contact us place on your website. Looking forward to hearing from you, thank you!

Unknown argument...Available options are marked with ?.

Hello, I'm facing a problem while seeding my database. I have an implicit many-to-many relation table, and when creating one of the tables, I want to connect some existing rows from the other table into that one, like this: ```javascript const invoices: Prisma.InvoiceUncheckedCreateInput[] = []; const list_aimis: {id: number}[] = faker.helpers.multiple(() => {...