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

    Reuben Porter

    10/22/2021, 11:10 AM
    Is anyone else experiencing a crazy high usage of memory whilst running jest tests with prisma?
    d
    s
    • 3
    • 11
  • h

    Hlm

    10/22/2021, 11:23 AM
    Hey prisma team, first of thanks for the library. It is awesome. however I am wondering how to implement this specific count. Let's say a team has taskboards and each board has items. How would I go about getting the count of incomplete items for a single team
    ✅ 1
    • 1
    • 1
  • j

    jferrettiboke

    10/22/2021, 12:20 PM
    Hey! Big fan of PlanetScale here! 😍 Quick question. How does the flow look like when using Prisma and PlanetScale with different environments (development, staging, and production)? I'd appreciate if someone could give some insights because I don't see this that clear. I think with the new branch promotion feature, it would be possible to work with different environments on production (Production and Staging). However, I am not sure how this would work when copying Prisma data from development to Staging and Production.
  • l

    Levente Orban

    10/22/2021, 12:30 PM
    Hello Prisma community. I am new in this Prisma World, but we love the product with our team. We are building a release management tool, in DevOps area where you can easily manage your versions and products if you are interested in contact me 👋 By the way thanks for the hard work to make Prisma live!
    👋 2
  • p

    Patrick

    10/22/2021, 5:13 PM
    In Prisma client, with such schema, what would be best way to get just Posts[] by the user email?
    m
    • 2
    • 18
  • h

    Hmm

    10/22/2021, 10:15 PM
    Is there any workaround to sorting by
    createdAt
    when you are working with seeded data that was all created at the exact same time?
  • h

    Hmm

    10/22/2021, 10:18 PM
    my model looks like
    createdAt  DateTime  @default(now())
  • h

    Hmm

    10/22/2021, 10:19 PM
    @default(now())
    does not record a specific enough time in order for me to preserve order on seeded data
    r
    • 2
    • 1
  • c

    Chip Clark

    10/23/2021, 12:45 AM
    Getting an error: There are fewer columns in the INSERT statement than values specified in the VALUES clause. But the query calls for: [Title], [Description], [Icon], [Sidebar], [IsActive], [Sort] The query contains: {"Title":"New Item","Description":"","Icon":"pe-7s-refresh-2","Sidebar":"","IsActive":false,"Sort":"1"}
    Copy code
    prisma:query SELECT 1                                                                                                                 
    prisma:query SELECT [dbo].[Page].[ID], [dbo].[Page].[Title], [dbo].[Page].[Description], [dbo].[Page].[Icon], [dbo].[Page].[Sidebar], 
    [dbo].[Page].[IsActive], [dbo].[Page].[Sort] FROM [dbo].[Page] WHERE 1=1                                                              
    prisma:query SELECT 1                                                                                                                 
    prisma:query SELECT [dbo].[MainSidebar].[ID], [dbo].[MainSidebar].[Main_Sidebar] FROM [dbo].[MainSidebar] WHERE 1=1                   
    {"Title":"New Item","Description":"","Icon":"pe-7s-refresh-2","Sidebar":"","IsActive":false,"Sort":"1"}                               
    prisma:query SELECT 1                                                                                                                 
    prisma:info Begin transaction                                                                                                         
    prisma:query BEGIN TRAN                                                                                                               
    prisma:query                                                                                                                          
        INSERT INTO [dbo].[Page] (                                                                                                        
          [Title],                                                                                                                        
          [Description],                                                                                                                  
          [Icon],                                                                                                                         
          [Sidebar],                                                                                                                      
          [IsActive],                                                                                                                     
          [Sort]                                                                                                                          
        )                                                                                                                                 
        VALUES (                                                                                                                          
          DEFAULT,                                                                                                                        
          @P1,                                                                                                                            
          @P2,                                                                                                                            
          @P3,                                                                                                                            
          @P4,                                                                                                                            
          @P5,                                                                                                                            
          @P6                                                                                                                             
        );                                                                                                                                
    prisma:info Rollback transaction                                                                                                      
    prisma:query ROLLBACK                                                                                                                 
    [Nest] 146544   - 10/22/2021, 5:40:42 PM   [ExceptionsHandler]                                                                        
    Invalid `prisma.executeRaw()` invocation:                                                                                             
                                                                                                                                          
                                                                                                                                          
      Raw query failed. Code: `110`. Message: `There are fewer columns in the INSERT statement than values specified in the VALUES clause.
     The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.` +234239ms             
    Error:                                                                                                                                
    Invalid `prisma.executeRaw()` invocation:                                                                                             
                                                                                                                                          
                                                                                                                                          
      Raw query failed. Code: `110`. Message: `There are fewer columns in the INSERT statement than values specified in the VALUES clause.
     The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.`                       
        at cb (C:\Sites\AM-API-LMS\node_modules\@prisma\client\runtime\index.js:38537:17)                                                 
        at async Promise.all (index 0)                                                                                                    
        at async PageService.createPage (C:\Sites\AM-API-LMS\dist\Page\Page.service.js:73:30)                                             
        at async C:\Sites\AM-API-LMS\node_modules\@nestjs\core\router\router-execution-context.js:46:28                                   
        at async C:\Sites\AM-API-LMS\node_modules\@nestjs\core\router\router-proxy.js:9:17
    schema:
    Copy code
    model Page {
      ID                Int      @id @default(autoincrement()) 
      Title             String?  @db.NVarChar(255)
      Description       String?  @db.NText
      Icon              String?  @db.NVarChar(255)
      Sidebar           String?  @db.NText
      IsActive          Boolean?
      Sort              Int?
      // Assoc_Page_Tag    Assoc_Page_Tag[]
    }
    page.service.ts
    Copy code
    async createPage(data: Prisma.PageCreateInput) {
        const payload = {
          ...data
        };
        console.log(JSON.stringify(data));
        const insert = this.prisma.$executeRaw`
        INSERT INTO [dbo].[Page] (
          [Title],
          [Description],
          [Icon],
          [Sidebar],
          [IsActive],
          [Sort]
        )
        VALUES (
          DEFAULT,
          ${payload.Title},
          ${payload.Description},
          ${payload.Icon},
          ${payload.Sidebar},
          ${payload.IsActive},
          ${payload.Sort}
        );`;
    
    
        const lastId = this.prisma.$queryRaw`
          SELECT  @@IDENTITY as id;
        `;
    
        const [, response] = await this.prisma.$transaction([insert, lastId]);
    
        return this.PagebyID({ id: response?.[0]?.id });
      }
    r
    • 2
    • 5
  • j

    Julien Goux

    10/23/2021, 5:16 AM
    Hello team. Are any investigation being made about this issue https://github.com/prisma/prisma/issues/9584 ? It makes the whole interactive transaction featurz unreliable for us.
  • u

    user

    10/23/2021, 6:50 AM
    JS Monthly #17: Lewis Prescott - Double up your component & integration tests with Supertest & Nock

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

    This talk builds on my course for Test Automation University (https://testautomationu.applitools.com/javascript-api-testing/) Using the power of mocking and the tool Nock. You can build component and integration tests with one set of scripts. I will show you how this is possible and also explain the difference between component and integration tests. In order to make your tests fast and build tests at the right level, use the power of mocking. The JS Monthly Meetup was organised by Aris Markogiannakis (JS Monthly host) and hosted by Prisma. ✨ Join the Prisma Meetup group here: https://www.meetup.com/js-monthly/ Follow Lewis: Twitter: https://twitter.com/WuigPrescott Next: 👉 Check Previous video: Heavily Connected Data Applications -

    https://youtu.be/D7C-97HgXTs▾

  • g

    Giovanni Italiano

    10/23/2021, 2:42 PM
    Hi everybody, I'm following a videocourse on udemy for GraphQL Prisma PosteGresql but in this course, they are using Prisma 1.01 that uses Docker, creates automatically GraphQL APIs, now i'm tryiing to replicate on latest version of prisma a backend with Apollo but the guide is completely different Can someone help me, please?
    m
    r
    • 3
    • 2
  • n

    Nathaniel Babalola

    10/23/2021, 11:42 PM
    Prisma is always timing out whenever I run a
    deploy
    or
    resolve
    command . Please how can I resolve this, there's nothing in the docs on resolving this
    r
    • 2
    • 4
  • i

    Ibrahim

    10/24/2021, 7:50 AM
    hi, is the Prisma + MongoDB stable yet ?
    m
    • 2
    • 1
  • s

    stephan levi

    10/24/2021, 11:37 AM
    Hi, im getting the following error - Cannot use GraphQLNonNull “UserWhereUniqueInput!” from another module or realm. when i try to run PRISMA GENERATE i have the following dependencies - “@apollo/gateway”: “^0.42.3”, “@aws-sdk/client-s3": “^3.38.0”, “@aws-sdk/node-http-handler”: “^3.38.0”, “@aws-sdk/s3-request-presigner”: “^3.38.0”, “@fixefy/fixefy-core”: “^1.9.19”, “@graphql-tools/schema”: “^8.3.0”, “@graphql-tools/utils”: “^8.5.0”, “apollo-server-core”: “^3.4.0”, “apollo-server-express”: “^3.4.0”, “apollo-server-types”: “^3.3.0”, “aws-sdk”: “^2.1013.0”, “cors”: “^2.8.5”, “date-fns”: “^2.25.0”, “dotenv”: “^10.0.0”, “dotenv-expand”: “^5.1.0”, “express”: “^4.17.1”, “got”: “^11.8.2”, “graphql”: “^15.6.1”, “graphql-cli”: “^4.1.0”, “graphql-import”: “1.0.2”, “md5": “^2.3.0”, “mongoose”: “^6.0.12”, “nodemon”: “2.0.14”, “pdf2json”: “^1.2.5”, “prisma-client-lib”: “^1.34.12”, “socket.io”: “^4.3.1”
    r
    • 2
    • 1
  • y

    Yerzhan

    10/24/2021, 4:47 PM
    Hi there, Does anyone know when PostgreSQL 14 will be supported? Any approximate dates from devs? Thanks!
    r
    • 2
    • 2
  • m

    mel

    10/25/2021, 2:08 AM
    Hello, when will the third part of the tutorial (https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-2-fwpc6ds155) be published? thank you
    r
    m
    • 3
    • 4
  • n

    Noel Martin Llevares

    10/25/2021, 6:43 AM
    For postgres, can prisma use a schema different from public?
    r
    h
    • 3
    • 3
  • d

    Dante

    10/25/2021, 7:06 AM
    I’d like to create a health check endpoint if prisma is connected with my backend server(Nodejs or NestJS). Anyone has good idea on this?
    r
    • 2
    • 3
  • n

    Noel Martin Llevares

    10/25/2021, 7:16 AM
    Why does prisma need to connect to the db if it only needs to write migrations?
    Copy code
    prisma migrate dev --create-only
    The above command is only meant to create migrations but not execute them. It should NOT need to connect, For comparison, Django’s
    makemigrations
    can create the migrations without connecting to the database.
    r
    • 2
    • 3
  • r

    Reuben Porter

    10/25/2021, 9:42 AM
    Anyone experienced the following issues whilst running jest tests?
    Copy code
    (node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 beforeExit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
    
    (node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
    
    (node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGUSR1 listeners added to [process]. Use emitter.setMaxListeners() to increase limit
    r
    • 2
    • 2
  • m

    Moud

    10/25/2021, 10:38 AM
    Maybe a noob question, I'm very new to Primsa, but is there an abstract type or interface for all the schemas? Since each of them has it's own type after Prisma generates them
    r
    n
    • 3
    • 5
  • s

    Simskii

    10/25/2021, 12:12 PM
    We have an issue with Connection Pool timout. We can’t figure out whats causing the connection pool limit to get filled up and exhaust the connection pool queue. This leads to connection pool timeouts. Tried to use the built in prisma logger but there is no way to log which query is failing when timeout is happening. Preferably there should be a query parameter in this errorobject.
    }
    meta: { connection_limit: 9 }
    clientVersion: '2.29.1',
    code: 'P2024',
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
    at runMicrotasks (<anonymous>)
    at RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:36744:15)
    PrismaClientKnownRequestError3 [PrismaClientKnownRequestError]: Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 9)
    }
    • 1
    • 1
  • n

    Nima

    10/25/2021, 1:03 PM
    Hey guys it looks like our database connection was removed from Prisma cloud https://cloud.prisma.io/ and now when I try to re-add it I get this error:
    r
    s
    • 3
    • 8
  • n

    Nathaniel Babalola

    10/25/2021, 1:03 PM
    I keep getting this error almost anytime I run
    migrate resolve
    or
    migrate deploy
    . Can anyone please help with this, it has slowed down my work. N.B: Postgres DB is hosted on Heroku
    r
    j
    • 3
    • 10
  • s

    Spiros - Product at Prisma

    10/25/2021, 2:04 PM
    Edit: This issue is now resolved. There may be some data loss between the incident and its resolution as we have restored an earlier backup. If that is the case, feel free to re-create the projects or let us know by opening an issue in this repo. Thank you for your patience. ======== Hello there, we are currently encountering an issue in the Prisma Data Platform (cloud.prisma.io) where every project's Database is unlinked, thus making your projects unavailable. Our current plan of action is to restore an earlier backup to make sure that everything is functioning properly. We understand that this may have seriously disrupted your workflows so we deeply apologize for that. We will post another update once the incident is resolved. Thank you for your patience.
    • 1
    • 1
  • b

    Bryan Migliorisi

    10/25/2021, 2:18 PM
    Anyone have any luck seeing DB transactions in NewRelic? Everything else is instrumented except my DB and Im not sure why
    c
    • 2
    • 1
  • g

    gustav

    10/25/2021, 3:25 PM
    How fast is
    findFirst
    ? Would it be faster to use two
    findUnique
    calls to prisma, utilizing the indexes? See example:
    t
    • 2
    • 1
  • j

    Jaye

    10/25/2021, 3:27 PM
    can i do a nested
    connectOrCreate
    from within an
    upsert
    query? i'm getting an error that prisma doesn't understand my args at the moment
    r
    • 2
    • 4
  • g

    gustav

    10/25/2021, 3:28 PM
    @Jaye could you post the call you are trying to make?
1...498499500...637Latest