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

    Pani Avula

    01/28/2021, 6:03 PM
    Checking through the updations to prisma roadmap https://pris.ly/roadmap. Any items in consideration for multi language client support like that of Rust/Python? Also any items for graduating golang version with features equivalent to that of javascript? The golang version not getting figured out in the roadmap provides a scary feeling of soon to be deprecated?
    r
    • 2
    • 2
  • ł

    Łukasz Usarz

    01/29/2021, 1:15 PM
    Good morning, I'm here encouraged by @Natalia. Welcome everyone! 🙂
    prisma rainbow 5
    👋 6
    💚 6
    n
    r
    +3
    • 6
    • 6
  • s

    Simon Knott

    01/29/2021, 1:55 PM
    Just curious: Is there something like a Prisma Schema -> ER Diagram tool?
    j
    • 2
    • 4
  • s

    stephen.pearl

    01/29/2021, 2:15 PM
    Per the Prisma Roadmap, are there any best practices or solutions for migrating during CI buiild/deploy steps (https://www.notion.so/Simplify-integrating-migrate-in-CI-CD-pipelines-bf0019b446cb45c783038a056dec9903)
    j
    j
    j
    • 4
    • 31
  • r

    Ron Mizrahi

    01/30/2021, 2:26 PM
    There are fellows here working with Prisma in production?
  • j

    Jijin P

    01/30/2021, 4:36 PM
    Hey Is there a way to perform this query? I want to update records that 'id' is in the id_lists array.
    Copy code
    await prisma.campaigns.update({
            where: {
                 id:{
                    includes: id_lists
                 }
            },
            data: {
                credits: {
                    decrement: 10000
                }
            }
        })
    r
    r
    • 3
    • 3
  • ł

    Łukasz Usarz

    01/31/2021, 8:53 AM
    Is there any plugin to Intellij/Webstorm with support for Prisma schema?
    j
    • 2
    • 1
  • p

    philip andrew

    01/31/2021, 11:09 AM
    I see that SqlLite can work in browser https://sql.js.org/#/ - can prisma client also work in browser to query SqlLite in browser?
    a
    r
    • 3
    • 4
  • p

    philip andrew

    01/31/2021, 12:10 PM
    hello
  • y

    Yassine

    01/31/2021, 1:40 PM
    Hey, how can i disable prisma regenerating after each npm install.
  • i

    iamclaytonray

    01/31/2021, 2:16 PM
    I’ve tried virtually everything to auto generate UUIDs and nothing has worked. In Postico, I’ve looked at the structure for the
    id
    column and the expression for uuid is not there. Any advice/direction would be appreciated
    n
    a
    • 3
    • 5
  • k

    Kyron

    01/31/2021, 5:59 PM
    Hey, all. I wanted to ask (before I put the effort into rolling my own solution) if anyone knows a good way to add role based security for prisma (any good libraries?)? For both find queries and where queries. For example "John has Manage_Group_A permissions, so any query they make on groups must be scoped to Group 'A'." They should be able to do
    { where: { group: { name: 'A' } } }
    and
    { where: { user: { id: 1 } } data: { groups: { connect: { name: 'A' } } } }
    for example, but outside of that, their query should either be overridden with their allowed filters, or guarded against
    s
    m
    • 3
    • 4
  • k

    Kyron

    01/31/2021, 6:00 PM
    I can't imagine the above is an uncommon scenario?
  • m

    Marcello

    01/31/2021, 7:55 PM
    I’m having an issue where it seems queries remove trailing zeroes after the decimal. I haven’t used GraphQL enough outside of Prisma to know where in the ecosystem the problem lies but it’s turning out to be a major pain point. Happens right in GraphQL playground as well, so shouldn’t be anything outside of Prisma causing this, any ideas or suggestions? Using a toFixed() everywhere a query is called on the frontend just doesn’t seem sustainable when we know we always want the returned value to be a specific format.
    k
    a
    • 3
    • 9
  • m

    Mykyta Machekhin

    01/31/2021, 10:14 PM
    UPD: problem solved. I completely forgot about the fact that from
    User
    this relation type is many to one. Therefore, there should be lists instead single values. Without this, prisma perceives this relation as one to one. What explains creating a unique index Hello. Seems to have found a bug in the prisma, but I’m not sure about that yet. Therefore, before creating an issue, I want to discuss here. The problem is that the prisma for some reason creates a unique index where it shouldn’t. As a result, I cannot insert duplicate values where they might be How to reproduce: In my case I have 2 models, which have three relations:
    Copy code
    model User {
      userId                Int              @id @default(autoincrement())
    
      creatorFor Task? @relation(name: "creator")
      illustratorFor Task? @relation(name: "illustrator")
      motionerFor Task? @relation(name: "motioner")
    }
    Copy code
    model Task {
      taskId Int @id @default(autoincrement())
      name String
    
      creator User @relation(fields: [creatorId], references: [userId], name: "creator")
      illustrator User? @relation(fields: [illustratorId], references: [userId], name: "illustrator")
      motioner User? @relation(fields: [motionerId], references: [userId], name: "motioner")
      creatorId Int
      illustratorId Int?
      motionerId Int?
    }
    When 2 models are linked by more than 1 relations, the prisma requires you to create names for them in the parent entity, therefore the user has 3 last lines In this example, I do not need the creator, illustrator, and motion designer to be unique in the task model. However, here’s what I see in the migration:
    Copy code
    -- CreateIndex
    CREATE UNIQUE INDEX "Task_creatorId_unique" ON "Task"("creatorId");
    
    -- CreateIndex
    CREATE UNIQUE INDEX "Task_illustratorId_unique" ON "Task"("illustratorId");
    
    -- CreateIndex
    CREATE UNIQUE INDEX "Task_motionerId_unique" ON "Task"("motionerId");
    I can’t explain it, and I don’t know what to do with it other than manual editing of migrations
    r
    • 2
    • 3
  • b

    beeman

    02/01/2021, 10:39 PM
    I’m looking for a quick and scriptable way to sync 2 Postgres databases. I’ve been doing a dump and import, but it’s not at all straightforward and I would love it if I could just point a source and target database url and have it figure out the rest. I’m curious if someone knows something like that
    j
    • 2
    • 2
  • j

    Jarid Margolin

    02/01/2021, 11:31 PM
    @weakky and team - I’ve been trying to determine how to best organize domain logic when using Prisma. I landed on
    <https://github.com/prisma/ent>
    but it doesn’t appear there has been any effort to push it forward. Have better patterns emerged? Seems like there could be a useful abstraction here, but perhaps I have the wrong mental model of how I should be utilizing Prisma.
    👀 1
  • i

    ibash

    02/02/2021, 4:35 AM
    Hi everyone
  • i

    ibash

    02/02/2021, 4:36 AM
    I’m curious what graphql client you’re using (for the web) — specifically looking for something: 1. Simple 2. Reliable This rules out apollo IMO, what else you got?
    j
    r
    • 3
    • 5
  • m

    Manthan Mallikarjun

    02/02/2021, 9:17 AM
    Is there a way to pass a custom
    pg
    instance to prisma?
    r
    o
    • 3
    • 10
  • j

    Jamey Nakama

    02/03/2021, 12:25 AM
    Hey there. Using the classic User and Post one-to-many relationship, how would you go about returning the objects or at least IDs of posts related to each user at the API level? The prisma client doesn’t seem to return that information itself. I can’t find anything about custom serializers in the docs.
    j
    • 2
    • 2
  • m

    Manthan Mallikarjun

    02/03/2021, 2:07 AM
    Is there an
    upsertMany
    ?
    r
    • 2
    • 1
  • m

    Martïn

    02/03/2021, 2:47 AM
    Hey there. Is it currently possible to set some sort of "expiry" time on data entries in PostgreSQL using Prisma? I'm thinking about something equivalent to EXPIRE in Redis. I'm not looking to store a timestamp and then manually code some sort of cron job to check what entries have expired. Though using TRIGGERS will do the trick. I really think Prisma should provide this sort of functionality, and should be in the roadmap as a feature for future releases. E.g.
    model Coupon {
    id String @id @default(cuid())
    code String @unique @expire(after: ‘60s’)
    profileId String @unique
    ...
    }
    So
    code
    expires and row is deleted from the DB after 60s
    r
    • 2
    • 2
  • m

    Martïn

    02/03/2021, 11:01 AM
    [Prisma Studio]:
    The preview feature \"createMany\" is not known. Expected one of: nativeTypes, microsoftSqlServer, groupBy\n
    Created an issue createMany (preview flag) crashes Prisma Studio (Windows): https://github.com/prisma/studio/issues/623
    🙌 1
    j
    • 2
    • 1
  • h

    Henry

    02/03/2021, 12:48 PM
    Hello Prisma Community, I’m Henry, a part of a small team building a new CI tool that’s built for faster deployments. https://delta-ci.com We’re using bare metal servers over the cloud to provide more processing power in combination with performance techniques. We’re looking for beta testers to try out our platform, if you’re interested, send me a DM or enter your details on the form on the website. We’ll also be free for OSS,. Any questions, let me know. Henry
    👍 1
    j
    • 2
    • 3
  • p

    Pitakun

    02/03/2021, 2:52 PM
    Hi, I have been following this tutorial . It uses apollo-server & prisma. Im trying to deploy it to netlify as a serverless solution. I'm trying to use apollo-server-lambda but running
    Copy code
    netlify-lambda serve src //npm command that serves the folder containing my index.js
    
    //index.js
    const { ApolloServer } = require('apollo-server-lambda')
    const fs = require('fs')
    const path = require('path')
    const { PrismaClient } = require('@prisma/client')
    const { getUserId } = require('./utils.js')
    const Query = require('./resolvers/Query')
    const Mutation = require('./resolvers/Mutation')
    const User = require('./resolvers/User')
    const Link = require('./resolvers/Link')
    const Vote = require('./resolvers/Vote')
    const { PubSub } = require('apollo-server-lambda')
    const Subscription = require('./resolvers/Subscription')
    
    const resolvers = {
      Query,
      Mutation,
      User,
      Link,
      Subscription,
      Vote
    }
    
    const pubsub = new PubSub()
    const prisma = new PrismaClient()
    
    const server = new ApolloServer({
      typeDefs: fs.readFileSync(
        path.join(__dirname, 'schema.graphql'),
        'utf8'
      ),
      resolvers,
      context: ({ req }) => {
        return {
          ...req,
          prisma,
          pubsub,
          userId:
            req && req.headers.authorization
              ? getUserId(req)
              : null
        }
      }
    })
    
    exports.handler = server.createHandler();
    but fails with
    Copy code
    netlify-lambda: Starting server
    
    .../node_modules/toml/lib/parser.js:3833
          throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);
          ^
    [SyntaxError: Expected "'", "'''", "+", "-", "[", "\"", "\"\"\"", "_", "false", "true", "{", [ \t] or [0-9] but "=" found.] {
    Not sure what to do to fix this. Please help me 🙏
  • s

    Sébastien Dubois

    02/03/2021, 3:09 PM
    Hello everyone
  • s

    Sébastien Dubois

    02/03/2021, 3:10 PM
    I'm curious, anyone here developing GraphQL APIs together with Prisma & Next.js?
    h
    m
    p
    • 4
    • 27
  • n

    Natalia

    02/03/2021, 3:29 PM
    In 1,5 hours we'll be hosting a free online meetup for GraphQL Beginners. graphql We have two wonderful talks prepared (by @Vignesh T.V. and @stephan), a quiz where you can win swag and the "Learning GraphQL" book 🎁 and a live interview with Dominik Kress about some challenges that new GraphQL users could face.

    You can set up a YouTube reminder here▾

    . See you there! 🤗
    prisma cool 3
    😀 3
    fast parrot 5
    graphql 3
    prisma green 3
    prisma rainbow 3
    • 1
    • 1
  • r

    Rashmi Bidanta

    02/03/2021, 4:10 PM
    We are seeing a problem where the prisma deploy is trying to create the stage again even though the stage already exists. This happens during our deployment process. Here is the error we are seeing
    Copy code
    Creating stage prod for service service-name... !
    error	03-Feb-2021 08:12:09	
    error	03-Feb-2021 08:12:09	ERROR: Service with name 'service-name' and stage 'prod' already exists
    error	03-Feb-2021 08:12:09	
    error	03-Feb-2021 08:12:09	{
    error	03-Feb-2021 08:12:09	  "data": {
    error	03-Feb-2021 08:12:09	    "addProject": null
    error	03-Feb-2021 08:12:09	  },
    error	03-Feb-2021 08:12:09	  "errors": [
    error	03-Feb-2021 08:12:09	    {
    error	03-Feb-2021 08:12:09	      "locations": [
    error	03-Feb-2021 08:12:09	        {
    error	03-Feb-2021 08:12:09	          "line": 2,
    error	03-Feb-2021 08:12:09	          "column": 9
    error	03-Feb-2021 08:12:09	        }
    error	03-Feb-2021 08:12:09	      ],
    error	03-Feb-2021 08:12:09	      "path": [
    error	03-Feb-2021 08:12:09	        "addProject"
    error	03-Feb-2021 08:12:09	      ],
    error	03-Feb-2021 08:12:09	      "code": 4005,
    error	03-Feb-2021 08:12:09	      "message": "Service with name 'service-name' and stage 'prod' already exists",
    error	03-Feb-2021 08:12:09	      "requestId": "local:ckkpkke6206ih08004ib5c5zx"
    error	03-Feb-2021 08:12:09	    }
    error	03-Feb-2021 08:12:09	  ],
    error	03-Feb-2021 08:12:09	  "status": 200
    error	03-Feb-2021 08:12:09	}
    any help on this would be really great
    r
    • 2
    • 14
1...414415416...637Latest