Prisma

P

Prisma

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

Join

Dynamic Database Name Support in Studio

I’m facing a recurring issue during development that forces me to duplicate projects just to manage different .env files. Let me explain the scenario: Currently, I’m working on a project with a MASTER database that handles tenant access and several TENANT_###### databases, each specific to a client. Here’s the workflow:...

Is there no more online database browser from prisma?

I remember a while back cloud.prisma.io had a visual database browser that one of my projects really dependended on, now it doesn't seem to exist anymore. What can I do about this?

narrow down String type using prisma client's extension?

can I explain to prisma client and typescript that this particular field needs to be a string union? ```ts model Lesson { id Int @id @default(autoincrement()) type String? // null | "practical" | "seminar" | "lecture"...

help with relations

I want the Meal model to kepp track of the absent familyMembers without having to store the data on the familyMember model.

License details for Studio

Hi folks, From asking the AI, it is my understanding that although the source code isn’t available, I don’t have to pay to use Prisma Studio. 1. Does that extend to redistribution? For example, what if I build a project, charge for it, and it contains Prisma Studio in the stack? Is that allowed? ...

mongo dates without JS Date object?

is it possible to insert a document where a property is 'dateTime' without having it be a date object? I'm open to using rawCommand as well. The issue is i've build a logging service and each log has about 15-16 timestamp, which I'll want to query on for insight later on, but would involve having to convert each date on the incoming log, which are many, so ideally I'd find a way around that....

using mongo -- insert document without any checks whatsoever?

I have a logging service and <some> of the data won't exactly quite match, especially the underlying types. I still want to have a bit of a mix between what I 100% expect to be there (like createdAt and such) and use prisma to query them -- but want to be able to not throw an error when trying to insert something that doesn't 100% match the schema (extra values basically); Is there a way to achieve this with prisma?...

gin index

how would I indicate this index exists on my prisma schema...
CREATE INDEX ON my_table USING gin (my_string_column gin_trgm_ops);
CREATE INDEX ON my_table USING gin (my_string_column gin_trgm_ops);
...

Omit type for creating

However, I can use delete user.password. Is there a way to omit the password when creating a new user? ```.tsx async create(dto: CreateUserDto) { const user = await this.prismaService.instance.user.create({ data: {...

Syncing Prisma across multiple repo's

Multiple of our software's services use prisma ORM to interact with the same DB. However, we oftentimes must manually sync the schema across the different repo's that the services live in when we do a single DB migration. This seems like it would be a common issue, so is there a recommended way to go about this?...

[React Native] DB duplicated to the emulator. Intentional?

Scenario: 1. App has a db.db file and uses it 2. Prisma Studio shows a different sort of data, as if there were 2 separate DBs at the same time, which makes no sense What happens:...
No description

Do transactions work when you nest them?

Hello, I'm trying to figure out if transactions work correctly when you nest them. In my example I've got a couple of pretty complex business-logic-required queries, and each might have their own transactions within them: ...

UnknownJsonError - P6000 - Something went wrong

Hello, I get a strange error using prisma accelerate. What could be the cause? Unknown server error: {"type":"UnknownJsonError","body":{"code":"P6000","message":"Something went wrong."}} (The request id was: 8e16bac8eee93b72) at Yr.handleRequestError (/var/task/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/edge.js:20:7527)...

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(); ...
Next