https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# orm-help
  • n

    Natalia

    03/01/2021, 4:36 PM
    The next edition of GraphQL Berlin Meetup will stream on the 3rd of March, 6:30 PM CET. graphql We have two wonderful speakers for this event: Eve Porcello and Benny Powers. During the event you can win access code to Wes Bos' updated course "Fullstack Advanced React and GraphQL".* *🎁 

    You can set a reminder on YouTube here▾

     or check out the event on Meetup for more information. Hoping to see you there! 🤗
  • j

    Joey

    03/01/2021, 7:12 PM
    Does Prisma generate types for queries than includes another type? For instance, my model has a
    Product
    and
    Category
    model which are linked as below;
    Copy code
    model Category {
      id            Int        @id
      name          String
      products      Product[]  @relation(references: [id])
      image         String?
    }
    
    model Product {
      id               Int        @id
      name             String
      price            Float
      image            String
      brand            String
      categories       Category[]  @relation(references: [id])
      currentInventory Int
      description      String
    }
  • j

    Joey

    03/01/2021, 7:13 PM
    I can import the individual types as
    _import_ { Category, Product } _from_ "@Prisma/client"
  • j

    Joey

    03/01/2021, 7:15 PM
    But my query has the
    include
    options which includes product in category and vice versa. My questions is, does Prisma generate this type or how do I achieve type safety fro this kind of queries?
  • j

    Joey

    03/01/2021, 7:17 PM
    Here is an example query;
    Copy code
    const categories = await prismaClient.category.findMany({
        include: {
          products: true,
        },
      });
  • j

    Joey

    03/01/2021, 7:21 PM
    For now what I am doing is extending like so;
    Copy code
    interface inventoryDataType extends Product {
      categories: Category[]
    }
    r
    • 2
    • 2
  • g

    Gezim

    03/01/2021, 10:00 PM
    Hi folks. I was very glad to find
    *GetPayload
    method to get types for my models. I’m having an issue with a many-to-many prop: https://github.com/prisma/prisma/discussions/5927
    👍 1
  • n

    Nothing.

    03/02/2021, 11:23 AM
    Hi everyone. I'm having problem updating and deleting a row of a junction table in a many to many relationship model. The update and delete method works for regular tables without relationship of any kind but doesn't work for relationship tables. Example of my code is something like this:
    Copy code
    const update = await prisma.categories.update({ 
        where: { 
            id: req.params.id
        }, 
        data:{ 
            status: "disabled" 
        }
    });
    I would have sent the error here but my PC is off RN. I'm new to Prisma and I'm not sure whether I'm doing anything wrong here, please help!
    r
    m
    • 3
    • 20
  • a

    Alex Reyne

    03/02/2021, 12:53 PM
    Any easy way to export tables to CSV with prisma?
    r
    • 2
    • 1
  • k

    Kyle Hayes

    03/02/2021, 5:13 PM
    What’s the recommended guidance for migrating a production database without downtime?
    j
    k
    j
    • 4
    • 22
  • r

    Rene Osman

    03/02/2021, 8:39 PM
    can anyone point me in the right direction to where i can ask questions about prisma? I am facing a weird typescript issue I can’t seem to resolve
    b
    e
    • 3
    • 14
  • g

    glenn

    03/03/2021, 2:38 AM
    nevermind, the constraint was unnecessary the top level item was spelled wrong 😅 can I deleteMany by an array within a unique constraint? deleteTerms being an array of string terms
    deleteMany: {
                            where: {                             uc_search_term: {                                 search_setting_id: user.search_setting.id,                                 term: {                                     in: deleteTerms,                                 },                             },                         },                     },
  • s

    sj

    03/03/2021, 5:03 AM
    Can I use Prisma2 in Django or ROR???
    r
    • 2
    • 2
  • j

    Julien Goux

    03/03/2021, 11:26 AM
    Hello all
  • j

    Julien Goux

    03/03/2021, 11:27 AM
    Does anyone have to right formula to deploy prisma in a NodeJsFunction using AWS CDK ?
  • j

    Julien Goux

    03/03/2021, 11:27 AM
    I’m trying to use the nodeModules array to mark @prisma/client and prisma as external deps, and also use the beforeInstall hook to copy the prisma.schema in the target directory
    r
    • 2
    • 8
  • j

    Julien Goux

    03/03/2021, 11:29 AM
    but even doing that the runtime doesn’t seem to be copied to the node_modules/.prisma directory
  • v

    Ville

    03/03/2021, 2:22 PM
    Hi, how can I stream data using Prisma?
    r
    • 2
    • 9
  • n

    Natalia

    03/03/2021, 3:41 PM
    We're getting started in 2 hours! fast parrot GraphQL Berlin Meetup will stream at 6:30 PM CET today. graphql  We have two wonderful speakers for this event: Eve Porcello and Benny Powers. During the event you can win access code to Wes Bos' updated course "Fullstack Advanced React and GraphQL". 🎁 

    You can set a reminder on YouTube here▾

     or check out the event on Meetup for more information. Hoping to see you there! 🤗
    🐻 3
    graphql 5
    📺 2
  • m

    manuel

    03/03/2021, 5:49 PM
    hey! does anyone know how the postgres connectionstring should look like for google cloud sql? thanks
  • m

    manuel

    03/03/2021, 5:54 PM
    This one unfortunately doesn't work: "postgres://username:password@/publicip?host=/cloudsql/projecteurope westproject-db"
    a
    j
    • 3
    • 3
  • j

    Josef Henryson

    03/04/2021, 7:33 AM
    Hi, I’m still running Prisma 1 (1.34.10) and suddenly my deploy script on server fails. When I run ‘npx prisma generate’ I get this error (see image). Any ideas?
    ✔️ 1
    l
    • 2
    • 4
  • v

    Vladi Stevanovic

    03/04/2021, 10:14 AM
    Hello everyone! I'm the new Customer Success Manager for Prisma and I look forward to supporting you all 💚 I'm very excited to share that we're hosting a Prisma Enterprise Event March 25th, with great speakers from the community! 🎉 This event will be focused on discussing the Prisma vision for Enterprises and how it's currently used in production by many companies. We're releasing the agenda very soon, and you can already register here: https://www.prisma.io/enterprise-event-2021
    Prisma Enterprise Event 2021 Welcome Video.mp4
    prisma rainbow 11
    💼 6
    💯 12
    💥 8
    🏢 4
    👋 6
    🦜 7
    🎩 7
    🙌 16
    🤸 4
    🎉 11
    🧐 4
    🥸 4
    🇳🇬 1
  • j

    James Irving-Swift

    03/04/2021, 11:24 AM
    Hi All, I'm new to Prisma, I was previously using sequelize and have decided to check out the alternatives! I can't find for the life of me in the documentation anything mentioning how to set up fixtures! Is this supported at all ?
    r
    • 2
    • 2
  • n

    Nothing.

    03/04/2021, 3:13 PM
    Hello everyone, I'm about to ask a question that might not necessarily be related to prisma, please do help or drop resources if you have. I'm using prisma in a project and I've been fine all along until I want to implement role/permission based access control in the project. I'm not sure how to go about it. Is there any standard way of doing that? Any library to achieve that? Or do I have to build it from scratch? Please help a brother 🙏.
    j
    k
    • 3
    • 4
  • r

    Rashmi Bidanta

    03/04/2021, 3:38 PM
    Hi All, We have recently updated our Prisma to 1.34 from 1.30.5, however we are seeing some weirdness in the behavior. The Link tables are all complaining about
    id
    column.
    Copy code
    org.postgresql.util.PSQLException: ERROR: column "id" of relation "_Table1ToTable2" does not exist
    any help in this regard would be highly appreciated
    r
    • 2
    • 3
  • j

    Julien Goux

    03/04/2021, 3:41 PM
    Hello all
  • j

    Julien Goux

    03/04/2021, 3:41 PM
    Does anyone know how to force VSCode to reload a specific .d.ts file ?
    j
    • 2
    • 8
  • j

    Julien Goux

    03/04/2021, 3:42 PM
    We use it as module augmentation for i18next, and I’d like VSCode to reload its internal typescript cache when I make some changes in other files
  • n

    Natalia

    03/04/2021, 4:02 PM
    🤗 “What’s new in Prisma (v2.18.0)” is live! Once again, Ryan and Niko talk about new releases, planned features and other interesting bits from the Prisma world. They will be joined by other Prismates: Alex and Vladi.* 

    Tune in here▾

    !* 🦜
    prisma green 4
    prisma rainbow 6
    🦜 6
1...420421422...637Latest