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

    Alan William Duarte

    07/04/2020, 4:03 PM
    Hello guys
  • a

    Alan William Duarte

    07/04/2020, 4:06 PM
    does anyone knows if prisma can be run on the client side? i would like to use this in a electron project and store the database locally
    j
    r
    r
    • 4
    • 7
  • s

    stephan

    07/05/2020, 8:11 AM
    is there a way to set a non primitive field as unique ?
    r
    • 2
    • 9
  • l

    Logan Lee

    07/06/2020, 12:36 AM
    playground is keeping refer ‘default@default’ i know that’s the default setting of playground. How can i change to ‘stastica@stastica’?
    r
    • 2
    • 6
  • l

    Logan Lee

    07/06/2020, 12:37 AM
    and where is the image of prisma2 or above 1.34 in docker-hub?
  • s

    stephan

    07/06/2020, 7:03 AM
    is there a way to set a non primitive field as unique ?
  • p

    Parthasarathy Ramanujam

    07/07/2020, 10:26 AM
    Hello, I am trying to setup a prisma server on Amazon ECS, any idea how to provide the prism config? I have tried setting these as both string and regular map, I end up with exceptions on both occassions.
    r
    • 2
    • 2
  • p

    Parthasarathy Ramanujam

    07/07/2020, 10:26 AM
    Is there any recommended method to get Prisma working under Amazon Fargate ECS?
  • t

    Troy

    07/07/2020, 9:14 PM
    Hi! Does anyone know if it is possible to have an optional
    connect
    field on a mutation? I have a datamodel with "Items" that can optionally be contained in "Lists":
    datamodel.prisma
    :
    Copy code
    type Item {
     id: ID!
     name: String
     lists: [List]
    }
    
    type List {
     id: ID!
     name: String
     items: [Item]
    }
    with the following frontend `schema.graphql`:
    Copy code
    # import * from './generated/prisma.graphql'
    type Mutation {
      createItem(name: String, lists: ListCreateManyWithoutItemsInput): Item!
    }
    I set up a mutation as follows in the react component: `NewItem.js`:
    Copy code
    const CREATE_ITEM = gql`
      mutation CREATE_ITEM(
        $name: String
        $listID: ID
      ) {
        createItem(
          name: $name
          lists: { connect: { id: $listID } } 
        ) {
          id
        }
      }
    `;
    I would expect that I don't have to pass a
    listID
    but when I try to use that mutation with only a name param I get the following error which makes me think it always expects me to pass a listID?
    Copy code
    [GraphQL error]: Message: You provided an invalid argument for the where selector on List. Please provide exactly one unique field and value., Location: , Path: createItem
    r
    • 2
    • 4
  • o

    ojschwa

    07/08/2020, 7:11 AM
    If you're running a postgres instance, is it a bad idea to have multiple databases on the same instances for different environments (prod/staging)?
    r
    • 2
    • 4
  • s

    Sohail Haider

    07/08/2020, 8:22 AM
    I have
    javascript-client
    client generated in via docker
    prismagraphql/prisma:1.34
    , I'm trying perform or operation like
    prisma.posts({where: {OR:[...filters]} })
    but unable to find any OR field. I have AND field generated and exported though. Any Community help highly appreciated.
    r
    f
    • 3
    • 26
  • k

    khareta

    07/08/2020, 12:17 PM
    Hello, what would happen if you change a field from name relation to inline relation? (will it make underlying changes/fixes ??) (does the named relation create an underlying table??) (edited)
  • j

    Jonathan Romano

    07/08/2020, 2:33 PM
    Is there any info available on when the before and after scripts in migrate will be functional? I gave it a try last night and it looked like they were detected, but not run
    r
    • 2
    • 2
  • p

    Parthasarathy Ramanujam

    07/08/2020, 4:06 PM
    How do I access mongodb from prisma schema? The example provided here in documentation shows only postgres, mysql and sqllite: https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/data-sources/
    k
    j
    • 3
    • 9
  • p

    Parthasarathy Ramanujam

    07/08/2020, 4:07 PM
    however the link to documentation on this article doesnt seem to exist: https://www.prisma.io/blog/mongodb-preview-ow4wahkekaep
  • s

    Stefan Trivuncic

    07/08/2020, 7:43 PM
    Has anyone else had a ssl issue with testing a
    postgreSQL
    database via
    Heroku
    and
    Jest
    with
    nexus
    ? I followed the documentation here and provided the correct database credentials: https://nexusjs.org/guides/testing#with-a-database But I get this error:
    Copy code
    FAIL  tests/Mutation.test.ts
      ● Test suite failed to run
    
        error: no pg_hba.conf entry for host "70.80.32.135", user "rhrzlrzgvrssea", database "test", SSL off
    
          at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:325:11)
          at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:154:21)
          at Parser.parse (node_modules/pg-protocol/src/parser.ts:106:30)
          at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)
    
    Test Suites: 1 failed, 1 total
    Tests:       0 total
    Snapshots:   0 total
    Time:        1.693 s
    Ran all test suites.
    npm ERR! Test failed.  See above for more details.
    There is an open issue here: https://github.com/facebook/jest/issues/8449 and I have already tried passing in
    ssl=true
    into the connection url but this creates this issue:
    Copy code
    FAIL  tests/Mutation.test.ts
      ● Test suite failed to run
    
        self signed certificate
    
    
    
    Test Suites: 1 failed, 1 total
    Tests:       0 total
    Snapshots:   0 total
    Time:        1.711 s
    Ran all test suites.
    npm ERR! Test failed.  See above for more details.
  • d

    Donte

    07/08/2020, 11:13 PM
    Is any one having trouble running ‘npx prisma introspect ‘? When I run this, it prompts me to add in my Postgres info but when I do this I get a error: “node:72093) DeprecationWarining: OutgoingMessage.prototype._headers is deprecated
    r
    • 2
    • 1
  • g

    gamsterx

    07/08/2020, 11:14 PM
    Hi everybody, has anybody experience with electron? I`m trying to develop a desktop app. I use prisma (2.2.0) with sqlite in the main process of the app. Everything works fine, until I try to build the app for production. I get an error message that the module '.prisma/client' cannot be found. I have the the prisma npm packages inside my package.json dependencies so that electron builder can bundle the packages. Does anybody have tips? Cheers
    r
    • 2
    • 2
  • d

    DeanMo

    07/10/2020, 1:42 PM
    Not sure if a strange request, or if okay to ask, but I am looking for another person or even a few who are semi new to development but have enough experience to work their way through stuff. Currently myself, I am having more mental roadblocks than anything, and where I live theres nobody nearby to communicate with. None of my online friends are into development of any type, and its a bit helpless feeling working through most of this alone. Would love to just chat and bounce ideas or questions off each other and help through tasks at hand. Something akin to a little study group or something, dont really know. Just hard tackling all this alone and really want to learn this. Mainly working with vue, prisma, nexus and graphql. Have more experience with nestJS than nexus, and that is where I am having some problems mostly. Switching from nestjs and just postgres, over to nexus with graphql. Do not know enough of the overall "layout" I guess of a proper project and trying to learn best practices has been a bit rough. Respond here or message me if interested, thanks for checking this out. Can delete if inappropriate.
    🙌 1
    👍 1
  • s

    shilpa mittal

    07/10/2020, 4:27 PM
    Hi Team, I am new to prisma and exploring it . I have deployed Prisma and tried to run the mutation on playground but getting below error { "data": null, "errors": [ { "message": "Only absolute URLs are supported", "locations": [ { "line": 2, "column": 3 } ], "path": [ "post" ] } ] } Not sure what I am missing. I did check prisma.yml and I did not find endpoint defined. My yml file looks like - # Specifies the HTTP endpoint of your Prisma API. endpoint: '' # Defines your models, each model is mapped to the database as a table. datamodel: datamodel.prisma # Specifies the language and directory for the  generated Prisma client. generate:   - generator: javascript-client     output: ../src/generated/prisma-client # Ensures Prisma client is re-generated after a datamodel change. hooks:   post-deploy:     - prisma generate
    r
    • 2
    • 6
  • s

    shilpa mittal

    07/10/2020, 4:29 PM
    Need help to get this resolved
  • s

    shilpa mittal

    07/10/2020, 4:30 PM
    should I manually define the endpoint?
  • r

    Rudi Yardley

    07/10/2020, 8:49 PM
    Are there any plans to provide imperative queries to prisma migrate? It would be nice if I wanted to split a
    name
    field to
    first_name
    and
    last_name
    to be able to run a script that updated the data on migrate. Or is this not a recommended practice? Is there a discussion anywhere on this?
    r
    • 2
    • 1
  • a

    Ashiqur Rahman

    07/11/2020, 11:59 AM
    Copy code
    if (testUser.roles.includes('ADMIN')) {
          return prisma.user.findMany({
            take,
            skip,
            include: { posts: true },
            where: { roles: 'USER' },
          });
        }
    How can I filter
    roles
    property in where selector. [roles is an array]
    s
    • 2
    • 1
  • j

    Joseph

    07/12/2020, 1:53 AM
    Anyone else using Prisma Cloud and have services that are inaccessible? I'm getting 503's from trying to deploy my new schema
    r
    • 2
    • 2
  • c

    CCBCodeMonkey

    07/12/2020, 3:17 AM
    hey I am running into an issue with Prisma(I am on Prisma 1) that I don't really know how to solve, I have a scheduled job that needs to go through all of my rows in my tables and update values throughout the day, but as my rows have been growing this means I end up with 1000s of queries, and as I get up to around that number the batched graphql client just fails with an internal server error
  • c

    CCBCodeMonkey

    07/12/2020, 3:18 AM
    I have tried wrapping the calls with something like npm bottleneck, but it still seems that Prisma tries to batch them together
  • c

    CCBCodeMonkey

    07/12/2020, 3:19 AM
    what is the reccomended way of dealing with this scenario? would it do me any good to migrate to Prisma 2?
  • c

    CCBCodeMonkey

    07/12/2020, 3:20 AM
    seems like the batching gets handed off to the java layer so I can't seem to bottleneck it in node
    r
    • 2
    • 4
  • b

    Ben

    07/13/2020, 1:20 AM
    Not sure if this has been addressed yet, but I thought it would be worth bringing up: VSCode intellisense is not working properly when trying to access “prisma” from the context. For instance, when I type “ctx.” prisma is not an option. I, an intellectual, know that it should be an option so I type it anyway. Once, the full line has been typed out, if you go to the next line and start to type it again, “prisma” will be there. So it seems it can’t find it at first until you type it manually, but once you type it manually then who cares if it shows up later. My guess is this is a VSCode issue, but I wanted to post it here in case anyone else ran into it or knows how to fix it.
    r
    r
    • 3
    • 14
1...385386387...637Latest