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

    Rashmi Bidanta

    02/03/2021, 4:11 PM
    Note: This is with prisma1
  • y

    Yousuf Hasan

    02/04/2021, 2:54 AM
    Hi, While saving v. large nested objects using for.eg prisma.acccounts.create({data}) prisma is starting the queries after a lag of few minutes i.e. i can't see any query on my logs until after a few minutes. The larger the object the larger is the delay? Is it a known issue ?
    r
    • 2
    • 2
  • a

    Andy

    02/04/2021, 5:41 AM
    Hi - Does anyone know if there is a Autoremediation Policy for S3 Access Logging.
  • m

    Manthan Mallikarjun

    02/04/2021, 8:45 AM
    Should this notification:
    Copy code
    warn @prisma/cli has been renamed to prisma.
    Please uninstall @prisma/cli: npm remove @prisma/cli
    And install prisma: npm i prisma
    tell us to do
    npm install prisma -D
    ?
    plus one +1 5
    r
    n
    • 3
    • 2
  • d

    Darryl

    02/04/2021, 9:19 AM
    Hi, everyone. I currently have a server running on a Digital Ocean Droplet, connected to a hobby Heroku database. This is essentially my test environment that people are using with an early beta. When going live, that database will be replaced by a managed Postgres database, also on Digital Ocean. In the past week or so, I've started noticing issues and I'd guess it happened since upgrading to Prisma
    2.15.0
    as nothing else has changed. When I say issues, I mean things are either way slower than they normally are or they just don't work at all. Logging in, fetching products, etc. Stuff that's worked without issue for a few months now. I'm using Sentry and one of the recent issues shown from a client was:
    Copy code
    Error: GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a connection from the pool (connection limit: 3, in use: 0))
    GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a c...
    I've had this setup for a few months, updating the odd thing on the server every now and then, and it's been stable while I've been focusing on the client. Based off that error message alone, can anyone see if I've maybe missed something with the latest Prisma update or if there's anything else you recommend. Thanks! 🙂
    d
    n
    d
    • 4
    • 17
  • j

    Joey

    02/04/2021, 9:46 AM
    Hey guys, I have been using Prisma lately at work and been looking at OS projects to contribute to. I recently did a clone of a Jamstack Ecommerce by Nader (@dabit3 on Twitter) and tried to add a Prisma backend. You can try it out here https://github.com/joeynimu/jamstack-ecommerce and share your feedback. More documentation and examples will follow. Thanks!
    💯 4
    prisma rainbow 5
    fast parrot 6
  • s

    Sébastien Dubois

    02/04/2021, 11:02 AM
    Hello there. I'm looking into how to handle test data during local development. What are you using for that?
    r
    j
    • 3
    • 26
  • m

    Martïn

    02/04/2021, 3:43 PM
    [Atomic number operations] I have a schema that has an optional Int field
    tokenGenerationCount
    that I need to increment +1 every time logic generates the
    access_token
    , but it doesn’t seems to work. Below is the schema:
    model userSessionInfo {
    Copy code
    id                   String @id @default(cuid())
    userId               String @unique
    deviceSignature      String @unique
    ...
    tokenGenerationCount Int @default(0)
    }
    And here’s the code to update:
    const updateTokenCount = await prisma.userSessionInfo.update({
    where: {
    id: “sh3883ejJdiwoQ”
    },
    data: {
    tokenGenerationCount: {
    increment: 1
    }
    }
    })
    It fails to increment
    tokenGenerationCount
    without any error. The example in the doc only provides sample code for
    updateMany
    method:
    Copy code
    const updatePosts = await prisma.post.updateMany({
      data: {
        views: {
          increment: 1,
        },
        likes: {
          increment: 1,
        },
      },
    })
    r
    • 2
    • 5
  • n

    Natalia

    02/04/2021, 4:04 PM
    What's New in Prisma (v.2.16.0) is live now! 🤗

    https://www.youtube.com/watch?v=77PoedHJUM0▾

    👀 2
    🦜 4
    🙌 3
    🎥 4
    d
    • 2
    • 1
  • s

    Sébastien Dubois

    02/04/2021, 6:12 PM
    Quick question, does Prisma support query batching? I'm wondering about how to deal with the N+1 query issue with GraphQL / nexus & Prisma
    j
    d
    • 3
    • 9
  • a

    Angelo

    02/04/2021, 8:06 PM
    when running
    $transaction
    I would like to get the locations that were created but Prisma only returns the main object that was created and not the nested ones
    Copy code
    export default {
      create: async (prisma, customers) => {
        const maincontractors = allData.map((data) => {
          const newData = {
            ...data,
            customers: {
              connect: customers
                .filter((customer) => data.customers.includes(customer.name))
                .map((customer) => ({ id: customer.id })),
            },
            locations: {
              create: maincontractorLocationData.get(data.name),
            },
          };
    
          return prisma.maincontractor.create({ data: newData });
        });
    
        return prisma.$transaction(maincontractors);
      },
    };
    Is there a way that I can retrieve the
    location
    that were created?
    r
    • 2
    • 1
  • s

    srpies ligeros

    02/05/2021, 2:48 AM
    hi friends... i got this error:
  • s

    srpies ligeros

    02/05/2021, 2:49 AM
    Error: P3014 Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases.
    ✔️ 1
    a
    r
    a
    • 4
    • 3
  • s

    srpies ligeros

    02/05/2021, 2:49 AM
    Thanks for your help...
  • s

    Sascha

    02/05/2021, 12:50 PM
    Is there any way to enable optional ordering on nexus? When I add
    ordering: { myField: true }
    it makes providing an
    orderBy
    mandatory instead of optional.
    r
    • 2
    • 19
  • d

    defrex

    02/05/2021, 5:31 PM
    I’ve noticed that
    findUnique
    with
    rejectOnNotFound
    set to
    true
    still returns with
    | null
    in the type. Is that going to be fixed, or is there some reason for it?
    d
    • 2
    • 3
  • a

    Artur

    02/05/2021, 9:28 PM
    Has anyone performed a Prisma 1 to Prisma 2 migration? Who can contract with our team to help with the migration?
    👍 1
  • l

    Luke

    02/06/2021, 4:10 AM
    Is it possible to load a schema in the mac os desktop Prisma Studio app that has an environment variable in it? like so:
    Copy code
    url      = env("POSTGRES_URL")
    I keep getting an error because of it
    Copy code
    Error starting Prisma Client: {
      "message": "Schema Parsing P1012\n\nGet config \nerror: Environment variable not found: POSTGRES_URL.\n  -->
    h
    m
    n
    • 4
    • 7
  • d

    Douglas Lassance

    02/06/2021, 7:57 PM
    Hello! Is there a roadmap online for prisma studio features?
    n
    • 2
    • 2
  • j

    Jack Baude

    02/06/2021, 8:17 PM
    Does anyone know why I am getting this error?
    Copy code
    import {PrismaClient} from "@prisma/client"
    ^^^^^^
    
    SyntaxError: Cannot use import statement outside a module
    I can run this code just fine with 
    ts-node
     but as soon as I want to complie my code with 
    tsc
     I get this error
    m
    • 2
    • 1
  • a

    Aaron Fulkerson

    02/06/2021, 10:20 PM
    Can you get a full count of all rows along with a slice of those rows yet or does that still require 2 queries?
    n
    • 2
    • 2
  • a

    Awey

    02/06/2021, 10:26 PM
    Is this how I should create a hierarchical data structure so I can recursively render my comments?
    Copy code
    model Comment {
      id        Int       @id @default(autoincrement())
      createdAt DateTime  @default(now()) @map("created_at")
      updatedAt DateTime  @updatedAt @map("updated_at")
      text      String
      author    User?     @relation(fields: [authorId], references: [id])
      authorId  Int?      @map("author_id")
      post      Post?     @relation(fields: [postId], references: [id])
      postId    Int?      @map("post_id")
      replies   Comment[] @relation("CommentToComment")
      parent    Comment?  @relation("CommentToComment", fields: [parentId], references: [id])
      parentId  Int?      @map("parent_id")
    
      @@map("comments")
    }
    ✅ 1
    n
    • 2
    • 4
  • a

    aceix

    02/07/2021, 1:10 PM
    hello!
    n
    • 2
    • 1
  • y

    Yilmaz Ugurlu

    02/07/2021, 1:11 PM
    Anyone have an experience distributing a library with Prisma. How do you pack your Prisma client in distribution?
    b
    e
    n
    • 4
    • 8
  • c

    Calin Zapan

    02/07/2021, 4:29 PM
    Hello everyone, I need a quick solution for a problem I’ve encountered lately… so I’m using prisma on my Apollo Server app to perform read/write operations on the database. The problem is that I want to encrypt my data before saving it and decrypt it when an authenticated user requests it… any way to do this besides doing it manually in the resolver functions?
    ✅ 1
    m
    n
    • 3
    • 6
  • y

    YeonHoPark

    02/08/2021, 12:35 AM
    Does anyone who knows how to resolve this issue ?🙏
    n
    a
    • 3
    • 13
  • y

    YeonHoPark

    02/08/2021, 12:35 AM
    https://github.com/prisma/prisma/issues/3783
  • y

    YeonHoPark

    02/08/2021, 12:37 AM
    Copy code
    filtering: true,
    above option is not working for me
  • u

    李白字一日

    02/08/2021, 2:35 AM
    How to share prisma's schema over packages, while keep only one copy of it?
    e
    n
    • 3
    • 6
  • s

    Sylvain (seel-vahn)

    02/08/2021, 5:12 AM
    Quick question - Would anyone know if the relation queries “disconnect” and “connectOrCreate” are case sensitive? As an example, would the following work without causing errors?
    Copy code
    await prisma.post.update({
      where: { id: 'xxx' },
      data: {
        tags: {
          disconnect: [
            // disconnect tag with uppercase
            { label: "World" }
          ],
          connectOrCreate: [
            // connect or create tag full lowercase
            {
              where: { label: "world" },
              create: { label: "world" }
            }
          ]
        }
      }
    })
    ✅ 1
    • 1
    • 1
1...415416417...637Latest