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

    Richard

    04/29/2022, 11:46 AM
    TypeError: Type β€˜JsonValue’ is not assignable to type β€˜InputJsonValue’. How can I properly narrow the
    Prisma.JsonValue
    type to
    Prisma.InputJsonValue
    ?
    n
    • 2
    • 3
  • r

    Richard

    04/29/2022, 12:22 PM
    πŸ‘† I wrote a quick getValidatedArgsOrThrow validation function that leverages TypeScript’s code flow analysis to infer the type correctly. This seems the safest to me. Curious to hear any thoughts. (in my case I want the JSON to be an object and nothing else; works the same if you expect an array or similar)
    prisma rainbow 1
    j
    • 2
    • 41
  • j

    Jeremiah

    04/29/2022, 12:37 PM
    Hello, I'm wondering when you do a nested
    connect
    is the relationship supposed to connect both ways? Right now a
    create
    that I'm using is connecting the parent to the child but is not creating a connection from the child to the parent.
    a
    n
    • 3
    • 6
  • g

    GaΓ«tan Busato

    04/30/2022, 9:33 AM
    Hello guys ! Following this ticket, it seems that there is a recurring error on ubuntu 22.04 and the 3.13.0 version of prisma. Did someone found a way to solve this ticket / issue ?
    Copy code
    npx prisma migrate dev --preview-feature
    Environment variables loaded from .env
    Prisma schema loaded from prisma/schema.prisma
    Error: Unable to require(`/node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node`)
     /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /lib/x86_64-linux-gnu/libcrypto.so.3)
    βœ… 1
    n
    • 2
    • 3
  • b

    Brendan Allan

    05/01/2022, 1:32 PM
    Will Prisma CLI v1.13.0 be uploaded to https://binaries.prisma.sh soon? Would love to update Prisma Client Rust to it and have OpenSSL 3 support
    n
    j
    l
    • 4
    • 6
  • m

    Michal

    05/01/2022, 9:58 PM
    hi, graphql resolver return type is [Users] and prisma client returns user[]. It works but i dont undestand it. Is there any magic retyping or how it works? Can i enable strong typing to validate it in compile time?
    o
    n
    • 3
    • 4
  • e

    Eden Lane

    05/02/2022, 9:54 AM
    I have a monorepo with prisma as a separate package. When I import PrismaClient from this package, it tries to find schema.prisma file in the current directory. How can I fix this? I'm using pnpm
    n
    • 2
    • 9
  • u

    user

    05/02/2022, 10:36 AM
    πŸ‘‰ A Practical Introduction to Prisma & MongoDB (Workshop by Nikolas Burk | April 22) --

    https://www.youtube.com/watch?v=OyrlB051j3kβ–Ύ

    -- In this beginner-friendly and hands-on workshop, you'll learn the basics of using Prisma with MongoDB. Specifically, the workshop covers: βœ… Setting up Prisma from scratch (using a local or hosted MongoDB instance) βœ… Data modelling, migrations & querying βœ… API development with REST & GraphQL Prerequisites: β€’ Node.js: 12.2.X / 14.X β€’ No prior knowledge of TypeScript or MongoDB required πŸ““ Find all the instructions in this Notion document: https://pris.ly/prisma-mongodb-workshop-22 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” πŸ“š Learn more about Prisma β€’ Website: https://www.prisma.io β€’ Docs: https://www.prisma.io/docs β€’ Quickstart: https://pris.ly/qstart β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ❓ Get help with Prisma issues β€’ Slack: https://slack.prisma.io β€’ GitHub: https://www.github.com/prisma/prisma/... β€’ Stackoverflow: https://stackoverflow.com/questions/tagged/prisma β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” πŸ’¬ Follow Prisma on social media β€’ Twitter: https://twitter.com/prisma β€’ Instagram: https://www.instagram.com/prisma.io/ β€’ TikTok: https://www.tiktok.com/@prismadata β€’ Facebook: https://www.facebook.com/prisma.io β€’ LinkedIn: https://www.linkedin.com/company/prisma-io β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” πŸ”  Professional captions for your technical videos Prisma sponsors human-reviewed, professional closed captions for ANY video valuable to our community (for example, about: Node.js, TypeScript & Type Safety, Prisma, databases, etc). Get your FREE captions here: https://pris.ly/closedcaptions β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” βœ… Subscribe to Prisma's YouTube channel https://www.youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w
  • u

    user

    05/02/2022, 10:42 AM
    πŸ‘‰ Building a Fullstack App with Remix, Prisma & MongoDB (Workshop by Sabin Adams | April 22) --

    https://www.youtube.com/watch?v=Zb_8tPsCNPMβ–Ύ

    -- In this beginner-friendly and hands-on workshop, you'll learn how to build a fullstack app with Remix, Tailwind CSS, Prisma and MongoDB. Prerequisites: β€’ Node.js: 12.2.X / 14.X β€’ No prior knowledge of TypeScript or MongoDB required πŸ““ Find all the instructions in this Notion document: https://prismaio.notion.site/Advanced-Workshop-4a11353478b2410aa3768ca59c274507
  • p

    Paul

    05/02/2022, 2:06 PM
    Hey. So I have a self referencing multidimensional table (one -> many)
    Copy code
    select count(*) from forum_post where id = '01G229XJPH7BTHFD89B7TD45XX' OR "postId" = '01G229XJPH7BTHFD89B7TD45XX';
     count
    -------
         2
    (1 row)
    Copy code
    return db.forumPost.count({
          where: {
            OR: [
              {
                id: postId,
                postId: postId,
              },
            ],
          },
        })
    Is this a bug, Or maybe I'm using the OR cond wrong? Thanks
    j
    • 2
    • 3
  • s

    Santosh

    05/02/2022, 6:22 PM
    Hi! This is first time I am posting here. I am looking into migrating from mongoose to prisma for a project. There is a particular case where I am saving ids to array as reference. I am unable to find similar examples online and what exist needs changes to the original schema. If anyone here could guide me on as how to achieve this in prisma that would be great. So, the schema looks something like following # UserSchema
    Copy code
    const UserSchema = new Schema({
        email: {
            type: String,
            lowercase: true,
            required: true
        },
        info: {
            firstName: String,
            lastName: String,
            mobile: String
        },
        apps: [{type: Schema.Types.ObjectId, ref: 'AppList'}]
    }, {timestamps: true});
    
    module.exports = User = mongoose.model('user', UserSchema);
    # AppSchema
    Copy code
    const appSchema = new Schema({
        name: {
            type: String,
            lowercase: true,
            unique: true,
            required: true
        },
        description: String,
    }, {timestamps: true});
    module.exports = AppList = mongoose.model('AppList', appSchema);
    n
    • 2
    • 2
  • o

    Okan YΔ±ldΔ±rΔ±m

    05/02/2022, 8:30 PM
    Hello, is there any way to use pagination by default in Prisma Studio?
  • o

    Okan YΔ±ldΔ±rΔ±m

    05/02/2022, 8:30 PM
    When I click on a table with like 2.5 million of entries, Prisma Studio becomes stuck for a while
    d
    n
    • 3
    • 7
  • k

    Kenneth Gitere

    05/03/2022, 7:59 AM
    Hi guys. Are there any guides for using Prisma with Electron
  • j

    James L

    05/03/2022, 8:45 AM
    @Kenneth Gitere I don't think there should be any significant differences between using it in an Electron app vs a standard node app.
    k
    • 2
    • 3
  • j

    James L

    05/03/2022, 9:17 AM
    @Kenneth Gitere dead simple electron "guide" that I just slapped together because I was curious as to whether or not it'd actually work. Spoiler: it did.
    electron-guide.md.txt
    v
    • 2
    • 1
  • j

    James L

    05/03/2022, 9:18 AM
  • j

    James

    05/03/2022, 9:44 AM
    Hi, bit of a frontend question, I use Apollo Client and on my UI I have 3 tabs: Contacts, Leads, and All. Clicking Contacts or Leads is easy, using Nexus I can easily paginate and search these 2 tables. My real challenge is the 3rd tab, which should show both Leads and Contacts all in 1 table. How would you recommend I solve this? Would you use a MySQL VIEW, or use 2 query hooks, or what? And would you idea work with pagination? offset based, or cursor too?
    n
    • 2
    • 1
  • j

    James L

    05/03/2022, 10:10 AM
    is the data shape the same for both contacts and leads? if so, is there any reason they can't coexist within the same table and have an enum type of
    client
    or
    lead
    ?
  • m

    Mathie

    05/03/2022, 10:12 AM
    Hello ! How to load default data in my database when I run db push ? Like fixture in Symfony
  • j

    James L

    05/03/2022, 10:15 AM
    AFAIK
    push
    only modifies schema, not data. You may be looking for the docs on seeding your db - https://www.prisma.io/docs/guides/database/seed-database
  • m

    Mathie

    05/03/2022, 10:16 AM
    Thanks @James L!
    πŸ‘ 1
  • w

    William Brandham

    05/03/2022, 1:29 PM
    Hey channel, was hoping someone can point me in the right direction. We have spent around 15-18 months building our new product around using PRISMA, however there is a bug that is forcing our development to a halt. We have gone down the community / support route but we are not getting a reply. Is there any kind of paid / enterprise support route we can go down with PRISMA?
    v
    • 2
    • 2
  • u

    user

    05/03/2022, 2:00 PM
    Prisma Raises $40M to Build the Application Data Platform We are excited to announce that we have raised our Series B funding. Learn more about our vision of the Application Data Platform for development teams & organizations in this article.
    prisma rainbow 3
    πŸ’° 4
    πŸ’― 3
    πŸ™Œ 3
    πŸ’š 2
  • u

    ζŽη™½ε­—δΈ€ζ—₯

    05/03/2022, 2:29 PM
    npx prisma generate Environment variables loaded from prisma/.env
    Downloading Prisma engines for debian-openssl-3.0.x [ ] 0%Error: Not Found https://binaries.prisma.sh/all_commits/3c463ebd78b1d21d8fdacdd27899e280cf686223/debian-openssl-3.0.x/introspection-engine.gz
    n
    • 2
    • 1
  • u

    ζŽη™½ε­—δΈ€ζ—₯

    05/03/2022, 2:30 PM
    how to solve this?
  • j

    Jacob Ross

    05/03/2022, 3:08 PM
    Hello Does anyone know of resources or a strategy someone has used for data mapper like validation at runtime for Prisma? our stack uses nest and graphql and we are seeing that while we can use DTO and validation pipes at the inputs for an entity we cannot easily make sure that same validation is applied before update. for Example if a model as a
    startsAt
    and
    endsAt
    we will add decorators to the entity so that
    startsAt < endsAt
    and vice versa. However when input for update comes in we only get the time to update and not both. we need a layer that checks that the update is valid before we call
    Prisma.client.model.update()
    to update the model.
    Prisma.Client
    does not know about the validation and it’s not applicable in the
    Prisma.Schema
    . Does anyone know of an elegant way to handle this need?
    n
    • 2
    • 1
  • q

    Quentin SAGNOL

    05/03/2022, 3:20 PM
    Hello everyone ! I am looking for an internship in computer science at Prisma, do you know who I should contact ?
    n
    • 2
    • 1
  • k

    Kharann

    05/03/2022, 5:04 PM
    Hi! Is it possible to return undefined instead of null when using findOne, etc...
    n
    • 2
    • 3
  • h

    Henrique Aurelio

    05/03/2022, 7:05 PM
    Hi guys, anyone can help me with an relation query to be used in where ?
1...569570571...637Latest