https://www.prisma.io/ logo
Join Slack
Powered by
# random
  • r

    Rene Nielsen

    01/06/2022, 9:13 PM
    Hi all. What platforms can you recommend for image storage? Has to support following criterias • NPM or REST Api to upload photos (For instance when a user creates a product, and attaches a photo in a backoffice) • Domain support • Some sort of backup or SLA that ensures the images does not get lost
    m
    • 2
    • 3
  • a

    Alex Vilchis

    01/06/2022, 9:34 PM
    Hello there 👋. I have a problem that has been on my mind for a while. In my Next.js app I use a custom backend server. My website uses ISR to stay fast and performant. However, everytime I build my Next.js site, I need to have my backend online. This prevents me from using things like Turborepo, as I cannot run a build command on all the packages my repository has (the website expects the backend package to be running). Has anyone encountered a similar problem? Am I missing something?
    t
    f
    • 3
    • 4
  • a

    Aman Tiwari

    01/09/2022, 9:40 PM
    is this good idea? what are the other way to do?
    Copy code
    const enquiry = await db.enquiry.findFirst({
        where: { id },
        include: {
          users: {
            include: {
              user: true,
            },
          },
        },
      })
    
      if (!enquiry) throw new NotFoundError()
    
      const partner = enquiry.users.filter((arr) => arr.user.role === "PARTNER")[0]
      const customer = enquiry.users.filter((arr) => arr.user.role === "USER")[0]
    
    return { ...enquiry, partner, customer }
    j
    • 2
    • 2
  • y

    Yusuf Erdogan

    01/09/2022, 11:26 PM
    https://twitter.com/erdogany/status/1479845195323633666
  • m

    Moe Green

    01/10/2022, 4:56 PM
    Hi, guys! Is it possible in Prisma to do so?
    s
    t
    • 3
    • 3
  • a

    Alex Vilchis

    01/10/2022, 6:47 PM
    These just came in the mail! Thank you, guys prisma rainbow From 🇲🇽
    prisma rainbow 13
  • j

    janguianof

    01/12/2022, 11:28 PM
    same here!! I just received the swag 🙂 thanks prisma rainbow from 🇲🇽
    💚 4
  • r

    Roewyn Umayam

    01/13/2022, 7:42 PM
    Got mine in the mail last night from 🇺🇸 thanks prisma cool
    ❤️ 2
    prisma rainbow 3
    m
    • 2
    • 1
  • t

    Tarun

    01/17/2022, 7:15 AM
    guys if you want to get more into Prisma ORM with express and nestjs https://www.youtube.com/playlist?list=PLIGDNOJWiL1_ygbYCizW9ORMazELD9foK
    👏🏽 1
    🙌🏽 1
    🙌 1
  • m

    Mradul Jain

    01/19/2022, 7:11 AM
    hello everyone, how i can write a below query  using prisma model
    select
    cases.case_number as caseNumber,
    inv.invNum,
    inv.matNum,
    cases.style,
    cases.case_sk as caseSk
    from fm_invoices_view inv
    left join(
    select case_number, case_sk, style from cases_details
    ) cases
    on
    SUBSTRING(cases.case_number, 0, CHARINDEX('-', cases.case_number)) = inv.matNum
    where
    inv.invNum = ${filter.invoiceId}
    group by
    inv.invNum,
    cases.case_number,
    cases.style,
    inv.matNum,
    cases.case_sk
  • t

    Tim Saunders

    01/21/2022, 2:43 PM
    Hey! I feel like I must be doing something a bit stupid - can anyone point out why prisma wants to reset my database when I try to create a migration to drop a
    NOT NULL
    constraint? https://github.com/prisma/prisma/discussions/11307 Thanks for any wisdom/advice! Also, hello 👋
  • c

    Chonselgama Coulibaly

    01/23/2022, 11:44 AM
    Hello here, who has already used middlewares option in prismaServiceOptions. It doesn’t work for me. I’m wondering if i should add prisma.$use at the end of middleware file before exporting. IN MIDDLEWARE FILE
    Copy code
    import { Prisma } from "@prisma/client";
    import { EntityStatusHistoryService } from "src/modules/task/services/entity-status-history.service";
    import { EntityStatusService } from "src/modules/task/services/entity-status.service";
    import { SaeiStatusEnum } from "src/utils/enums/saei-status.enum";
    import { PrismaService } from "src/utils/prisma/prisma.service";
    
    export function adjournApplicationStatusHistoryMiddleware(): Prisma.Middleware {
        return async function (
            params: Prisma.MiddlewareParams,
            next: (params: Prisma.MiddlewareParams) => Promise<any>,
          ): Promise<Prisma.Middleware> {
            if (params.model == 'Entity' && params.action == 'update') {
              console.log("IN FIRST CONDITION");
              const statusId = (
                await new EntityStatusService(new PrismaService()).getEntityStatus(SaeiStatusEnum.AJOURNEE)
              ).id;
              const lastEntityStatusHistory =
                await new EntityStatusHistoryService(new PrismaService()).getLastEntityStatusHistory(
                  params.args.where.id,
                );
              if (
                params.args.data.entityStatusId === statusId &&
                lastEntityStatusHistory.statusId !== statusId
              ) {
                console.log("IN SECOND CONDITION");
                await new EntityStatusHistoryService(new PrismaService()).createEntityStatusHistory(statusId,params.args.where.id);
              }
            }
            return next(params);
          }
    } ;
    IN APP MODULE
    Copy code
    import { HttpModule } from '@nestjs/axios';
    import { Module } from '@nestjs/common';
    import { ScheduleModule } from '@nestjs/schedule';
    import { AppController } from './app.controller';
    import { AppService } from './app.service';
    import { TaskHandlerModule } from './modules/task/task.module';
    import { PrismaModule } from "nestjs-prisma";
    import { adjournApplicationStatusHistoryMiddleware } from './middleware/adjourn-application-status-history.middleware';
    
    @Module({
      imports: [
        ScheduleModule.forRoot(),
        TaskHandlerModule,
        HttpModule,
        PrismaModule.forRoot({
          isGlobal: true,
          prismaServiceOptions: {
            middlewares: [adjournApplicationStatusHistoryMiddleware()],
            prismaOptions: { log: ['info'] }
          },
        }),
      ],
      controllers: [AppController],
      providers: [AppService],
    })
    export class AppModule {}
  • a

    Alex Vilchis

    01/24/2022, 7:02 PM
    Hello, Prisma fam 👋 I made a thing that may be useful to one of you. It's a CLI tool that verifies the presence of environment variables before running a process. You can use it, for example, to ensure everyone in your team has defined the variables needed before running an app (inside
    package.json
    scripts). This is my first open source project so any feedback or suggestions are greatly appreciated. Thanks! prisma rainbow https://github.com/arvindell/envful
    👀 1
  • j

    Jim Walker

    02/01/2022, 9:34 PM
    hi… love the new CockroachDB integration! any chance we can get an emoji now? 🙂.
    😂 3
    sparklycockroach 11
  • a

    Andrew Ross

    02/02/2022, 1:27 PM
    best way to extract generic props from a function? trying to pull the three generic-imported props out of the seeding function
    Copy code
    type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
    type SeedInferred = UnwrapPromise<ReturnType<typeof seed>>;
    
    // experimenting
    type SeedPropsInferred<U> = UnwrapPromise<
      typeof seed extends Record<keyof U, infer U>
        ? Record<keyof U, U>
        : UnwrapPromise<typeof seed>
    >;
  • l

    Len Smith

    02/09/2022, 5:40 PM
    Does anyone use a strategy to type the results of a
    gql
    string? I want to use the generated types, but there’s no guarantee we actually put the field in the query. Using the generated types, TypeScript tells us
    user.firstName
    is guaranteed to exist, but it’s not in this case. Having to have a custom type for each query seems fragile, redundant and a lot of extra work, so I was wondering if there’re any solutions for this?
    🤔 2
    b
    • 2
    • 4
  • y

    Yusuf Erdogan

    02/10/2022, 12:03 PM
    Something I learned about javascript: https://twitter.com/erdogany/status/1491431927722569734
  • a

    Alex Vilchis

    02/11/2022, 5:58 PM
    Hey, guys, wanted to share something I've been working on 👇🏼 https://github.com/arvindell/envful
    prisma rainbow 3
  • s

    Samrood Ali

    02/16/2022, 3:10 PM
    Hello. I just joined. I am a newbie at my first job, 3rd day only. I am trying to mock the prisma client we use with hapi. I following the documentation but every query is returning undefined sadparrot . We are using typescript, hapi JS and postgres. my tsconfig.json
    Copy code
    {
      "compilerOptions": {
        "sourceMap": true,
        "rootDir": "./",
        "baseUrl": "./",
        "outDir": "dist",
        "target": "ES2018",
        "module": "commonjs",
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "lib": [
          "esnext",
          "DOM"
        ],
        "esModuleInterop": true,
        "paths": {
          "*": [
            "*",
            "./src/declarations/*"
          ],
          "#src/*": [
            "./src/*"
          ],
          "#routes/*": [
            "./src/routes/*"
          ]
        }
      },
      "exclude": [
        "dist",
        "node_modules"
      ],
      "skipLibCheck": true,
      "strictNullChecks": true
    }
    I love prisma though, huge fan.
  • j

    jt

    02/16/2022, 10:28 PM
    Can anybody relate to this scenario or am I the only one....? “Hmm, I think I’ll knock out this small feature and call it a day…” 3 and 1/2 hours later…🤬 “I need a break…” 🤕 Get a bowl of cereal and come back to the computer 5 minutes later. “Okay, let me erase everything I just did…” 😕 Writes two lines of code… “Hmm, that works.” 😑
    😂 7
    d
    • 2
    • 1
  • r

    Russell

    02/18/2022, 10:28 AM
    Hi gyes. Please take a look 🙂 🙌 https://standuply.com/blog/the-6-best-standup-bots-for-slack-in-2022/
  • s

    Seif Lotfy

    02/21/2022, 4:43 PM
    anyone here using vercel and want to beta test an integration? its been getting good feedback already 🙂
    s
    j
    c
    • 4
    • 3
  • a

    Alfred Noland

    02/24/2022, 3:14 PM
    Hi, how should you go around using Prisma as multi-tentant source with different microservices in Node.js? For example we have one location database and we have one app for transactinal purposes and one for content. But we want to use the same location db in both apps.
    r
    i
    +2
    • 5
    • 5
  • a

    Alfred Noland

    02/24/2022, 4:15 PM
    For someone with experience withinn described setup, we would like to hire for a few hours for a good hourly rate.
  • c

    Catherine Laserna

    03/02/2022, 11:27 PM
    Hello 😊 Does anyone know of similar organizations such as Prisma that offers scholarships like the one Prisma does. I'm a HS senior interested in CS, and these seem right up my alley. I'm just not sure where to look
    a
    • 2
    • 1
  • t

    TaishoKondo

    03/13/2022, 7:08 AM
    Hi! I am looking for a common filtering method, like Laravel’s scope, that can be given to queries against a specific model. there is no such functionality as laravel’s method chain, so I am trying to figure out how to implement it. Any ideas? I would be very happy to receive your advice. https://laravel.com/docs/5.8/eloquent#query-scopes
    c
    • 2
    • 2
  • c

    Chris Hinds

    03/19/2022, 1:54 PM
    hello, just wanted to clarify what is the latest version of prisma? I started a project using the prisma docs using MongoDB and created a prisma schema with data models. However today I found docs for
    prisma1
    which to me has a better syntax, seems to make things easier with MongoDB ie. auto matching of @id to
    _id
    I think before I was using Prisma 2. However it seems like docs for Prisma 1 are still being updated and includes support for MongoDB etc Am I just being daft here, and should I be using prisma 2. the
    datamodel.prisma
    syntax seems much better IMO but this is on Prisma 1
    💯 1
    l
    v
    • 3
    • 3
  • o

    Omar

    03/22/2022, 11:37 AM
    Hey guys, I made a vsCode extension that is going to change how we debug multiple things at the same time. It's called
    Breakpoint Bookmarks
    , and it does exactly what it's name imply. Basically you get to save all your breakpoints flows, and switch between them whenever you like, as you see in the gif. You can also track those breakpoints files with your source controls tools of course. You can download it with
    ext install OmarDulaimi.breakpoint-bookmarks
    in command palette or from the extensions menu in vsCode. I'm sure you noticed that I have used an official prisma example in the demo 🙂 Contributions are welcomed, you can find the repo here: https://github.com/omar-dulaimi/breakpoint-bookmarks https://marketplace.visualstudio.com/items?itemName=OmarDulaimi.breakpoint-bookmarks
    🙌 3
    👀 2
  • b

    Bret emm

    03/22/2022, 5:17 PM
    Is Prisma more for a “local” database? Vs like how Firebase is on a server with Google?
    i
    • 2
    • 4
  • c

    Chris Bitoy

    03/23/2022, 5:19 PM
    Is there a bug that reveals contents in the
    .env
    file on github - I saved my db URL_STRINGS in my
    .env
    , committed and pushed my changes to git. However, got a message from git that the info in my
    .env
    file is exposed (see image). I have since destroyed the databases in question, but wondering if this is a bug cos its not supposed to act this way
    m
    • 2
    • 6
1...484950...53Latest