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

    Michael Buller

    01/28/2022, 9:37 PM
    npx prisma migrate dev --create-only
    Environment variables loaded from .env Prisma schema loaded from libs\api\core\data-access\src\prisma\schema.prisma Datasource "db" - SQL Server Drift detected: Your database schema is not in sync with your migration history. The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database. It should be understood as the set of changes to get from the expected schema to the actual schema. [+] Added tables • stage_Providers [*] Changed the 
    ProviderSearch
     table [+] Added column 
    geography
    ? We need to reset the database. Do you want to continue? All data will be lost. » (y/N) My table has geography String? @ignore on it, the geography type is not supported by prisma yet... so have to work around it somehow. How do I tell Prisma not to touch that column and move on? Also, this is a production database and people need to move data into it via different methods. Seen here, there is a stage table that was added. We need a way to ignore that table. Also, don't you think it is odd that your only option you present to the user when a "New" table is added is to DELETE all of the other data from the database? Even if this was development, and we have all of the Prisma seed methods in place, deletion all data doesn't seem like the first choice I would go with.
  • m

    Michael Buller

    01/28/2022, 9:54 PM
    I went into the database and manually deleted the table and the column to see if I can move forward, but prisma gives same message. Is there a way to clear this cached schema?
  • e

    ericsonluciano

    01/29/2022, 5:59 AM
    Hello i have question i just want to try an string value to render as markdown but when i trying to record via prisma studio i got the
    \n
    as
    \\n
    ? not sure if this is a good solution but on result i made it into
    value.replace(/\\n/gi, '\n');
  • j

    James Midzi

    01/29/2022, 9:12 AM
    I didn't know where to put this, but thank you Prisma team 😄 😄 ! My swag arrived!
    prisma rainbow 2
    💚 1
  • h

    Harrys Kavan

    01/29/2022, 11:56 AM
    Hello 👋 I'm trying out this Prisma client thing and it's cool and all but I need to understand it better. I'm having trouble understanding how the automatically generated classes are generated. I've looked at the documentation but I cant find the bit where it is explained. Could someone point me to it please?
    n
    • 2
    • 2
  • d

    Dan Shapir

    01/29/2022, 5:06 PM
    How can you filter by part of the query in an include? Like ` SELECT * FROM A INNER JOIN B on B.aId = A.id AND B.amount < A.price or SELECT * FROM A INNER JOIN B on a.aId = A.id WHERE B.amount < A.price Meaning your query’s filter parameter is part of the query itself. I couldn’t figure anyway to do it and it’s crazy… This is a super basic SQL capability
  • m

    Max Runia

    01/29/2022, 7:15 PM
    At my day job, we're working on a design doc to migrate our node.js backend monolith to a microservice architecture. Likely we'll convert the repo to an Nx monorepo. Each service would then live in
    apps/**
    , and have it's own
    prisma/schema.prisma
    file, since the services will be backend by their own postgres dbs. For example:
    Copy code
    apps/
      service1/
        src/
          ...
        prisma/
          schema.prisma
      service2/
        src/
          ...
        prisma/
          schema.prisma
    libs/
      ...
    Has anyone done a setup like this using Nx + Prisma? Are there any gotchas that I'm not foreseeing?
    e
    • 2
    • 4
  • a

    André

    01/29/2022, 7:40 PM
    Hiring Developers with experience in Javascript and React, React Native / VueJS Make account and adding more info inside the Settings like CV, Projects, ... On website => https://startups-hire.com I Will reach you later
  • u

    רועי ביתן

    01/30/2022, 3:49 PM
    Hey, I'm using prisma and graphql. I want to add many to many connection between two types and the connection between them should also have information that describes the connection (time of when the connection was added, who added the connection etc...) In prisma I did it with connection table, how do I add this connection table in correct way to graphql?
  • a

    ador

    01/30/2022, 4:26 PM
    So, when i declare a data source in the Prisma schema and run
    npx prisma migrate dev
    for the first time, Prisma will create a database
    mydb
    on the given MySQL server for me, but is there any way I can programmatically create a new database using Prisma or is my only resport to run the command?
  • n

    Nathaniel Babalola

    01/30/2022, 5:03 PM
    Hi all , good day Please does anyone have any guide or write-up on writing Tests using Mocha and Prisma ? Any help is greatly appreciated
  • f

    Fernando Fleury

    01/30/2022, 7:48 PM
    Is it possible to combine to queries in prisma? I wanted one query to fetch the reviews and other query to check whether or not the user has upvoted that review. almost like creating a virtual field for the response, like a view so to speak review & votes are different tables with keys referencing each other A review can be structured like:
    Copy code
    {
    score: float;
    reviewVotes: ReviewVote[]
    }
    And the review vote:
    Copy code
    {
    reviewId: string;
    userId: string;
    }
    When querying the
    reviews
    I wanted to be able to return a "virtual field"
    hasUserVoted
    that would rely on checking whether or not a
    reviewVote
    with its
    userId
    exists. I was trying to figure out how to do this in an optimal way
  • c

    Chris Tsongas

    01/31/2022, 3:59 AM
    In case anyone is wondering why their seed script(s) crash in Docker, Heroku, etc. https://github.com/prisma/docs/pull/2787.
  • v

    Vladi Stevanovic

    01/31/2022, 9:58 AM
    🌟 We have reached 20,000+ stars on GitHub 🌟 We're deeply thankful to our community for all their support and super stoked about everything we have in store 💚 👉 Help us reach 30k! github.com/prisma/prisma
    Prisma-GithubStars_1.mp4
    🎉 8
    fast parrot 8
    ❤️ 3
    prisma rainbow 6
    prisma cool 2
  • a

    Amit

    01/31/2022, 11:13 AM
    Hey, building docker for λ with Prisma support, so this needs the
    rhel-openssl-1.0.x
    binary target. We're building the docker images in the CI, and sometimes, installing deps and building works just fine, however, the binary is corrupt. It's only 3 MB in the faulty image 1. Does it happen to someone else? 2. Is there a checksum somewhere that I can validate with?
    • 1
    • 3
  • h

    Hemen

    01/31/2022, 6:31 PM
    I’m working on micro service design and want to create a common logging and tracing middleware for prisma service call. I want to create nestjs library to share the logging and tracing middleware, but library doesn’t have the PrismaClient instance. Does anyone used Prisma to create library to dynamically inject configuration to create prismaservice instance and log query request and response data.
  • h

    HarryET

    01/31/2022, 7:06 PM
    👋🏻 I know alot of people have been asking for a discord server, this is a community one here: https://discord.gg/Wa7fU7dqqS This is in the reply to a discussion - https://github.com/prisma/prisma/discussions/3920#discussioncomment-2083437
  • j

    Jon Insley

    01/31/2022, 8:33 PM
    Hey 👋, does anyone know if there is a way with cascading deletes to change relations for userID to a default userID? or would i have to change to set to null? Just had an admin of an app leave a company and their account was deleted and it deleted all the posts she created that they would've like to stay like. Trying to figure out how to make sure posts aren't deleted when the publishing admin is removed from the DB. Thanks!
    a
    • 2
    • 3
  • j

    Joshua Reilly

    01/31/2022, 10:12 PM
    Can anyone point me to an article or something that shows how to use a @prisma/custom-client export directory?
    n
    • 2
    • 1
  • n

    Nathaniel Bajo

    02/01/2022, 9:57 AM
    Native type VarChar is not supported for sqlite connector. Does anyone know any native type that is supported by sqlite connector ??
    n
    • 2
    • 5
  • n

    Nathaniel Bajo

    02/01/2022, 11:27 AM
    I've been getting this error anytime I run
    prisma generate
    and I don't know what is wrong.
    n
    • 2
    • 2
  • n

    Nathaniel Bajo

    02/01/2022, 11:28 AM
    This is my generate function in my schema.prisma file
    Copy code
    generator client { 
        provider = "prisma-client-js"
        output = "../src/generated/client"
        engineType = "binary"
        binaryTargets = "native"
    }
  • u

    user

    02/01/2022, 11:40 AM
    What's new in Prisma (v3.9.0)

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

    Daniel and Niko from the Prisma team discuss the latest 3.6.0 release of Prisma and other news from the Prisma ecosystem. Tune in to learn about new releases, how to upgrade, planned features, and other interesting bits from the Prisma world. 📣 Release notes: https://github.com/prisma/prisma/releases
  • u

    user

    02/01/2022, 11:52 AM
    Serverless Berlin Meetup - an online edition

    https://www.youtube.com/watch?v=jE4fk-rSGPw▾

    Join us for the online edition of Serverless Berlin Meetup and take a deep dive into the world of all things serverless! Our speakers for this evening: Yan Cui (@theburningmonk) - "Lessons from running AppSync in production" Heit Lessa (@heitor_lessa) - on Lambda Powertools, Aleksandar Simovic (@simalexan) - TBA During this meetup, you'll have a chance to win ebooks from Manning Publications (https://www.manning.com/).
    prisma cool 1
  • n

    Nathaniel Babalola

    02/01/2022, 12:32 PM
    Hi everyone, good day. Please I am getting a
    Foreign key constraint failed on the field: transactions_senderId_fkey (index)
    When I try to insert. And I have no idea why. There shouldn't be on that field. Here's my model
    Copy code
    model user {
      id         Int      @id @default(autoincrement())
      email      String   @unique
      password   String
      tokens     String[]
      created_at DateTime @default(now())
      updated_at DateTime @updatedAt()
      account    account?
    }
    
    model account {
      accNumber Int            @id @default(autoincrement())
      balance   Float
      user      user           @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
      userId    Int            @unique
      Sender    transactions[] @relation("sender")
      Receiver  transactions[] @relation("receiver")
    
      created_at DateTime @default(now())
      updated_at DateTime @updatedAt()
    }
    
    model transactions {
      id         Int     @id @default(autoincrement())
      txRef      String  @unique
      amount     Float
      refundRef  String? @unique // this will reference a txRef column of a transaction whenn it is a refund
    
      from       account @relation("sender", fields: [senderId], references: [accNumber])
      senderId   Int
    
      to         account @relation("receiver", fields: [receiverId], references: [accNumber])
      receiverId Int
    
      created_at DateTime @default(now())
      updated_at DateTime @updatedAt()
    }
    Please can anyone see what's wrong with the model?
    n
    • 2
    • 10
  • v

    Vlăduț Ilie

    02/01/2022, 2:38 PM
    Hello awesome people! I have a quick question: The context:
    prisma.users.findFirst({ where: { id: 1, isActive: true }, select: { name: true } });
    The default where clause is with
    AND
    or
    OR
    ? 🤷🏻‍♂️
  • a

    Austin Zentz

    02/01/2022, 2:39 PM
    and by default: https://www.prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#filtering
    💯 2
    ✅ 2
    prisma cool 2
  • v

    Vlăduț Ilie

    02/01/2022, 2:40 PM
    Great, I missed that small and. Thank you 🍻
    fast parrot 2
  • m

    Matheus Assis

    02/01/2022, 3:06 PM
    Is there a method within prisma client instance to check if the connection to the db is successful and there are no interferences or it is not down?
    n
    • 2
    • 2
  • u

    user

    02/01/2022, 3:30 PM
    Prisma support for CockroachDB is now in Preview Today we are excited to expand the range of Prisma compatible databases with Preview support for CockroachDB. Try it out and let us know what you think!
    😮 2
    fast parrot 2
    prisma cool 2
    prisma rainbow 2
1...539540541...637Latest