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

    William GM

    12/16/2021, 4:55 AM
    Hey there, I've been trying to use
    SET LOCAL some_key = value;
    on my transactions but I alway get an error, from what I saw on github issues, this is supported but for some reason is not working with me, using prisma
    3.6
    .
    Copy code
    this.prismaService.$executeRaw`set local "app.current_tenant" = ${tenant.id};`
    The error I get is
    Copy code
    Raw query failed. Code: `42601`. Message: `db error: ERROR: syntax error at or near "$1"`
  • d

    Dexter Marks-Barber

    12/16/2021, 10:10 AM
    Hey all, I’ve started a GitHub discussion where it seems like Prisma is crashing on
    update
    calls. Any ideas what might be going on? https://github.com/prisma/prisma/discussions/10720 Cheers!
    • 1
    • 1
  • n

    Nischal

    12/16/2021, 1:34 PM
    Hey All, Is there any way i can export the data of table to json and restore the db from json file ?
  • n

    Nischal

    12/16/2021, 1:34 PM
    any tools that could do it ?
  • u

    user

    12/16/2021, 2:18 PM
    What's new in Prisma (3.7.0) — Holiday Special

    https://www.youtube.com/watch?v=ohS25OtGdsc▾

    This week's "What's new in Prisma" episode is a special one to smoothly enter this year's holiday season. Niko and Alex from the Prisma team are joined by Prisma's CEO Søren and will look back on last week's release, but also review the entire year and discuss what has happened at Prisma in that time. Also, get ready for some special guests in this episode!
    🎄 1
    prisma rainbow 1
  • s

    Secre

    12/16/2021, 2:27 PM
    👋 Is it possbile to connect many record to one at one request?
    l
    • 2
    • 3
  • d

    Daniel

    12/16/2021, 5:34 PM
    hi all, there's no way to configure naming conventions automatically? 😬 i.e. I have to @map and @@map my way through this on every single table/column/enum/etc ?
    n
    c
    • 3
    • 2
  • c

    Charles Dimino

    12/16/2021, 6:07 PM
    do I need to be worried about infinite loops in self relations?
    • 1
    • 1
  • j

    Jin

    12/16/2021, 6:31 PM
    Does somebody have an experience of deploy “graphql prisma server” with docker via “*Cloud run*” in GCP ? I really need help.
  • l

    lawjolla

    12/16/2021, 7:14 PM
    Forever Prisma 1 user trying to migrate. I can't get autocomplete to work for my Prisma 2 client. Any suggestions?
    Screen Recording 2021-12-16 at 12.13.09 PM.mp4
    j
    • 2
    • 1
  • j

    Jin

    12/16/2021, 7:44 PM
    I am running graphql prisma with 8080 port in cloud run. this error message is shown when I query [ServerParseError: JSON Parse error: Unrecognized token ‘<’]
  • a

    Adam Garcia

    12/16/2021, 7:57 PM
    Hello everyone!
  • d

    Drew Rawitz

    12/16/2021, 7:58 PM
    hey all. if I’m passing in a list of IDs and querying them with
    { in: […ids] }
    is there a way to have them returned in the same exact order that I passed them in?
    👍 1
    k
    • 2
    • 1
  • c

    Cymak

    12/16/2021, 8:40 PM
    There's no way to mass archive an active runtime incident right? It's a false positive but it generated a few hundred alerts
  • a

    Adrian Duyzer

    12/16/2021, 9:07 PM
    I updated my schema and made a field optional:
    Copy code
    lttv          Float?
    But when I try to create an item with this field absent or set to null, I get the following error:
    Copy code
    → 124 const rate = await prisma.rate.create(
      Failed to validate the query: `Unable to match input value to any allowed input type for the field. Parse errors: [Query parsing/validation error at `Mutation.createOneRate.data.RateCreateInput.lttv`: A value is required but not set., Query parsing/validation error at `Mutation.createOneRate.data.RateUncheckedCreateInput.lttv`: A value is required but not set.]` at `Mutation.createOneRate.data`
        at cb (/Users/adrianduyzer/Mesa/www/transervice/bot/node_modules/@prisma/client/runtime/index.js:38683:17) {
      code: 'P2009',
      clientVersion: '3.6.0',
      meta: {
        query_validation_error: 'Unable to match input value to any allowed input type for the field. Parse errors: [Query parsing/validation error at `Mutation.createOneRate.data.RateCreateInput.lttv`: A value is required but not set., Query parsing/validation error at `Mutation.createOneRate.data.RateUncheckedCreateInput.lttv`: A value is required but not set.]',
        query_position: 'Mutation.createOneRate.data'
      }
    }
    I’ve tried regenerating the schema, regenerating the client, etc., to no avail. Any tips for me on this?
  • p

    Philipp Minder

    12/16/2021, 9:58 PM
    hi. im asking me what is better practice in the following: I have one User which have many Posts. Is it better to create posts with an update of user or should i create a post and connect it to the user?
  • j

    Jin

    12/16/2021, 10:04 PM
    @Philipp Minder if you wanna maintain the post even after user is deleted it would be good to create posts with update. if you don’t need to get the posts removed when user is deleted You can connect 🙂
  • p

    Philipp Minder

    12/16/2021, 10:16 PM
    thanks for your answer @Jin 🙂
  • g

    Giorgio Delgado

    12/16/2021, 11:04 PM
    We recently upgraded to prisma v3.5.0 from v2.x.x (i want to say like 3 weeks ago) … and today we added a new model to our prisma schema. When we went to run
    npm run migrate dev
    … the prisma cli ended up creating a pretty confusing / alarming migration. Why is prisma trying to rename existing foreign key and index identifiers? The model we created literally only had two columns so we were expecting a tiny
    CREATE TABLE
    migration
    m
    • 2
    • 2
  • m

    Martí Crespí

    12/17/2021, 9:08 AM
    Hi, my app doesn't work properly. Can someone explain how it should be configurated the connection_pool and limit for prisma client?
    a
    • 2
    • 8
  • p

    Philipp Minder

    12/17/2021, 9:37 AM
    Hello guys. Maybe a dumb Question. Can i do an Attribute like createdAt on an implicite M2M Relationship or do i have create an explicit?
    n
    • 2
    • 2
  • u

    user

    12/17/2021, 11:10 AM
    How Tryg has leveraged Prisma to democratize data Tryg saved huge amounts of time thanks to its “360” Data Broker platform that accelerated development cycles by removing the overhead incurred by configuring environments manually. Prisma was the critical technology that enabled them to democratize billions of records from different data sources.
  • p

    Philipp Minder

    12/17/2021, 12:06 PM
    Hello. I want to connect an Object in one to many to my object. if i dont send the type object with the update, i get an error bcs he dont find the id of undefined object. If i change the connect to "connect: { type }" i get the problem that i have more then one Attribute. Any Ideas what i can do?
  • a

    Ahmet

    12/17/2021, 12:42 PM
    Copy code
    model accesstoken {
      id              Int              @id @default(autoincrement())
      token           String
      isactive        Boolean
      createdat       DateTime         @default(now())
      updatedat       DateTime         @updatedAt
      instancesworkers instancesworker[]
    }
    Copy code
    model instanceworker {
      id                  String                @id
      name                String
      comment             String?
      expiredate          DateTime
      createdat           DateTime              @default(now())
      updatedat           DateTime              @updatedAt
      webhookid           Int
      userid              String
      accesstokenid       Int
      accesstoken         accesstoken           
    }
    Error: Schema parsing
    error: Type "instancesworker" is neither a built-in type, nor refers to another model, custom type, or enum.
    -->  schema.prisma:43
    |
    42 |   updatedat       DateTime         @updatedAt
    43 |   instancesworkers instancesworker[]
    |
  • a

    Ahmet

    12/17/2021, 12:43 PM
    I lowercase the database table and column names and it’s got an error 🙂
  • a

    Ahmet

    12/17/2021, 12:44 PM
    What should I do?
    s
    • 2
    • 1
  • s

    sramam

    12/17/2021, 1:44 PM
    I am writing a code generator that uses the DMMF, and was wondering what kind of stability I should expect from the DMMF format? Specifically: • Are changes to this well advertised? • Do they result in major version upgrades? Or should I be monitoring and managing these changes as prisma evolves forward?
    n
    • 2
    • 2
  • d

    Dexter Marks-Barber

    12/17/2021, 3:55 PM
    What’s going on with this last select statement? 😅 https://gist.github.com/dextermb/2698971c153ba74b339879363295123b#file-prisma-log Seems a bit funky
  • j

    Jason Kleinberg

    12/17/2021, 4:22 PM
    Is there a way to add comments to the generated SQL queries? I really want to use Prisma, but I really need to be able to tag the query logs to include the
    requestId
    of the request that spawned the query.
    n
    m
    d
    • 4
    • 9
  • t

    Tyler Clendenin

    12/17/2021, 6:03 PM
    If I create a new related record inside an update, is there a mechanism, to know which record was created? I assume the
    include
    statement's records will include any other related records that already existed.
1...522523524...637Latest