Questions tagged [prisma-orm]
The prisma-orm tag has no usage guidance.
prisma-orm
9
questions
0
votes
0
answers
6
views
Cleaner Way to Write Prisma Schema for Badge System
I'm working on a badge system for my web app and would appreciate any suggestions for cleaning up this Prisma schema
datasource db {
provider = "mongodb"
url = env("...
-1
votes
0
answers
22
views
Unit Tests in FastAPI with Prisma ORM
How to write unit tests for a FastAPI application with the Prisma client?
I already looked in the documentation and code examples but couldn't find it.
I have this code, but I don't know how to create ...
0
votes
1
answer
22
views
If i hardcode seed file mock data it works but if i import mock data for seeding from other file it does not work
In my seed.ts file if i import mock user data from other file it raise error.
zohaibamir@174-16-0-44 stt % npx prisma db seed
Environment variables loaded from .env
Running seed command `ts-node --...
0
votes
1
answer
88
views
Prisma $transaction API with promises made beforehand
The examples of sequential operations show the prisma operations being generated inline to the array.
If I were to instead create the queries beforehand:
const foo = prisma.foos.update(...);
const bar ...
1
vote
0
answers
82
views
Is there any specific feature of softDelete in Prisma ORM?
I want to delete my record (softDelete) something like in typeorm it is softDelete() method.
I want the same thing in prisma.
I have seen in documentations there is a flag for deletion which is ...
0
votes
2
answers
54
views
Time management library [closed]
This is a broad question, but I want to ask for opinions
I'm working with Typescript, Prisma ORM and PostgreSQL stack.
I want to handle time ranges. Let's say activeStartDate, activeEndDate of ...
0
votes
0
answers
109
views
What is the proper way to use Prisma ORM types
I have been having some sort of toruble with prisma typings for a while, So I am trying to look for suggetions to improve this.
Check the following model and the type generated to Team.
//Model
...
0
votes
0
answers
341
views
PrismaClientValidationError: Invalid prisma.<Model>.create() invocation
My prisma schema for the issue is:
model User {
id String @id @default(uuid())
email String @unique
.
.
.
TransactionComment ...
1
vote
0
answers
347
views
How to compute field value during entry creation in Prisma (mongodb)?
I Use Prisma (v5) to manipulate my Mongodb in NestJS application and can't understand how to calculate fields during DB entry creation.
What i'm looking for is some kind of onCreate/beforeUpdate hook ...