https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-client
  • t

    timothé david

    08/03/2021, 7:52 PM
    thanks
  • t

    timothé david

    08/03/2021, 7:53 PM
    i use prisma 2.28
  • t

    timothé david

    08/03/2021, 7:53 PM
    Copy code
    prisma               : 2.28.0
    @prisma/client       : 2.28.0
    Current platform     : debian-openssl-1.1.x
    Query Engine         : query-engine 89facabd0366f63911d089156a7a70125bfbcd27 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
    Migration Engine     : migration-engine-cli 89facabd0366f63911d089156a7a70125bfbcd27 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
    Introspection Engine : introspection-core 89facabd0366f63911d089156a7a70125bfbcd27 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
    Format Binary        : prisma-fmt 89facabd0366f63911d089156a7a70125bfbcd27 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
    Default Engines Hash : 89facabd0366f63911d089156a7a70125bfbcd27
    Studio               : 0.417.0
  • t

    timothé david

    08/03/2021, 7:58 PM
    i am on ubuntu 21.04
  • t

    timothé david

    08/03/2021, 8:00 PM
    also you have a dependencies : fsevent which is skipping ....
  • t

    Tanmay Naik

    08/08/2021, 6:28 AM
    My migration keeps failing with this error
    Copy code
    Error: Database error
    11:57:09.507  	Error querying the database: db error: ERROR: current transaction is aborted, commands ignored until end of transaction block
    Any direction to solve this would be very helpful!
  • m

    Mischa

    08/09/2021, 6:44 PM
    I have managed to create a reusable CDK construct for generating a shared lambda layer with prisma dependencies and your generated client to share between all of your lambda functions: https://github.com/jetbridge/jetkit-cdk/pull/21 If you are using Lambda and Prisma this should be really nice for you
  • n

    Nico Domino

    08/15/2021, 4:23 PM
    Hey yall, quick question about many to many relations. So I'm in the middle of refactoring an older next.js app and bringing everything up to speed and decided to use prisma on top of our postgres db instead of hand crafting sql statements in next api routes haha. Anyway, there's a many to many relationship where we didn't normalize the db correctly and implemented the relationship from table1 to table2 via a field in table1 which contained a comma separated list of IDs of table2 rows. We would query this field in db query1, parse it, and loop over the ids querying them individually and returning the resulting mess from the api route 🤦‍♂️😂 So I got that converted a real Int Array in postgres now, but the prisma-client is panicking and crashing anytime I findMany in table1 and include table2. I have setup the relationship in the schema file like any other simple one, except for that the
    @relation (fields:..
    Part refers to the newly refactored
    Int[]
    field. I guess my question is, is this even possible in Prisma? I've looked through the docs many times and only found reference to traditional many-to-many relationships with an intermediate table
    r
    • 2
    • 2
  • t

    Tyler Matteo

    08/16/2021, 3:17 AM
    Hey, odd question here, but is there a way to build a query with the client but return the SQL that would be executed instead of executing the query right away? I'm working with a library that expects a string of sql but would like to leverage prisma client if possible.
    r
    d
    j
    • 4
    • 4
  • a

    Alex

    08/17/2021, 1:39 AM
    is there an example of how to check if a record exists in the database with Prisma client V2 (v2.29.1) with a field other than `id`*?*
    t
    • 2
    • 2
  • j

    james tan

    08/17/2021, 9:20 AM
    hi, wondering how do i cast a variable from any to Model that i could retrieve the relationship from the original query? i have a streaming function that return the model, but it becomes unknown type
    r
    • 2
    • 3
  • m

    Mischa

    08/24/2021, 11:39 AM
    is it possible to have two different clients? I want to write a data migration between two databases
    r
    p
    • 3
    • 17
  • b

    Brian Anglin

    08/25/2021, 8:18 PM
    👋 I've seen a bunch of issues reference performance and latency. Just wanted to share what I've encountered and see what the best way to provide this feedback is. TL;DR enabling
    napi
    cut our p95 latency of a hot endpoint from ~800ms to around ~200ms.
    We're going to add actual caching to speed this up even more but was really scratching my head as to why performance was so poor for what felt like relatively light queries. This seemed to be like a pretty easy fix 🤷
    👍 3
    💯 5
    c
    • 2
    • 5
  • p

    Pieter

    08/26/2021, 12:56 PM
    Hi, is there a way to check the available keys on a model at runtime? We'd like to have a dropdown/select render a list of all keys on a given model so we can specify permissions on specific fields
    r
    j
    • 3
    • 20
  • a

    Andre Landgraf

    08/27/2021, 2:10 PM
    I found this PR in progress #3259 [WIP] Fix mongo count query but without any other description to it. I am on 2.30.0. Is
    _count
    currently broken for mongodb? It does not work for me, I just want to confirm, it’s not my query but a general problem? 🙂
    r
    • 2
    • 5
  • a

    Alex

    08/28/2021, 3:13 AM
    does prisma currently support removing item(s) from scalar lists? i only see adding item(s) to scalar lists right now in the docs
    r
    • 2
    • 1
  • a

    Andre Landgraf

    08/28/2021, 6:38 PM
    Maybe a follow up question regarding my _count issue. Is the preview feature selectRelationCount supported in combination with mongodb?
  • m

    Mischa

    08/29/2021, 10:43 AM
    continuing my adventures in bundling prisma (and prisma-appsync) clients+libs into a shared lambda layer with CDK: https://github.com/jetbridge/jetkit-cdk/pull/24
  • m

    Mischa

    08/29/2021, 10:44 AM
    i got all sorts of weird path errors trying to run
    npx prisma generate
    with the appsync plugin in the docker environment
  • k

    Kyle (TechSquidTV)

    08/29/2021, 5:32 PM
    Hey folks. Trying out prisma again, following a tutorial here. I'm having an issue with creating an entry. In my schema.graphql file:
    Copy code
    type T_User {
      id: ID!
      name: String!
      email: String
      oauth_token: String
      oauth_token_secret: String
    }
    
    input New_T_User {
      name: String!
      email: String
      oauth_token: String
      oauth_token_secret: String
    }
    ...
    type mutation {
      create_t_user(input: New_T_User!): T_User!
      update_t_user(input: Update_T_User): T_User
      delete_t_user(id: ID!): T_User
    }
    Now, I am creating the function which will create a new user but I am running into this typing issue. This comes from the area of the tutorial headed with
    Adding post service
    Copy code
    // Create a new user
      async createUser(newUser: New_T_User): Promise<T_User> {
        return this.prisma.t_user.create({
          data: newUser
        })
      }
    data
    here is reporting an error as
    New_T_User
    is not assignable. full error:
    Copy code
    Type 'New_T_User' is not assignable to type '(Without<t_userCreateInput, t_userUncheckedCreateInput> & t_userUncheckedCreateInput) | (Without<...> & t_userCreateInput)'.
      Type 'New_T_User' is not assignable to type 'Without<t_userUncheckedCreateInput, t_userCreateInput> & t_userCreateInput'.
        Type 'New_T_User' is not assignable to type 't_userCreateInput'.
          Property 'email' is optional in type 'New_T_User' but required in type 't_userCreateInput'.ts(2322)
    So here we see that
    email
    is optional in
    New_T_User
    , which, is expected. But it is somehow required in
    't_userCreateInput'.ts
    < im not sure exactly where this file is But I assume it comes from the generated prisma client. In my generated graphql.js file we can see email is an optional and nullable string
    Copy code
    export class New_T_User {
        id: string;
        name: string;
        email?: Nullable<string>;
    }
    Any help is appreciated thank you.
    r
    • 2
    • 1
  • n

    Nditah Samweld

    08/31/2021, 7:40 AM
    Hi Everyone. I am having this message this morning
    Copy code
    Error: Generator at prisma-dbml-generator could not start:
    
    /bin/sh: 1: prisma-dbml-generator: not found
    Ubuntu 18, Node 14 prisma : 2.30.2 @prisma/client : 2.30.2 Current platform : debian-openssl-1.1.x
    d
    • 2
    • 18
  • g

    Gautam Paranjape

    08/31/2021, 7:59 PM
    I’m trying to use full text search from the 2.30.0 release in prisma, and I have this code
    Copy code
    const result = await db.package.findMany({
          where: {
            body: {
              search: "test",
            },
          },
        });
    However, it’s throwing me an error, and I don’t know why. I have fullTextSearch enabled as a preview feature, and I even tried wiping node_modules & re-installing, and re-running
    npx prisma generate
    .
    r
    • 2
    • 12
  • p

    Pascal Sthamer

    09/01/2021, 3:48 PM
    Hello, is there any movement on https://github.com/prisma/prisma/issues/5315? I would like to write [graphql-shield](https://graphql-shield.vercel.app) rules, which take the type of the parent (prisma model) into account.
    r
    • 2
    • 1
  • s

    Sahil Lavingia

    09/01/2021, 7:07 PM
    weird error, just using the standard prisma function for finding a user and it’s giving me this ts error. any ideas?
  • s

    Sahil Lavingia

    09/01/2021, 7:27 PM
    when i reinstall everything, I get this:
    Copy code
    Prisma schema loaded from prisma/schema.prisma
    Error: TypeError: Cannot read property 'engineType' of undefined
      at getClientEngineType (/Users/sahil/code/loot-tme/node_modules/@
    r
    j
    • 3
    • 4
  • h

    Hector

    09/03/2021, 6:40 PM
    Hello, could someone help me clarify a concept?: I am trying to use GraphQL + Prisma with a code-first approach. My goal is having a single source of truth for my models and types. I'm opting for the Nexus approach, but in the examples provided by Prisma, it seems there are still 2 sources for model data: the
    schema.prisma
    file and the nexus code which generates the
    schema.graphql
    file. How do I make Prisma use the file generated by Nexus to generate the Client and push changes to the DB? Thanks for the help.
    r
    • 2
    • 2
  • k

    Kyle (TechSquidTV)

    09/04/2021, 1:37 PM
    Hey all sorry to repost this, just trying to get started, Does anyone know why creating anew user in GraphQL is not working for me here? https://prisma.slack.com/archives/CCWDULGUW/p1630258320018900
  • g

    Gautam Paranjape

    09/04/2021, 5:39 PM
    How can I re-order records in prisma?
    r
    • 2
    • 2
  • c

    Chris

    09/07/2021, 12:47 PM
    Hi Guys, I'm executing a query via
    $queryRaw
    which sums over various values in a Decimal column. The result incorrectly comes back as 337.40000000000003 instead of 337.4. The incorrect value is the same as what you would get back summing all the values in javascript. If I perform a similar query via the prisma client (without it being a raw query), the value is correctly represented as a Decimal. How can I get the correct Decimal value like this in a raw query? I've tried
    prismaClient.$queryRaw<Decimal[]>
    but this does not help
  • c

    Chris

    09/07/2021, 6:32 PM
    Here's a simplified example demonstrating the issue - with an incorrect value when calculated via
    queryRaw
    as though the values were floats
    Untitled.js
1...101112...23Latest