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

    Momin

    07/13/2020, 3:24 AM
    Hello
  • m

    Momin

    07/13/2020, 3:24 AM
    Everyone
  • m

    Momin

    07/13/2020, 3:24 AM
    I'm Momin from Dhaka Bangladesh
  • m

    Momin

    07/13/2020, 3:25 AM
    Good morning šŸŒž @everyone
  • n

    Naimur Rahman

    07/13/2020, 3:29 AM
    Hi @Momin I’m also from Dhaka Bangladesh
  • m

    Momin

    07/13/2020, 3:30 AM
    Great @Naimur Rahman
  • m

    Momin

    07/13/2020, 3:30 AM
    Good to know
    šŸŽ‰ 2
  • m

    Momin

    07/13/2020, 3:30 AM
    Connect with me @Naimur Rahman Facebook
  • m

    Momin

    07/13/2020, 3:31 AM
    Facebook/mominriyadh
  • n

    Naimur Rahman

    07/13/2020, 3:31 AM
    Okay brother.
  • m

    Momin

    07/13/2020, 3:31 AM
    Where do you live in Dhaka
  • m

    Momin

    07/13/2020, 3:31 AM
    ?
  • n

    Naimur Rahman

    07/13/2020, 3:31 AM
    I live in Khilkhet, Nikunja-2. You?
    n
    • 2
    • 2
  • k

    kitze

    07/13/2020, 11:55 AM
    I have an array of strings (Prisma 1) and I want to push a string in it, but the only available method is
    set
    . Is there a way to push a string in the array without querying the strings that are already there?
    r
    • 2
    • 1
  • c

    Corey Snyder

    07/13/2020, 6:01 PM
    I was just watching some of the Prisma Day videos and had a question. It was mentioned that you can update your Prisma Schema directly to change a
    User
    relationship to the name
    Author
    on
    Posts
    . My question is, if you do this, and then re-run an introspection, will it blow away your changes? Or does it do a diff and intelligently update the schema file?
    j
    • 2
    • 2
  • s

    SureDroid

    07/13/2020, 9:34 PM
    Hey guys, has anyone used prisma migrations with docker or inside a private network? I'm wondering what would be the best way to apply migrations. Maybe its possible to check if there is a new migration and apply it on startup?
    r
    • 2
    • 1
  • s

    SureDroid

    07/13/2020, 9:57 PM
    This also opens the question, how do you do migrations on different services that use the same schema and db?
    r
    • 2
    • 3
  • r

    rebaza951

    07/13/2020, 10:27 PM
    Hi guys, Thans for let me in, Im so happy for being here.
  • r

    rebaza951

    07/13/2020, 10:32 PM
    Guys, I'm implementing prisma server in an existing project, I'v being working around one week, I've read documentation but I can't expose the data from my Aws RDS. can anybody help me. thanks in advance.
    r
    • 2
    • 13
  • a

    Alvin Khaled

    07/14/2020, 3:23 AM
    Is there an example of using prisma with the connection plugin (https://nexus.js.org/docs/plugin-connection)?
  • j

    Jonathan Romano

    07/15/2020, 3:35 AM
    Is there a list anywhere of notable projects/companies using Prisma? I’m considering it for our upcoming backend rewrite, but to be honest it’s relative newness gives me pause, compared to namely Django which is quite mature, battle tested, and relied on by many
    prisma cool 1
    r
    n
    • 3
    • 3
  • d

    Darryl

    07/15/2020, 7:45 AM
    Thanks for the stickers, Prisma team! šŸ™
    fast parrot 5
    prisma cool 3
  • y

    yourethejudge

    07/15/2020, 8:55 AM
    Hi, just wondering if anyone else is experiencing any problems with creating new servers using Prisma.io? I've been getting a "GraphQL error" saying I provided invalid credentials whenever I try to spin up a database and a server using the Heroku integration.
  • s

    stephan

    07/15/2020, 9:16 AM
    hi, how do i implement the aggregate/sum ?
    n
    • 2
    • 2
  • d

    Dmitri Pisarev

    07/15/2020, 3:06 PM
    Hey, if any of ya could give a quick hint on this I'd greatly appreciate it! OR is driving me mad https://github.com/prisma/prisma/discussions/3030
    n
    • 2
    • 13
  • j

    Jonathan Romano

    07/15/2020, 6:34 PM
    Do the executeRaw and queryRaw template tags escape/sanitize the interpolated variables? I’d assume so, but I just want to check
    r
    • 2
    • 1
  • d

    Daniel

    07/16/2020, 6:16 AM
    Hey! Sorry for bothering you guys, but i was hoping to find some help here. I am using PostgreSQL in combination with Prisma2 and i am trying to cascade delete. What i found on google was that i need to cascade on database level - unlike in prisma1. My Table looks as follows
    Copy code
    CREATE TABLE presets (
        id SERIAL PRIMARY KEY,
        uid character(5) NOT NULL REFERENCES tokens(uid) ON DELETE CASCADE,
        deviceid integer NOT NULL,
        data jsonb NOT NULL,
        synced smallint NOT NULL DEFAULT 0,
        isdeleted boolean NOT NULL DEFAULT false,
        lfid integer,
        error jsonb
    );
    Now when i am trying to delete a row on said
    tokens
    table
    Copy code
    await prisma.tokens.delete({
    	where: {
    		uid
    	}
    });
    it gives me an violation error
    Copy code
    Invalid `prisma.tokens.delete()` invocation in
    path/dist/data.js:314:84
    
    
      The change you are trying to make would violate the required relation 'tokens' between the `presets` and `tokens` models.
        at PrismaClientFetcher.request (path/node_modules/@prisma/client/runtime/index.js:1:185690)
        at process._tickCallback (internal/process/next_tick.js:68:7)
      code: 'P2014',
      meta:
       { relation_name: 'tokens',
         model_a_name: 'presets',
         model_b_name: 'tokens' } }
    I am quite confused on what i am doing wrong, any tips appreciated.
    d
    r
    • 3
    • 3
  • m

    Mohammed alreai

    07/16/2020, 8:25 AM
    hi there I have a problem in Prisma 1 when I run script deploy as "deploy":Ā "prismaĀ deployĀ --env-fileĀ .env" in package.json the are some error ERROR: graphqwith%20prisma is an invalid service name. It must be less than 140 characters and can only contain alphanumeric characters and -.
    r
    • 2
    • 10
  • j

    Jonathan

    07/16/2020, 10:11 AM
    Hi folks, I have a general question regarding the nr of database calls when using prisma in a graphql app (Nexus schema based). Are there strategies or so for accomplishing Scenario 1 in the following example in a clean way:
    Copy code
    # Scenario 1: Do a single Prisma call on Posts-level (Level A)
    {
        posts { # <-- Level A: Do a single prisma.many call, and actually include all users, profilePictures, with all of their
            users { # <-- Level Bā“On the user-resolver, do we then have to do a superfluous another call (even if level A already got all of their info?)
                name
                title
                birthDate
                derivedNrOfFriends
                profilePictures {  # <-- Level C ā“On the profilePictures resolver, do we do a call even if the posts already included everything necessary?
                    ...etc
                }
                friends {
    
                }
            }
        } 
    }
    
    # Scenario 2: Do multiple Prisma call on each resolver (Level A, Level B, Level C)
    {
        posts { # <-- Level A: Do a prisma.many call, only include post fields
            users { # <-- Level Bā“Do a prisma.many call, only include user fields, use optionally parent.id to scope on posts
                name
                title
                birthDate
                derivedNrOfFriends
                profilePictures {  # <-- Level C. Do a prisma.many on profilePictures resolver level, use optionally parent.id to scope on users
                    ...etc
                }
                friends {
    
                }
            }
        }    
    }
    r
    • 2
    • 7
  • s

    Suhail

    07/16/2020, 12:22 PM
    I am getting an error while doing
    prisma deploy
    . The error says
    You are updating the field _permissions_ to be required. But there are already nodes for the model _User_ that would violate that constraint
    What does this really mean? Here is how my
    user
    model looks like:
    Copy code
    type User {
      id: ID! @id
      email: String @unique
      firstName: String!
      lastName: String!
      isActive: Boolean! @default(value: true)
      isVerified: Boolean! @default(value: false)
      isUsingSystemPassword: Boolean! @default(value: true)
      userType: UserType @default(value:Admin)
      password: Password! @relation(name: "UserPassword", onDelete: CASCADE)
      projects: [Project] @relation(name:"UserProjects", onDelete: CASCADE)
      productFeedback: [ProductFeedback] @relation(name: "ProductFeedback")
      permissions: Permissions! @relation(name: "UserPermissions", onDelete: CASCADE)
      createdBy: UserCreationMap! @relation(name: "CreationMap", onDelete: CASCADE)
    }
    and how my
    Permissions
    models looks like
    Copy code
    type Permissions {
        id: ID! @id
        createUser: Boolean! @default(value: false)
        editUser: Boolean! @default(value: false)
        deleteUser: Boolean! @default(value: false)
        viewAllUsers: Boolean! @default(value: false)
        userId: User @relation(link: INLINE, name: "UserPermissions")
    }
    d
    r
    • 3
    • 3
1...386387388...637Latest