Prisma

P

Prisma

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

Join

Problems when deploying after a failed migration

I ran the test with the following example 1. assuming I have raw data, I created a field called test String and ran prisma migrate dev --name test --create-only. 2. when I ignored the warning and ran prisma migrate dev, a migration error occurred and a failed record was created in _prisma_migrations. 3. followed the official guide and ran deploy after rollback https://www.prisma.io/docs/orm/prisma-migrate/workflows/patching-and-hotfixing#option-1-mark-the-migration-as-rolled-back-and-re-deploy 4. reflected as normal...

What's the proper way for me to define tsvector field in my schema file?

I defined a trigger function that will update the search_data column. I'm not sure how I should define the prisma schema in this case. I'm getting weird result with filtering. For example I have these entries: Apple, Banana, Orange. When I define "data_search" @@ to_tsquery('english', ${searchTerm}) with searchTerm=Orange it returns Orange correctly. But when I'm not doing any where clause, Orange is not returned. Here's the actually model definition: ...

Issues deploying Flask + Prisma-Client-Py backend to Vercel

Hello, I have this fullstack website project (https://github.com/mmamdouh4370/bouquet.gen) that uses a nextjs frontend with a flask backend using prisma as an orm for postgres. Whenever I try to host my project on vercel I run into issues with "prisma generate". Whether I include prisma generate, npx prisma generate, or python3 -m prisma generate in either my postinstall or build script I see in my build logs ✔ Generated Prisma Client Python (v0.13.1) to ./prisma/generated/client in 173ms, however if I try to access my api route in deployment I get a 500 and in my logs I get the error [ERROR] RuntimeError: The Client hasn't been generated yet, you must run prisma generate before you can use the client.. Any thoughts?...

Dashboard localhost:4467/_admin after run command: yarn prisma:deploy-force all table is 0

why in the prism dashboard there are only 2 tables that have data yaoit PageAccess 80 the data does not match the data in postgres, this is when running: yarn prisma:deploy-force prisma version 1.32...
No description

Database requires reset when migrating

When I make a migration, I am prompted with to reset data to complete the migration. Is there any way around this?

Hi, I am using prisma with cockroachdb. CRDB clusters have many nodes.

I am using prisma with cockroachdb. CRDB clusters have many nodes. I would like the prisma connection pool to open connections to different servers, to support failover in event of a CRDB node failure, and to distribute queries. Is this possible?...
Solution:
Hello! This is not natively supported by Prisma. To get this functionality you would most likely need to use a load balancer like HAProxy. I think this page in the CDB docs may help

Best Practices for Updating Nested Relations in Prisma with NestJS and SQL Server

Hello! I'm working on a project using NestJS, Prisma, and SQL Server, and I need help with updating a complex model with many relations. Here’s the context: I have the following models with relationships: ```sql...

Ensuring Filtering if variable is undefined

I have an application that is a multi-tenant app where we always filter by TenantId , so for example we do queries like this: ```js var contacts = await db.contacts.findMany({...

Cannot find module rollup/parseAst

[warn] Slow module @prisma/nuxt took 25375.49ms to setup. [error] Cannot find module '/drone/src/node_modules/vite/node_modules/rollup/parseAst' imported from /drone/src/node_modules/vite/dist/node/index.js at new NodeError (node:internal/errors:405:5) at finalizeResolution (node:internal/modules/esm/resolve:327:11) at moduleResolve (node:internal/modules/esm/resolve:980:10)...

Prisma NextJs Docker and Multi Datasource

Hello, thanks for your time. I use Prisma, Docker and NextJs at work. A combination that is almost unbeatable. Now I have the following problem, I have several database connections. ...

Prisma can only run debugging, cannot compile and publish? #14

Prisma can only run debugging, cannot compile and publish? I can run it, but will the npm run build make an error? https://github.com/prisma/nuxt-prisma/issues/14...

Vercel Edge Functions + tRPC + Prisma + CockroachDB

Is it possible right now to run Prisma with CockroachDB with tRPC within Vercel edge functions? If so, how would I go about doing that? Are there any drawbacks?
Solution:
Without Accelerate, no. Unfortunately Vercel Edge Functions support a pretty limited set of database drivers that does not include CockroachDB. So, without a db driver to use, we can't create support for other databases (such as Cockroach). ...

AWS ECS + Fargate + Aurora PostgreSQL

Has anyone tried Prisma with above stack? I'm in the research phase of integrating Prisma with our AWS ECS + Fargate setup and Aurora PostgreSQL. Would the npx prisma migrate deploy command work with multiple containers?

Caching

hi! 👋 I have my Prisma schema using PostgreSQL and I need to cache some queries in Redis. Has anyone developed a similar process with setCache, getCache, and invalidateCache manually? If so, how did you resolve it?...

Caching server side prisma query in next js

Hello everyone, I have this getCategories function and use it in my server components, thing is that the data is mostly static, so it's a great idea to use some caching technique. But I don't know how, do any of you have experience with it?
No description

When running Prisma Generate on either of my computers (both Apple Silicon) getting error

Can't find anybody else that is experiencing this so maybe I've done something silly,but whenever I run prisma generate I get this error: ``` Error: Generator "prisma-json-types-generator" failed: ...

Prisma is not working while deployed on Vercel with Vercel Postgresql but working in Development.

Here is my schema: ``` generator client { provider = "prisma-client-js" }...

Storing image metadata: Is this safe?

So I am building a backend for smart city application, and I found myself lost in thought on is this realy make sense to have this much optional foreign key. I know that foreign key can be optional but this many seems kinda inefficient? or am I just overthink stuff that I shouldn't overthink.
No description

Prisa Query doesn´t find the data in my DB

I have this Schema ```js model CapitalRaids { id Int @id @default(autoincrement()) clanTag String...
No description