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

    Raoul

    04/24/2021, 7:30 AM
    Is it possible to do a
    case when
    inside the aggregation sum from Prisma client? Something like:
    Copy code
    SELECT 
    	title,
    	SUM(CASE WHEN some_date <= date('YYYY-MM-DD') THEN amount
    		ELSE 0 END)
    FROM test
    GROUP BY title;
    🍿 1
    • 1
    • 1
  • s

    Sergey Bedritsky

    04/25/2021, 10:00 PM
    Hey 👋 Is there any “recommended” video course using Prisma?
    👍 2
  • p

    propagandalf

    04/25/2021, 10:46 PM
    Daniel Norman has some excellent videos on it (and he is about as official as can be)
  • y

    YuukiKanasugi

    04/26/2021, 7:28 AM
    I’m soooo glad to get more than 100 likes, the Japanese translated “The Complete ORM for Node.js & TypeScript” 🎉 https://zenn.dev/kanasugi/articles/a082bd39c5bdf2
    japan parrot 8
    prisma rainbow 5
    💥 5
    🇯🇵 5
    • 1
    • 1
  • y

    yoenho park

    04/26/2021, 8:33 AM
    what is the current best way to implement the prisma delete casacde ? 1. queryRaw api 2. @paljs/plugins @paljs/plugin needs to modify prisma.model, it is a little hesitant to use it. but queryRaw only uses api, so the burden seems to be light. Please share your experience🤔
  • n

    Natalia

    04/26/2021, 12:51 PM
    typescript Hey everyone! I'd like to invite you all to join us on April 28, 6 PM CEST for a free TypeScript Berlin/Sevilla Meetup. During this event we will carry out a quiz, where you can win a copy of "TypeScript in 50 Lessons" book by Stefan Baumgartner and a JetBrains license. Here is our superstar lineup: ⭐️ Tițian Cericova-Dragomir: "Understanding Variance in the Typescript Type System" ⭐️ Dillion Megida: "PropTypes vs TypeScript" ⭐️ Kajetan Świątek: "Elm, a delightful language for learning functional programming" For more details and RSVP go to our Meetup page, and you can also

    set up a reminder on YouTube▾

    . See you there! fast parrot
  • g

    Gustav Ahlberg

    04/26/2021, 12:52 PM
    is there an easy way to access the generated schema from prisma? I have found
    *ScalarFieldEnum
    but I'm thinking it might be an easier way to get it programmatically? My use case is that in a middleware I want to rewrite a where statement to search in another field if it exists.
    Copy code
    prisma.model.findFirst({ where: firstName: 'max' })
    but I want to rewrite that to
    Copy code
    prisma.model.findFirst({ where: firstName_hash: 'HASH OF FIRSTNAME' })
    iff the
    firstName_hash
    field exists?
    🍿 1
  • n

    nikolasburk

    04/26/2021, 3:18 PM
    Hey Prisma friends 👋 I will be hosting a free Prisma workshop on this Thursday! 🎓 prisma rainbow Here's what we'll cover: ✅ Setting up Prisma with SQLite ✅ Data modeling, migrations & querying ✅ API development with REST and GraphQL 🗓️ April 29, 5:30pm - 8pm CEST 👉 You can sign up here!
    🤩 4
    👍🏾 1
    👍 2
    🦜 5
    prisma green 5
    ❤️ 2
    🚀 4
    prisma rainbow 2
  • j

    James

    04/27/2021, 3:47 AM
    There seems to be a compatibility issues with the npm prisma-multi-tenant, https://github.com/Errorname/prisma-multi-tenant/pull/79 I try to make the PR to fix it. Could someone give me a hand to fix the test please?
  • e

    ehodges

    04/27/2021, 10:25 PM
    Hi everyone 🙂 I'm running postgress app on a mac and I'm trying to do a migration I get this error when I run:
    npx prisma migrate dev --schema=./prisma/schema.prisma
    showing that it tries to connect to an older DB: ✔️ Drift detected: Your database schema is not in sync with your migration history. We need to reset the PostgreSQL database "next-auth-test" at "localhost:5432". Do you want to continue? All data will be lost. How do I fix this?
    y
    • 2
    • 2
  • a

    Alexis

    04/28/2021, 12:59 AM
    Heyo, I'm using Prisma for an already existing project in which I store a lot of data as structured json. Is there anyway to get type support for the entries inside of the json or will I have to type it all out myself? Also, how can I avoid getting errors such as
    Property 'id' does not exist on type 'JsonValue'.
    Copy code
    model Guild {
      id     String  @id
      prefix String?
      locale String?
      tags   Json[]
    }
    🍿 2
    r
    • 2
    • 2
  • a

    Alexis

    04/28/2021, 12:59 AM
    Would be nice to have tags typed as
    Copy code
    interface Tag {
    	id: string,
    	body: string
    }
  • c

    Carlos

    04/28/2021, 4:27 AM
    Any idea what is happening here? https://github.com/prisma/prisma/discussions/6831 I working on this several hours already, but I do not find what is wrong in this simple Create
    s
    j
    • 3
    • 13
  • c

    Carlos

    04/28/2021, 4:31 AM
    I not sure if the error come from node side. I using v16
  • l

    Lucas

    04/28/2021, 10:29 AM
    Hello, does anyone have an example of a polyfill to automatically populate a binary table of
    uuid
    ? https://www.prisma.io/docs/concepts/components/prisma-client/database-polyfills. Basically all my tables will need a binary(16) column which will have a uuid generated in runtime. Does prisma have a middlewre or something to automatically add that before every inserting or any better way to create a new custom attribute in
    prisma.model
    ?
    j
    • 2
    • 4
  • m

    Martin Duris

    04/28/2021, 11:53 AM
    Hi there, hope this message will not spat this channel but: Is this repo https://github.com/prisma-labs/serverless-plugin-typescript managed by Prisma? Or better yet, is this repo "still maintained" by Prisma? (last commit is over year so i wonder)
  • s

    stephan levi

    04/28/2021, 12:18 PM
    if i create an entity with a ref field to another entity which does not exist prisma creates the entity and throws an error is there a way to not create the entity altogether ?
  • n

    Natalia

    04/28/2021, 1:55 PM
    typescript Hey everyone! Today at 6 PM CEST we are hosting a TypeScript Berlin/Sevilla Meetup. During this event we will carry out a quiz, where you can win a copy of "TypeScript in 50 Lessons" book by Stefan Baumgartner and a JetBrains license. Here is our superstar lineup: ⭐️ Tițian Cericova-Dragomir: "Understanding Variance in the Typescript Type System" ⭐️ Dillion Megida: "PropTypes vs TypeScript" ⭐️ Kajetan Świątek: "Elm, a delightful language for learning functional programming" For more details and RSVP go to our Meetup page, and you can also 

    set up a reminder on YouTube▾

    . See you there! fast parrot
    🤩 1
    👏 2
  • a

    Alex Ruheni

    04/28/2021, 3:59 PM
    Hello friends, prisma cool We are going live in a minutes 📸 Join us for today's TypeScript Berlin/ Seville Meetup. We have three awesome speakers lined up for the session: ◭ Tițian Cericova-Dragomir: "Understanding Variance in the Typescript Type System" ◭ Dillion Megida: "PropTypes vs TypeScript" ◭ Kajetan Świątek: "Elm, a delightful language for learning functional programming" Watch the event here:

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

    🎤
  • j

    Jared Salzano

    04/28/2021, 7:09 PM
    I am going to try out postgraphile. I’m looking for a schema migration tool. Wonder if it makes sense to use Prisma Schema + Prisma Migrate as a migration tool, but not necessarily use Prisma Client
  • j

    Jared Salzano

    04/28/2021, 7:41 PM
    What are your thoughts on tools that try to avoid migrations by comparing a schema file to the db and updating the db?
    j
    a
    • 3
    • 51
  • k

    KhrisF999

    04/29/2021, 12:46 AM
    Where would I find help with prisma studio
    r
    j
    • 3
    • 25
  • c

    Carlos

    04/29/2021, 4:37 AM
    Is there any examples of handling errors with prisma? I read the Errors reference docs, but not sure if the right approach is handle in each route endpoint the errors, or make a separate file with a error Class let say, where I can define all type of errors my api can handle, and use this class for check each possible error in the endpoints.
    j
    • 2
    • 4
  • a

    Alex Szekely

    04/29/2021, 6:55 AM
    Hello, can anyone help me with Prisma migration? When I create a new migration I get this Error message:
    Copy code
    Error: Database error
    Error querying the database: Server error: `ERROR 42000 (1061): Duplicate key name 'accounts_id_with_roles_id_index''
       0: migration_core::api::ApplyMigrations
                 at migration-engine/core/src/api.rs:73
    But this index wasn't modified. Yet it tries to define the index again and the put the connected line into the new migration file. Why? And that is problem if I delete this line from the new migration file manually?
    j
    • 2
    • 14
  • d

    Dog

    04/29/2021, 9:17 PM
    Hi guys, anyone here is familiar with typegraphql-prisma? I have been trying to fix this stupid issue but haven't been able to. Basically I have this on my schema.prisma
    Copy code
    user   User @relation(fields: [userId], references: [id])
    userId Int
    But then when it gets generated with typegraphql-prisma this happens
    Copy code
    user?: User;
    userId: number;
    The issue is that (for some reason I don't understand) it doesnt appear in my graphql docs anywhere??? No idea why. It's like the field does not exist
  • d

    Dog

    04/29/2021, 9:21 PM
    For some reason userId does appear, but user does not
  • j

    Jared Salzano

    04/29/2021, 10:46 PM
    I’m using google secret manager to store my db password. Usually I use a function that gets the secrets and returns them. How can I build a connection string and then access it from the prisma.schema file?
    j
    l
    • 3
    • 16
  • j

    Jared Salzano

    04/29/2021, 10:47 PM
    Or pass it to the schema file with a command?
  • j

    Jeff Guy

    04/29/2021, 10:53 PM
    Has anyone used Keystonejs, nextjs, and prisma? Having a hard time getting set up
    j
    • 2
    • 6
  • k

    kitze

    04/30/2021, 4:55 AM
    Any idea how to
    prisma migrate reset --force
    a stubborn db that has extensions? (hosted on render .com)
    j
    t
    • 3
    • 3
1...429430431...637Latest