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

    Chad

    09/22/2020, 5:33 AM
    Has anyone else ran into issues trying to dockerize their prisma2 app? when trying to migrate I get errors with not being able to find the db, and yes I did update the localhost to the name of the postgres service. Any help would be amaizing! thanks
    r
    • 2
    • 1
  • n

    Natalia

    09/22/2020, 10:56 AM
    Our Developer’s Advocate, Ryan Chenkie, will give a talk about setting up Prisma for This Dot Lab tomorrow (September 23rd)! Tune in at 21:30 CEST here.
    prisma green 2
    😎 2
    💯 3
    prisma cool 2
  • l

    Logan Lee

    09/22/2020, 12:48 PM
    i tried to CRUD like this
    Copy code
    await prisma.A.create({ data }).then((e) => {
    	await prisma.B.delete({ where: { seq: e.seq } });
    });
    but delete API didn’t work even create was successed. can i get help with it?
    a
    f
    +2
    • 5
    • 31
  • j

    jruiseco

    09/22/2020, 2:45 PM
    anyone been able to apply migrations to Digital ocean managed database? Getting "sql_require_primary_key"
  • w

    Wade Tandy

    09/22/2020, 2:53 PM
    Seems like at least the last few versions of
    @prisma/engine-core
    depend on a version of the Undici module, but specifically reference a commit on github instead of a version packed in NPM. Our corp environment means we can't actually install prisma in our CI/CD pipelines because of this, as all dependencies must be on NPM. Seems the referenced commit is now in a mainline release of the undici module. Can this be changed to reference a versioned number?
    ✔️ 1
    j
    j
    • 3
    • 10
  • k

    KJReactor

    09/22/2020, 3:11 PM
    Is there any reason a simple
    prisma.[entity].findMany()
    command would cause an error,
    invalid invocation
    ? that basically all what the error says
    r
    • 2
    • 10
  • l

    lucas

    09/22/2020, 3:43 PM
    Hey there im using prisma with nexus someone know how to handle upload file ?
  • v

    Vegard Helland Flatoy

    09/22/2020, 10:01 PM
    Is there an easy way to change my database with prisma, after I’ve created it? Right now, If I want to add a new field like “age” to my User, I have to access my postgres instance, run SQL commands to change the table, and then introspect the database with prisma CLI.
    j
    r
    • 3
    • 4
  • j

    Justin Ellingwood

    09/23/2020, 2:52 PM
    Just a heads up: we just pushed a new article to Prisma's Data Guide: Using joins to combine data from different tables in PostgreSQL
    💯 3
    prisma green 4
  • n

    Natalia

    09/24/2020, 10:51 AM
    You can jump into the live coding session with Xiaoru Li (Leo, for short), Developer’s Success Advocate at Prisma, this Sunday at 6pm CEST! The session is called Building with Next.js and Prisma: Passwordless Authentication with next-auth.

    Tune in here▾

    !
    prisma green 8
    🚀 3
    📺 3
    prisma cool 4
    🦜 3
    💯 3
    n
    m
    t
    • 4
    • 3
  • m

    mikkelsl

    09/24/2020, 1:26 PM
    Does anyone know, is it possible to call a function inside a file? Something like:
    ts-node -func seed() ./scripts.ts
    ,
    ts-node -func clear() ./scripts.ts
    j
    • 2
    • 1
  • s

    stephan

    09/24/2020, 3:22 PM
    package.json ... { "scripts": { "run_me": prisma deploy --env-file src/env_files/.env.<ENV_ARGUMENT_FROM_CLI> } } i want to run ... yarn run_me local so the scripts runs - prisma deploy --env-file src/env_files/.env.local
    b
    • 2
    • 1
  • a

    Aaron Fulkerson

    09/24/2020, 8:49 PM
    I’m trying to use case-insensitive filter in Prisma but after enabling the preview feature in the schema, I’m getting an error when I attempt to add mode: ‘insensitive’ to any queries. Tried to regenerate the client but that didn’t help. “Unknown arg ‘mode’”
    n
    • 2
    • 3
  • k

    KJReactor

    09/25/2020, 1:03 PM
    how do I get Prisma to generate date for a createdAt field automatically? I had it before but stopped working
    r
    • 2
    • 2
  • r

    Roy

    09/25/2020, 1:45 PM
    Hi guys. Great work everyone at the prisma community. Love working with it! I am a frontend developer who want to learn data-modeling, with relational dbs. Now i am working on a learning project and this is my use case for a table tennis schema. We are playing table tennis on work and have different Leagues ( = A league is just a team of people playing each other). The question is: 1. How can I save one Game with two players and their score? 2. Feedback is welcome on my schema! This is the schema:
    Copy code
    model User {
      id            String   @id
      email         String   @unique
      createdAt     DateTime @default(now())
      updatedAt     DateTime @updatedAt
    
      profile Profile?
    }
    
    model Profile {
      id            String           @id @default(cuid())
      user          User?            @relation(fields: [userId], references: [id])
      userId        String?
      playedGames   PlayerInGame[]
      joinedLeagues PlayerInLeague[]
    }
    
    model League {
      id      String           @id @default(cuid())
      name    String           @unique
      games   Game[]
      players PlayerInLeague[]
    }
    
    model PlayerInLeague {
      id        String  @id @default(cuid())
      league    League  @relation(fields: [leagueId], references: [id])
      player    Profile @relation(fields: [profileId], references: [id])
      points    Int
      leagueId  String
      profileId String
    }
    
    model Game {
      id        Int      @id @default(autoincrement())
      createdAt DateTime @default(now())
      homePoints Int
      awayPoints Int
      league           League       @relation(fields: [leagueId], references: [id])
      leagueId         String
    
      // HERE I NEED TO KEEP TRACK OF PLAYERS and their statistics. Who won, how many point etc. 
    }
    
    model PlayerInGame {
      id        String  @id @default(cuid())
      game      Game    @relation(fields: [gameId], references: [id])
      player    Profile @relation(fields: [profileId], references: [id])
      gameId    Int
      profileId String  @unique
    }
    r
    • 2
    • 2
  • r

    Rashmi Bidanta

    09/25/2020, 2:01 PM
    Hi All, We are trying to do a fresh deploy of prisma1 in one of our new cloud region. ( our application is using Prisma1 thats why we have to stick with it). While trying to run
    prisma deploy --force --no-seed
    we are getting an error the complains about
    cluster$default
    Copy code
    ERROR: Project not found: 'cluster$default'
    24-Sep-2020 22:11:59	
    24-Sep-2020 22:11:59	{
    24-Sep-2020 22:11:59	  "errors": [
    24-Sep-2020 22:11:59	    {
    24-Sep-2020 22:11:59	      "message": "Project not found: 'cluster$default'",
    24-Sep-2020 22:11:59	      "code": 3016,
    24-Sep-2020 22:11:59	      "requestId": "local:ckfhqavwf0vkh0734eamd1bd0"
    24-Sep-2020 22:11:59	    }
    24-Sep-2020 22:11:59	  ],
    24-Sep-2020 22:11:59	  "status": 200
    24-Sep-2020 22:11:59	}
    would be helpful if some guidance is provided on this. We are on Prisma 1.30.5
    r
    • 2
    • 21
  • r

    Rashmi Bidanta

    09/25/2020, 4:29 PM
    Hi All, Now i am see the following error while trying to do a Prisma deploy using prisma 1.30.5 cli
    Copy code
    ERROR: Variable "$input" got invalid value {"workspaceSlug":null,"clusterName":"default","serviceName":"cxic-umbrella","stageName":"prod"}; Expected non-nullable type String! not to be null at value.workspaceSlug.
    
    {
      "errors": [
        {
          "message": "Variable \"$input\" got invalid value {\"workspaceSlug\":null,\"clusterName\":\"default\",\"serviceName\":\"cxic-umbrella\",\"stageName\":\"prod\"}; Expected non-nullable type String! not to be null at value.workspaceSlug.",
          "locations": [
            {
              "line": 2,
              "column": 17
            }
          ],
          "code": 222
        }
      ],
      "status": 400
    }
  • r

    Rashmi Bidanta

    09/25/2020, 4:29 PM
    not sure if i am missing anything in the prisma setup
  • o

    Oleg Zeltser

    09/25/2020, 5:24 PM
    Hi, I have a question about nested creates. Lets say I have 3 objects defined like that:
    Copy code
    model A {
     id Int @id
     b B[]
    }
    model B {
     id Int @id
     c C[]
    }
    model C {
     id Int @id
     text String
    }
  • o

    Oleg Zeltser

    09/25/2020, 5:30 PM
    And I have an object
    Copy code
    "A": {"id":10 { { "text": "Some text here"}}}
  • o

    Oleg Zeltser

    09/25/2020, 5:32 PM
    can I do
    prisma.a.update({wgere: id: 10}, data: {input_object})
    ?
  • o

    Oleg Zeltser

    09/25/2020, 5:32 PM
    Does it make sense at all?
  • o

    Oleg Zeltser

    09/25/2020, 5:45 PM
    Basically the question is how do I do nested inserts/updates when the nesting level is more than 1 deep?
    a
    r
    • 3
    • 6
  • r

    Rashmi Bidanta

    09/25/2020, 8:46 PM
    Hi All, trying to figure out if postgres12 is supported in primsa1
    r
    • 2
    • 1
  • i

    Ian Engelbrecht

    09/26/2020, 8:27 AM
    Great article at https://www.prisma.io/dataguide/database-tools/top-nodejs-orms-query-builders-and-database-libraries-in-2020. One feature I’m interested in though is not included - streaming support. I know Sequelize doesn’t support streaming, for example. It would add to the value of the article to indicate which ORMs, if any, support streaming in Node 😄
  • a

    Ashiqur Rahman

    09/26/2020, 1:27 PM
    whenever I change something in Prisma schema, I need to delete migration folder, delete volumes of docker. and re rerun the migrate command. This makes the development process very slow. How to get rid of this
    a
    r
    • 3
    • 2
  • e

    Enrico

    09/26/2020, 3:31 PM
    Are there plans to include condition checks for updating and creating? Atm I always have to use Update many to unsure a record is only updated when it has a certain state
    r
    • 2
    • 1
  • n

    Natalia

    09/28/2020, 1:55 PM
    👋 Join us at week’s events that are featuring or organised by Prisma: • September 29, 6:00PM CEST - GraphQL Berlin/Munich Meetup - livestream hosted by Prisma and commercetools

    on Youtube - tune in here▾

    ; • September 30, 6:30PM CEST - Wroclaw TypeScript Meetup - where Daniel Norman, Prisma’s Developer’s Advocate, will give a talk: Rapid and type-safe Node.js development with Prisma - more info and a link to tune in here; • October 1, 5PM CEST - What’s new in Prisma (v2.8.0) - 

    A livestream by Ryan Chenkie and Nikolas Burk▾

    Looking forward to having you there! 🤗
    prisma green 5
    💯 3
  • j

    Jarvis Prestidge

    09/28/2020, 2:50 PM
    Hey i'm reading this old prisma post about wrapping rest microservices in a graphql gateway: https://www.prisma.io/blog/how-to-wrap-a-rest-api-with-graphql-8bf3fb17547d I'm really interested in this last paragraph in particular:
    Wrapping REST APIs with GraphQL is probably one of the most exciting applications of GraphQL — and still in its infancy. The process explained in this article was entirely manual, the real interesting part is the idea of automating the different steps. Stay tuned for more content on that topic!
    If you’d like to explore this area yourself, you can already check out the graphql-binding-openapi package which allows to automatically generate GraphQL APIs (in the form of a GraphQL binding) based on a Swagger / Open API specification.
    Is there any advancements in auto-generated graphql gateways since, or and community agreement on the best practices etc? Any help super appreciated 🙂
  • f

    fondfolio

    09/28/2020, 8:59 PM
    Has anyone had issues with ordering when using
    findOne
    with relations fields? Our model specifically does not have a field which we can use to enforce order (via
    orderBy
    ), we just want the data read in the same order we wrote it the DB. Do we need to add an explicit order field to guarantee this order (this is what we are currently thinking of doing)? Thought we'd ask here in case anyone might have encountered this before, any help would be much appreciated, thanks! 😊
    r
    c
    • 3
    • 8
1...398399400...637Latest