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

    potatoxchip

    11/03/2021, 9:57 AM
    hi! Does anyone know how to fix this error? I'm using Prisma Data Proxy and it fails to connect 😞
    j
    • 2
    • 39
  • p

    potatoxchip

    11/03/2021, 9:58 AM
    I checked in cloud.prisma.io and it connects fine and displays my data
  • p

    potatoxchip

    11/03/2021, 9:59 AM
    I followed this guide https://www.prisma.io/docs/concepts/components/prisma-data-platform
  • a

    Amit Goldfarb

    11/03/2021, 10:13 AM
    Hey @Amit and I have been having connection pool issues (happens rarely).
    Copy code
    PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 1)
    This happened multiple times to different node processes on the same container. After closing and restarting the container this issue doesn’t reoccur.
    p
    j
    +3
    • 6
    • 26
  • n

    n

    11/03/2021, 10:28 AM
    Has anyone worked with apollo graphql studio, in regards to DateTime and Date? I can't pass it as a string, guess this is a missing feature not 100% any ideas?
    r
    • 2
    • 13
  • g

    Gelo

    11/03/2021, 10:33 AM
    Full text search not working when mixed with date filters or pagination.
    r
    • 2
    • 3
  • u

    ut dev

    11/03/2021, 11:49 AM
    Hi, I have a general question regarding my naming of the foreign keys in my schema, is this naming fine? https://kopy.io/gSQfd
    r
    • 2
    • 3
  • p

    pleblancq

    11/03/2021, 2:46 PM
    Hi, There is possibly a memory leak in Prisma when using executeRaw from inside a stream.on("data"). My use case is uncompressing on the fly a sql dump from AWS S3 via a pipe and then when there is a full SQL statement, executeRaw is called. The memory just grows until the process is killed. I swapped prisma for the mysql driver and there is no leak
  • p

    pleblancq

    11/03/2021, 2:51 PM
    snippet example:
    ...
    var consumeSQL = new Promise((resolve) => { decompressFile.on("data", async (chunk: Buffer) => { decompressFile.pause(); partSql += chunk.toString("utf8"); var sql = partSql.split("\n"); let incompleteSql = ""; for (var i = 0; i < sql.length; i++) { if (sql[i].endsWith(";")) { try { ... await prisma.$executeRaw(sql[i])); ... } catch (err) { console.log(err); process.exit(1); } } else { incompleteSql += sql[i]; } } partSql = incompleteSql; decompressFile.resume(); }); decompressFile.on("end", async () => { resolve("ended"); connection.end(); }); }); ...
    r
    • 2
    • 1
  • u

    user

    11/03/2021, 3:30 PM
    Announcing Prisma Serverless Data Conference Announcing the first Prisma Serverless Data Conference! A one-day online event happening on November 18th focussed on database access in serverless environments!
  • o

    Oleg Yarin

    11/03/2021, 3:58 PM
    Hey There! Can someone advice me how can i see an actual mongo db query that is sent to the db? I use
    log: ['query']
    but somewhat see only this output in my cli:
    Copy code
    query {
         findManyStatement(where: {
           contextId: "id"
         }) {
           id
           content
         }
       }
    r
    • 2
    • 1
  • d

    Dev__

    11/03/2021, 3:59 PM
    I am trying to insert a record with a field of type
    Json
    . One if the properties I try to insert is of type
    Decimal
    but seems the schema type
    Json
    doesnt accept that which I find strange since
    Decimal
    is a part of prisma. any other way?
    r
    • 2
    • 1
  • t

    Tim Griffin

    11/03/2021, 5:21 PM
    Hi folks, running into this issue where, if our postgres DB isn't ready when our application boots up and tries to make a query, the application has to be restarted to make a connection. Wondering if anyone has faced this/if there's a workaround? https://github.com/prisma/prisma/issues/9420
    a
    • 2
    • 2
  • a

    Andrew Valleteau

    11/03/2021, 7:58 PM
    Hi there, I have a question regarding prisma.$queryRaw function. I want to call an POSTGRESQL function which take an array of string as parameter and return a boolean. So I did:
    Copy code
    prisma.$queryRaw<boolan>("SELECT my_function($1, $2, $3, $4)", param_1, param_2, param_3, Prisma.join(myArrayOfString));
    However, this doesn't work. What is the proper way to convert my array of string into his
    {"value1","value2"}
    equivalent ?
    j
    t
    • 3
    • 3
  • d

    Dan Borstelmann

    11/03/2021, 9:46 PM
    Hello, I've been deploying to serverless framework with apollo-server-lambda for awhile and everything is nice and snappy, I just added Prisma to the project with PrismaClient being added to the apollo server context and it's causing massive latency and what seems like stack overflows. Anyone seeing similar things recently?
    n
    • 2
    • 8
  • n

    Nick Zhang

    11/04/2021, 6:53 AM
    Anyone familiar with this error ?
  • k

    Kharann

    11/04/2021, 12:14 PM
    Hi! My prisma migrate deploy in my CI pipeline is printing out the database url. How to avoid this?
    n
    • 2
    • 1
  • l

    Laurence Davies

    11/04/2021, 1:19 PM
    Hi Guys 🙂 I'm looking to incrementally adopt prisma in favour of typeorm. I'm struggling when it to swapping out my typeorm entity for the equivalent prisma model due to Json columns. Type orm requires strict typing for json columns, whereas prisma seems to use the generic
    JsonValue
    . Is there anyway to explicitly type a json column in the prisma schema?
    n
    • 2
    • 1
  • k

    kyler

    11/04/2021, 3:49 PM
    Hey team, did anyone run into issues doing unit tests with jest and typescript? Following this guide in the docs - https://www.prisma.io/docs/guides/testing/unit-testing When the I run the tests I get
    TypeError: import__.PrismaClient is not a constructor
  • r

    Raif Harik

    11/04/2021, 10:47 PM
    does the prisma dataloader use the facebook graphql dataloader under the covers?
    r
    • 2
    • 8
  • a

    Amos Bastian

    11/04/2021, 11:12 PM
    Wondering if anyone has an example of using Prisma with Supabase, in particular with Supabase’s auth?
    m
    • 2
    • 2
  • r

    Ryan Rhodes

    11/05/2021, 2:45 AM
    Hi folks. Has anyone experienced the following error while running `npx prisma migrate dev --feature-preview`:
    Copy code
    Error: Failed to create a new migration directory.
       0: migration_core::api::CreateMigration
               with migration_name="init" draft=false
                 at migration-engine/core/src/api.rs:94
    t
    j
    • 3
    • 19
  • j

    joao.santos

    11/05/2021, 10:14 AM
    Hi guys, is anyone here using https://github.com/amplication/prisma-schema-dsl? Cant get it to work...
    n
    i
    • 3
    • 12
  • s

    shahrukh ahmed

    11/05/2021, 10:51 AM
    When we do upsert, is there a way of knowing if the object is created for the first time or is newly created?
    r
    • 2
    • 4
  • o

    Oleg Yarin

    11/05/2021, 12:35 PM
    Hi dear prisma team 👋 I have a question to the way prisma handles the relation query Giving the following schema:
    Copy code
    model User {
      id       Int       @id @default(autoincrement())
      username String?   @unique
      contexts Context[]
    }
    
    model Context {
      id          Int         @id @default(autoincrement())
      contextName String
      user        User        @relation(fields: [userId], references: [id], onDelete: Cascade)
      userId      Int
    }
    I want to get all of the contexts belonging to the user. If I write in the way prisma suggest me to write:
    Copy code
    const userContextsSample = await this.prisma.user.findUnique({
          where: {
            id: userId,
          },
          include: {
            contexts: true,
          },
        });
    I see that prisma generates two SQL queries:
    Copy code
    prisma:query SELECT "public"."User"."id", "public"."User"."username" FROM "public"."User" WHERE "public"."User"."id" = $1 LIMIT $2 OFFSET $3
    
    prisma:query SELECT "public"."Context"."id", "public"."Context"."contextName", "public"."Context"."userId", "public"."Context"."createdAt" FROM "public"."Context" WHERE "public"."Context"."userId" IN ($1) OFFSET $2
    This looks quite suboptimal to me. As I have already the
    userId
    in place I would expect just one single SQL query:
    Copy code
    SELECT "public"."Context"."id", "public"."Context"."contextName", "public"."Context"."userId", "public"."Context"."createdAt" FROM "public"."Context" WHERE "public"."Context"."userId" IN ($myOriginalUserId)
    Is there a way prisma can achieve that? Many thanks in advance!
    r
    • 2
    • 2
  • b

    Blakelock Brown

    11/05/2021, 6:35 PM
    I'm running into an issue setting up prisma with connection pooling: https://github.com/prisma/prisma/issues/10139 has anyone had this issue before?
  • b

    Blakelock Brown

    11/05/2021, 6:37 PM
    I'm also hitting connection limits with Vercel even though I'm following these guidelines 😕 https://www.prisma.io/docs/support/help-articles/nextjs-prisma-client-dev-practices#problem
  • g

    Gabe O'Leary

    11/05/2021, 7:49 PM
    has anyone seen prisma throwing errors with no code or message? This is what gets thrown by prisma, but it's kind of hard to debug...
    Copy code
    {
      clientVersion: "3.3.0"
    }
    Also I can't repro it locally, it only happen in our production environment which makes it even more difficult to debug... This happens when I execute a raw query that looks like this:
    Copy code
    const query = Prisma.sql`
        select url, count(*) as count
        from (
          select distinct "Status"."userIdStr", "Status".url
          from "Status"
          where "Status"."createdAt" > (to_timestamp(${startDate.getTime()} / 1000.0))
            and "Status".url is not null
          ) as distinct_user_url_statuses
        group by url
        having distinct_user_url_statuses.count > 1
        order by count desc  
        limit ${limit}
        `;
    
    const data = await prisma.$queryRaw<{ url: string; count: number }[]>(query);
    plus one +1 2
    k
    • 2
    • 3
  • r

    Richard Prins

    11/05/2021, 11:36 PM
    What are some common solutions for a real-time subscription need that prisma projects can use since prisma2 does it support it yet?
    m
    r
    +2
    • 5
    • 5
  • o

    Omar

    11/06/2021, 4:05 PM
    Hello, Has anybody got a workaround for this? https://github.com/prisma/prisma/issues/7183 It's an old issue since April
1...503504505...637Latest