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

    khareta

    03/11/2021, 2:40 PM
    Is Aws Lambda a good choice for hosting a Prisma client API? this api will serve: • a website built using Nextjs that relies much on SSR • mobile apps on android and ios • admin dashboards Would it handle hundreds of thousands of requests? would using EC2 instances with authoscaling be a better option? Aspects that matter are: • performance • reliability • costs • fault-tolerance Any help from you guys is appreciated
  • n

    Natalia

    03/11/2021, 4:03 PM
    Ryan Chenkie is now interviewing Matt Mueller, our Product Manager, about transactions in Prisma! 🤩 Tune in to the livestream here:

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

  • s

    Simão Cruz

    03/11/2021, 4:58 PM
    Hey! I'm currently making my product transition from prisma v1 to prisma v2 and I'm feeling problems with 1-1 relation. I've a table project, connected to user table in two fields (manager and financialmanager). When I do findUnique in project model it return me a error saying "Project.manager" does not exists in database. How can I preserve names in this case?
    n
    • 2
    • 3
  • d

    Daniell

    03/11/2021, 11:08 PM
    Does anyone have a link to a GitHub issue for c# support? I’d like to give c# a try again when prisma supports it, couldnt find it through google and gh issues but heard about it in the latest interview
    r
    • 2
    • 2
  • u

    uzu

    03/11/2021, 11:20 PM
    Has anyone use prisma with nestjs + serverless?
    m
    • 2
    • 1
  • r

    Robert

    03/12/2021, 9:40 AM
    Quick question; I have a standard database on Digital Ocean with a connection pool of size 11 + pgBouncer in front of it. How am I supposed to configure the DB URL for Prisma? I have
    <URL>/pool?sslmode=require&pgbouncer=true
    However this causes me a lot of trouble. I very often get an
    Error: P1002
    during build time on Vercel (while running
    prisma migrate deploy --preview-feature
    ) and when using my app often get hit with a
    Copy code
    Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (<https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#connection-pool>). Current limit: 5.
    Granted I execute quite a few queries, but nothing crazy... and this is only 1 user! What if I have 10 active users? Or 100? I thought setting
    pgbouncer=true
    should be enough? Should I set connection limit to 11? Or to 5000? I'm very confused! What am I doing wrong? 😅
    d
    d
    • 3
    • 8
  • d

    Darryl

    03/12/2021, 9:53 AM
    This is more of a conceptual question than something directly related to Prisma but I'm hoping some people here will have some thoughts on this. Right now, I'm using Prisma with Apollo Server to create the GraphQL API used by an app. Products in the database have things like
    description
    ,
    notes
    , etc. Right now, those things are simply stored as (English) strings – or lists of strings in the case of
    notes
    – but I've recently been thinking about translations. My app has the ability to provide translations for in-app strings but everything from the database, at least right now, will be in English. I'm wondering what'd be a smart way to include translations for these things straight from the database. Just thinking out loud, maybe I could store things like
    description
    as
    JSON
    (I'm using PostgreSQL) instead of a string and then structure that by "en", "de", etc. Then, the user's locale could be passed via query parameter. Anyway, I'm kind of new to all this and learning as I go so I'd be happy to hear some suggestions. Thanks, everyone! Have a great day.
    • 1
    • 1
  • m

    Matheus Assis

    03/12/2021, 12:03 PM
    Just wanted to say that this slack is amazing with all the answers we get. It really helps our team feel safe on using prisma because the prisma team is always open to answer and discuss regardless if the question is something stupid or not. It's so frustrating when you use something like some other framework(even unrelated to db), and you can't get answers in their forum/website/chat/whatever. Kudos to the prisma team, and keep the good work!
    prisma rainbow 10
    ❤️ 10
  • s

    Szymon Polom

    03/13/2021, 12:07 PM
    In regards to
    Can't reach database server at
    with the error code
    P1001
    - is there a way to increase the time limit for the connection handling (besides of
    DB_POOL_TIMEOUT
    )? My use case is a serverless DB in AWS which needs a bit of startup time. I digged a bit through the code, but couldn't find anything.
    t
    • 2
    • 4
  • r

    Ryan Byrne

    03/13/2021, 6:04 PM
    Anyone auto generating graphql schema from a
    schema.prisma
    file? Trying to see if there is any way of having a single source of truth to generate DB schema/graphql schema/ and some types - maybe a pipe dream though 🙂: Edit - I think
    typegraphql-prisma
    may be what I am looking for
    👀 1
    b
    r
    j
    • 4
    • 4
  • a

    Aaron Gerber

    03/13/2021, 10:37 PM
    Copy code
    const introduction = `
      type HellowWorld {
        Person: Aaron`;
  • v

    Ville

    03/14/2021, 2:10 PM
    Any plans to build editor integration for Webstorm / IntelliJ? https://github.com/prisma/prisma/issues/1788 Not having proper supports excludes big chunk of the devs.
  • g

    George / გიორგი

    03/14/2021, 2:29 PM
    hi folks, need your help. I have to store multiple country name record on the same date but this query only allows to have one per day how to solve it?
    Copy code
    const upsert = await prisma.analytics.upsert({
            where: { date: new Date(body.date) },
            update: {
                viewers: body.viewers,
            },
            create: {
                date: new Date(body.date),
                country: body.country,
                viewers: body.viewers,
            }
        })
        res.status(204).json(upsert)
    s
    • 2
    • 6
  • m

    Manish

    03/15/2021, 2:40 AM
    Hi, I’m using Postgresql with Primsa. I need some help with the best way to design my database. More details inside the thread.
    l
    • 2
    • 7
  • m

    Mitchell

    03/15/2021, 4:14 PM
    I’m working on the HowtoGraphQL Hackernews tutorial. When I do a migrate I see this warning in the console:
    warn(prisma) @prisma/cli has been renamed to prisma.
    Please uninstall @prisma/cli: npm remove @prisma/cli
    And install prisma: npm i --save-dev prisma
    r
    • 2
    • 6
  • s

    Stephen Jensen

    03/16/2021, 3:49 AM
    Hey all, I'm wondering if someone can explain self relations by use of a join table. I know has been discussed previously but there's something I'm still missing some important about how it works. The use-case here is having a
    User
    model where it can have friends who are also users. About 5 months ago I saw a nice explanation by @Ryan where he said we could use the following model:
    Copy code
    model User {
      id        String         @id @default(cuid())
      createdAt DateTime       @default(now())
      updatedAt DateTime       @updatedAt
      friends   Relationship[]
    }
    model Relationship {
      id        String   @id @default(cuid())
      user      User?    @relation(fields: [userId], references: [id])
      userId    String?
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    I think the thing that would clear this up for me would be to see example prisma create commands that would show how to take 2 users and first create a relation from
    user1 -> user2
    and then how to do the back relation. I'll start- thanks so much!
    Copy code
    const user1 = await prisma.user.create({ data: { id: "1" } })
    const user2 = await prisma.user.create({ data: { id: "2" } })
    const relationship1To2 = await prisma.relationship.create({ //?? })
    const relationship2To1 = await prisma.relationship.create({ //?? })
    (My confusion stems from the fact that it seems like if we create a relationship where we set
    user1.id
    to
    userId
    , we will establish the relationship between
    user1->friendship
    but not back to
    user2
    .)
    r
    r
    • 3
    • 7
  • n

    nikolasburk

    03/16/2021, 5:15 PM
    Hey friends 👋 as you might have seen, we've launched Prisma Migrate for General Availability today 🚀 To help spread the word about Prisma Migrate, we'd very much appreciate if you could help us out with a retweet ❤️ https://twitter.com/prisma/status/1371861835184533512
    💚 7
    🐦 6
    • 1
    • 1
  • m

    Mitchell

    03/16/2021, 5:44 PM
    I”m working through the HowToGraphQL tutorial. I’m in the section: Adding a Database > Getting Started with SQLite. When I run:
    Copy code
    npx prisma migrate dev --preview-feature
    I see this message in the console:
    migrate dev is not a prisma command.
    ▸ Perhaps you meant generate
    r
    • 2
    • 1
  • s

    Sequential

    03/16/2021, 5:51 PM
    Prisma Migrate entering GA is huge. Congratulations all, I will be deploying a production implementation of prisma migrate now very soon :)
    🚀 4
    💚 1
  • m

    Martïn

    03/16/2021, 6:06 PM
    I am really excited about Prisma Migrate going GA. Congratulations to the teams and amazing community behind Prisma. 🎉
    💚 2
    prisma rainbow 4
  • p

    Philipp Rajah Moura Srivastava

    03/16/2021, 6:36 PM
    Hi all. Does anyone know how to disable the admin dashboard that can be accessed through http://localhost:4466/<project>/dev/_admin ?
    r
    • 2
    • 2
  • a

    ANISH AGGARWAL

    03/16/2021, 10:54 PM
    Hi, I have an application depending upon
    graphql-yoga
    but due to update in Chrome, it doesn't allow to persist
    cookie
    by
    sameSite
    which can be fixed by https://github.com/prisma-labs/graphql-yoga/issues/623 I would be happy to contribute to fix it if the mentor aggrees, and community is active. Thanks!🙂
  • y

    Yilmaz Ugurlu

    03/17/2021, 10:46 AM
    Hey all. Is it possible to tell Prisma that use relation but not actually create foreign keys in the database? It’s all good, but my db is getting bigger, and I don’t want to worry about foreign keys during the scaling phase. My thought, since I am declaring all the relation explicitly, so Prisma would figure it out without relying on the FKs. And I know the data consistency is my problem now. I haven’t tried dropping FKs manually, I’ll try that as well, but I just wanted to ask initially just if possible,
    r
    • 2
    • 5
  • r

    Ralf Vogler

    03/17/2021, 4:26 PM
    I've only used
    prisma db push
    so far, now
    prisma migrate dev
    wants to reset the database but I already have data in it. How can I keep it or easily copy it?
    d
    • 2
    • 18
  • d

    Daniel Snell

    03/17/2021, 4:34 PM
    Hey everyone, I had a question about connecting to remote sql or mariadb instance, I was wondering how you typically format your connector. Right now I am getting a connection error and I believe it's trying to connect locally even though I have a hosting ip indicated. Any assistance would be great.
    r
    • 2
    • 5
  • m

    Mike Cavaliere

    03/17/2021, 4:45 PM
    Hello! When deploying via Vercel with 2.18, I'm seeing seed data in a production environment. Do seeds run by default?
    d
    • 2
    • 10
  • d

    Dmitry Petrov

    03/17/2021, 5:28 PM
    Hi all! I have a question about Prisma seeding. I realize the scope of the question may be somewhat outside Prisma itself, but would appreciate any help/pointers if anyone is willing to offer some. We use Next.js, and following the 1.18.0 release I added
    "ts-node": "ts-node --compiler-options '{\"module\":\"CommonJS\"}'"
    to
    package.json/scripts
    to allow it to run. Prior to 1.18.0 I was using the workaround suggested in this GitHub issue by elkevinwolf. All was working fine on my local dev environment, but I’m getting errors when I try to do this as part of a Vercel build. The
    seed.ts
    file references other lib files in our codebase, almost all of which are ES6 modules. We also have baseUrl set to
    .
    in
    tsconfig.json
    – though I think I’ve been able to work around that. I feel that this is a result of my knowledge gap in how modules and compilers function – but since I reference ES6 modules and they have import statements, etc. all with absolute imports utilizing the basePath, things break as those functions get invoked. I’m sorry if this is somewhat vague, happy to provide code examples/errors/etc. – just want to make sure I provide what’s useful.
    j
    • 2
    • 2
  • m

    Mike Cavaliere

    03/17/2021, 5:29 PM
    Another Q: is there a preferred way in
    package.json
    to toggle migration commands when deploying? I.e. to run
    prisma migrate dev
    vs
    prisma migrate deploy
    dependent on environment (preview vs prod)?
    d
    j
    • 3
    • 10
  • m

    Mitchell

    03/17/2021, 5:53 PM
    I’m working through the React GraphQL Apollo tutorial. I’m on Introduction > Exploring the server. When I run the sample GraphQL query I get:
    “code”: “INTERNAL_SERVER_ERROR”
    “Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.\n”
    Looks like it’s a problem in:
    /@prisma/client/runtime/index.js:32448:19
    • 1
    • 1
  • m

    Mitchell

    03/17/2021, 10:05 PM
    I’m the Mutations: Creating Links section of the React Apollo Tutorial. The CreateLink component gives an error:
    Unhandled Rejection (Error): Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.
    I’m guessing this because you need to be logged in before you can post? Is it possible to modify the server code to allow
    postedById
    to be undefined or null?
    e
    • 2
    • 3
1...422423424...637Latest