Prisma

P

Prisma

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

Join

Prisma support for PostGIS/GIS

Are there any plans for adding PostGIS/GiS support in the pipeline for Prisma? I've seen some people manage some workarounds but it seems too unstable to use in production.

Prisma Client: Injectable Setup Outside NestJS (with/without DI)?

In NestJS, the Prisma Client can be made injectable by extending PrismaClient and implementing lifecycle hooks like onModuleInit to manage connections. Here's how it's typically done in NestJS: ```typescript import { Injectable, OnModuleInit, INestApplication } from '@nestjs/common'; import { PrismaClient } from '@prisma/client';...

is there a `substring` method in prisma?

is there a substring method in prisma?

How can I disconnect a relation by using it's fields?

I need to disconnect a relation, but I cannot access the actual relation field due to the way it is setup. Let's say there is a relation called author, and I only have access to authorId, can I disconnect it by setting authorId to null/undefined?...

Prisma so slow in localhost with remote Postgresql (NextJS)

My website in local with remote postgresql is so slow but all good on deployed website using NextJS

Is support for Postgres composite types planned?

I'm just wondering if there's a specific reason for it not being currently supported since it's been a thing for a while

Prisma and CUIDv2

why prisma doesnt support cuidv2? in sense that it doesnt let you generate cuidv2 by default

Nested update when creating single record

Hi Prisma-Community, I want to set two fields to null when I create a user but I have no idea if this is possible. ``` model Membership { id String @id @default(cuid())...

Typedsql Type?

```sql -- @param {product_state} $1:state SELECT * FROM product WHERE 1 = 1 AND state = $1...

I need help with my schema, it doesn’t let me migrate

Hello, I get this error when trying to migrate to my remote database: Error: P3006 Migration 20240827190544_fix_relations failed to apply cleanly to the shadow database. ...

TypedSQL type safety over time

for TypedSQL, if i write a query and use it, then a month later i modify one of the tables via a migration, will I be notified if my query is no longer valid

Cant connect to supabase using accelerate

I have a problem setting up accelerate with supabase postgres. Supabase requires me to use ?pgbouncer=true at the end of the connection string. When i do it on the prisma accelerate dashboard it returns: One or more fields were invalid: [connectionString]. Tried many things but couldn't make it work. Am i doing something wrong? my connection string is similar to the following one: postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true...

TypedSQL - Generating without a DB connection

Hey everyone! We are trying out TypedSQL and it's working great for now. The main issue we're having is that to generate the complete client (with the --sql flag), a working database connection is required. As we're building our production containers on a stateless CI environment, we would like to avoid this constraint. Is there a way to correctly infer and build TypedSQL types directly from the schema.prisma file?...

Distinct doesn't work for some reason

Hey guys, I need help with something. I have this model...

is it possible to order a column how I want it?

For example, I have a table with a column that has values A,B,C,D when I query that table, I want to sort the results by D,B,A,C...

Is something happened with PrismaClient and adapters?

Solution:
I forgot to include this previewFeatures = ["driverAdapters"]
No description

How can one test out the Pulse service in light of the superuser limitation?

Hi, I am interested in testing out the Prisma Pulse service. However, according this doc - https://www.prisma.io/docs/pulse/known-limitations - you have to have a superuser role in order to use this service. I have a superuser role for my local databases but I use services like Render and Supabase for my deployed instances. None of those services (for good reason) allow for superuser access. How are we supposed to test out Pulse if we do not have superuser access? Does this mean that the only...

TypedSQL - JSONB fields

Using TypedSQL, I noticed that JSONB fields are inferred as JsonValue. Is there a way to get more specific type inference for complex JSON structures in PostgreSQL queries, or is this a current limitation of TypedSQL?

Multiple Schema File issues

hi, so im using as followed on the blog about multiple schema files, and it seems that when i try to use npx prisma format or npx prisma generate, it fails to load those other schema files, i dont have any model in main file tho, so not sure if that's the issue, but it shouldnt be, here's also my file tree: ```shell prisma ├── schema...
Solution:
seems like all files have to be in the schema directory, that's kinda annoying

Prism generate fails on VPS but not locally

executing this script inside CMD in Dockerfile, it fails thjough, any idea where a problem could be?...
No description