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

    joshua

    09/09/2021, 11:57 PM
    hi all, im learning prisma with nextjs and so far im having a blast. im currently using a sqlite database using the following code in my
    schema.prisma
    file:
    Copy code
    datasource db {
      provider = "sqlite"
      url      = "file:./dev.db"
    }
    can this be used is production say if i deploy to vercel, or is it only for development? thanks 🙂
    🙌 1
    r
    • 2
    • 3
  • m

    Marx Low

    09/10/2021, 8:04 AM
    Hey everyone 👋, been exploring Prisma and I’m curious if there is a way for me to annotate a new field with Prisma READ: For example, if we have a simple Post, User, & Like table:
    Copy code
    // prisma.schema
    Table Post { likes [], ... }
    
    Table User { likes [], ... }
    
    Table Like { userId, postId, ...}
    Is there a way for me to create a new
    likedByUser
    Boolean field (Not part of the Post Schema) like this:
    Copy code
    prisma.post.findMany({
      where: {..}
      select: {
        likedByUser: { // New annotated field
           where: { 
             likes: [
               { userId: { equals: 2 } },
             ]
           }
        }
      }
    });
    r
    • 2
    • 3
  • d

    Daniell

    09/10/2021, 8:38 AM
    Hey guys, I am mutating
    process.env.DATABASE_URL
    before creating a Prisma client instance like
    process.env.DATABASE_URL = ...
    but unfortunately this results in
    Copy code
    error: Environment variable not found: DATABASE_URL.
      -->  schema.prisma:11
       | 
    10 |   provider = "mysql"
    11 |   url      = env("DATABASE_URL")
       |
    Any idea what I can do?
    m
    r
    • 3
    • 4
  • a

    Anirudh Nimmagadda

    09/10/2021, 8:59 AM
    Hey everyone, I'm encountering a very vexing stack overflow on what looks like a pretty standard
    createMany
    call. I'm creating 20k user records with
    prisma.user.createMany({data: records, skipDuplicates: true})
    . Each record looks like
    Copy code
    {
        email:'<mailto:Dariana_Cronin@example.net|Dariana_Cronin@example.net>',
        emailVerified:true,
        firstName:'Arnoldo',
        lastName:'Brakus',
        username:'Jabari.Schmeler'
    }
    This call results in
    Copy code
    RangeError: Maximum call stack size exceeded
        at Arg.collectErrors (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34906:14)
        at valueToArg (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35224:47)
        at /mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35468:17
        at Array.reduce (<anonymous>)
        at objectToArgs (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:35445:28)
        at /mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34989:48
        at Array.reduce (<anonymous>)
        at selectionToFields (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34948:36)
        at makeDocument (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:34940:20)
        at PrismaClient._executeRequest (/mnt/32DBD2DF4E5DE24C/work/projects/prisma-test/node_modules/@prisma/client/runtime/index.js:36972:23) {clientVersion: '2.29.0', stack: 'RangeError: Maximum call stack size exceeded
    …les/@prisma/client/runtime/index.js:36972:23)', message: 'Maximum call stack size exceeded'}
    Has anyone encountered anything like this before?
    r
    • 2
    • 3
  • g

    gustav

    09/10/2021, 1:46 PM
    whats your preferred way of sharing a prisma client in a monorepo with two different apps (api and ui)?
    r
    • 2
    • 2
  • j

    Julia Cassemiro

    09/10/2021, 2:17 PM
    Hii, does anyone know about querying with the session I just made with NextAuth.js?
  • h

    Halvor

    09/10/2021, 3:15 PM
    When creating relational entries should i update() the holder of the one to many releation or make the "childs" and just link the parent?
    r
    • 2
    • 1
  • p

    Perry Raskin

    09/10/2021, 7:26 PM
    I’m running into an issue where I’m hitting 20/20 connections on my hobby-dev database, and i’m the only one using the website right now. how can i solve this? i’m using the
    prisma.$disconnect()
    method on all api endpoints, so i’m confused as to why this is an issue Edit: I read some of the docs, and I set a global
    prisma
    client, and removed all of the
    $disconnect
    calls. It still seems to eat up the connections quickly, though.
    k
    • 2
    • 4
  • h

    Hector

    09/10/2021, 9:27 PM
    Hello, any way to specify Prisma to format schema using lowercase field names when running
    prisma format
    ?
    r
    • 2
    • 1
  • c

    Calvin

    09/10/2021, 9:37 PM
    Hello, with the latest release that supports groupby, is prisma still OpenCRUD compliant?
  • r

    Ron Arts

    09/10/2021, 9:55 PM
    Hi. I am considering a stack for a new application. Asking for opinions on Prisma+Apollo+NestJS vs Prisma+Apollo. NestJS offers ways to maintain the schema, Apollo of course, but Prisma offers it too. I want to use migrations. Would NestJS even be a benefit in this case? If I use Prisma to maintain the schema, will that generate a GraphQL schema that NestLS can use? Thanks for any advice.
    a
    r
    • 3
    • 4
  • i

    inlightmedia

    09/11/2021, 5:28 AM
    I just ran a pg_dump on my postgres database of 2.8GB and it took about 15-20 minutes to complete. prisma export takes 11+ hours and it is still not done. Any ideas how and why prisma export would take so long compared to pg_dump?
  • r

    Ron Arts

    09/11/2021, 12:29 PM
    @inlightmedia Multiple factors at play here. pg_dump is optimized for this. Output format is important too, so it depends on the flags you use on pg_dump. So you might be comparing apples with oranges.
  • f

    Feralheart

    09/11/2021, 3:52 PM
    How to add global events to prisma? For example there's an update query in any of the models, do something?
    a
    • 2
    • 1
  • v

    Vilke

    09/11/2021, 4:03 PM
    Next.JS Prisma trying seed with latest 3.0.2 updated packages: TSError: ⨯ Unable to compile TypeScript: error TS5023: Unknown compiler option '0'. error TS5023: Unknown compiler option '1'.
    r
    • 2
    • 2
  • b

    Benny

    09/11/2021, 7:53 PM
    Hi, is there a way to use Prisma for querying multiple schemas in Postgres? According to this is not supported out of the box https://github.com/prisma/prisma/issues/1122, but maybe there is a way to use prefixes for the schema?
  • b

    Benny

    09/11/2021, 7:55 PM
    (without raw query obviously)
  • b

    Benny

    09/11/2021, 8:21 PM
    Nowadays, almost everyone works in a microservices environment. IMHO Prisma just partially support it. The most common patterns to enable data persistence in microservices: • CQRS + event sourcing • Database per service • Shared database per service The shared database per service is very common, and can be achieved via private table or private schemas. Prisma doesnt support private schemas (as can be seen in this issue https://github.com/prisma/prisma/issues/1122).
  • r

    Ramon Pans

    09/11/2021, 9:11 PM
    Hey!! Is there anybody who can help with this? https://stackoverflow.com/questions/69144924/property-create-does-not-exist-in-prisma-client Asked in the client channel but there doesn’t seem to be much activity there
    r
    • 2
    • 2
  • p

    Perry Raskin

    09/12/2021, 3:24 AM
    I’m getting “migration failed” and now it needs to reset the DB? can i revert and avoid resetting the DB?? Edit: this helped
    đź’Ż 1
    r
    • 2
    • 3
  • h

    Hector

    09/12/2021, 4:43 AM
    Hello, any resource for more information on Data Model Meta Format (DMMF) and how it works with Prisma?
    r
    • 2
    • 1
  • t

    Thomas Morice

    09/12/2021, 5:19 PM
    Hello everyone, I have a little question, I have some default value that I want to seed in production for my app by default, is there a specific process to do it? Or should I just run the seeding script in production? Thanks!
    r
    • 2
    • 1
  • j

    John Kelly

    09/12/2021, 8:53 PM
    has there ever been discussion about a shorthand for
    findUnique
    using the primary key?
    r
    • 2
    • 1
  • b

    Brook MG

    09/12/2021, 10:41 PM
    Hey guys, is there anything in the works for https://github.com/prisma/prisma/issues/5052 ?
    r
    • 2
    • 4
  • j

    joshua

    09/13/2021, 2:16 AM
    has anyone ran into the
    getUserByAccount is not a function
    error when using the PrismaAdapter with
    next-auth
    ?
  • j

    Jonathan

    09/13/2021, 8:49 AM
    We had an issue recently in production, where the connection of prisma seemed to be “down”. We had a burst of activity (50 database connections fired in a split second, leading to this problem, and basically breaking our production app):
    Copy code
    Object { message: "Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 5)", locations: […], path: […], … } -
    I had to redeploy the container we had our API deployed on to fix this (the database connection stayed down until then). Obviously something is going wrong with our connections on prisma, but I can’t tell since we only have a single
    prisma client
    we init in a module. Any potential ways of troubleshooting this? Should I do the ill-advised
    prisma.$disconnect
    ?
    r
    j
    • 3
    • 10
  • m

    Mohammed Alrea

    09/13/2021, 9:55 AM
    I have a database from https://portal.azure.com/ and I have DATABASE_URL when try to access it it not work so can do any suggestion
  • m

    Mohammed Alrea

    09/13/2021, 9:56 AM
    to make generate the schema it not working
  • u

    user

    09/13/2021, 10:57 AM
    GraphQL Berlin Meetup #23 - Stephan Schneider - All you (n)ever wanted to know about Introspection

    https://www.youtube.com/watch?v=I8e-IKKpdQcâ–ľ

    ◭ In this talk, Stephan will cover a couple of aspects about what Schema Introspection is, how it relates to ASTs, how it's utilized to client-side validate queries, provide autocompletion, and how its data is used to generate code. ◭ Stephan Schneider (@zcei_ger) is a backend developer at Contentful. Since 2018 GraphQL is not just an interesting technology for him anymore when he started participating in the company's initial development of their first GraphQL API. He has not stepped back since and constantly plays with new ways to integrate pre-existing data into GraphQL. ◭ This talk has been recorded during GraphQL Berlin Meetup. Join our GraphQL Berlin Meetup group here: https://www.meetup.com/graphql-berlin ------------------------ 📚 Resources: ✅ Subscribe to Prisma: https://www.youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w?sub_confirmation=1 ✅ Get help from the Prisma Community: https://slack.prisma.io/ ✅ Learn more about Prisma: ◭ Website: https://www.prisma.io ◭ Docs: https://www.prisma.io/docs ◭ Quickstart: https://pris.ly/qstart ------------------------ 💬 Connect with Prisma: Twitter: https://twitter.com/prisma Instagram: https://www.instagram.com/prisma.io/ TikTok: https://www.tiktok.com/@prismadata Facebook: https://www.facebook.com/prisma.io LinkedIn: https://www.linkedin.com/company/prisma-io ------------------------ Prisma sponsors human-reviewed, professional closed captions for ANY video valuable to our community (for example, about: Node.js, TypeScript & Type Safety, Prisma, databases, etc). Get your FREE captions here: https://pris.ly/closedcaptions
  • u

    user

    09/13/2021, 10:57 AM
    GraphQL Berlin Meetup #23 - Max Stoiber - How to edge cache GraphQL APIs

    https://www.youtube.com/watch?v=vmeTqbYqg0Mâ–ľ

    ◭ This talk has been recorded during GraphQL Berlin Meetup. Join our GraphQL Berlin Meetup group here: https://www.meetup.com/graphql-berlin ◭ Check out GraphCDN here: https://graphcdn.io/ ------------------------ 📚 Resources: ✅ Subscribe to Prisma: https://www.youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w?sub_confirmation=1 ✅ Get help from the Prisma Community: https://slack.prisma.io/ ✅ Learn more about Prisma: ◭ Website: https://www.prisma.io ◭ Docs: https://www.prisma.io/docs ◭ Quickstart: https://pris.ly/qstart ------------------------ 💬 Connect with Prisma: Twitter: https://twitter.com/prisma Instagram: https://www.instagram.com/prisma.io/ TikTok: https://www.tiktok.com/@prismadata Facebook: https://www.facebook.com/prisma.io LinkedIn: https://www.linkedin.com/company/prisma-io ------------------------ Prisma sponsors human-reviewed, professional closed captions for ANY video valuable to our community (for example, about: Node.js, TypeScript & Type Safety, Prisma, databases, etc). Get your FREE captions here: https://pris.ly/closedcaptions
1...480481482...637Latest