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

    Dean Valentine

    08/17/2021, 2:49 PM
    is there like an enterprise support thing I can pay for
    r
    • 2
    • 2
  • u

    user

    08/17/2021, 4:26 PM
    What's new in Prisma (v2.30.0)

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

    Mahmoud from the Prisma team discusses the latest 2.30.0 release of Prisma and other news from the Prisma ecosystem. Tune in to learn about new releases, planned features, and other interesting bits from the Prisma world. Learn more about Prisma: ◭ Website: https://www.prisma.io​​​​ ◭ Docs: https://www.prisma.io/docs​​​​ ◭ Quickstart:https://www.prisma.io/docs/getting-started/quickstart
  • p

    prisma chobo

    08/17/2021, 6:34 PM
    I can’t seem to find any info or documentation for query filter by date? where : { createAt: { gte: new Date() } } something like this? it keeps complaning how the datetime type. Can’t we use string ? if not whats the work around?
    r
    • 2
    • 1
  • m

    Michael Auderer

    08/17/2021, 7:07 PM
    what would cause this error?
    Copy code
    Uncaught TypeError: Error resolving module specifier ".prisma/client/index-browser". Relative module specifiers must start with "./", "../" or "/".
    r
    • 2
    • 1
  • p

    prgrmmr

    08/17/2021, 7:38 PM
    Hey guys, quick question. When creating an API, I have a controller folder, routes folder, but when it comes to models. Does the prisma.schema replace models or should I still create models other than prisma schema.
    r
    • 2
    • 2
  • b

    Billy Ohgren

    08/18/2021, 7:04 AM
    Sorry if this has been asked a hundred times before. Prisma in docker with Apple M1, is there a way to get it to work? I compiled all the engines on an M1, specified paths as envs and I could see them being loaded. It looks like it works on "bare metal" but not inside of my docker container running node:15-alpine. I've been googling for hours 🙂
    r
    • 2
    • 2
  • d

    Dev__

    08/18/2021, 7:34 AM
    is there a way to search in a json field in the where clause? the only options that are available:
    equals
    and
    not
    r
    • 2
    • 8
  • m

    matic

    08/18/2021, 8:41 AM
    hi 👋 I am trying to migrate some of my code from
    2.12.1
    to
    2.29.1
    and have trouble with migrations. I am following the guide with deleting legacy migrations and making a base one as the starting point but the CLI wants to wipe the database. I am a bit scared of what is going on. Is there a migration guide that I could follow or someone who could help me with it?
    r
    • 2
    • 3
  • n

    Nathaniel Babalola

    08/18/2021, 9:39 AM
    Copy code
    model Traveller {
      travellerId   Int          @id @default(autoincrement())
      title         String
      firstName     String
      lastName      String
      countryCode   String
      phoneNo       String
      address       String
      state         String
      country       String
      bookingRef    String
      travellerType String?      @default("adult")
      price         String
      currency      String
      isUser        Boolean      @default(false)
      createdAt     DateTime     @default(now())
      updatedAt     DateTime     @updatedAt
      userId        Int? // relation scalar field (used in the '@relation()` attribute below)
      user          User?        @relation(fields: [userId], references: [id])
      flightBooking FlighBooking @relation(fields: [bookingRef], references: [bookingRef])
    
      @@map(name: "traveller")
    }
    Copy code
    model FlighBooking {
      bookingRef  String   @id
      userId      Int?
      email       String
      countryCode String
      phoneNo     String
      flightType  String
      price       Int
      currency    String
      status      String?
      paymentId   String?
      adultCount  Int
      childCount  Int
      infantCount Int
      childDOB    String
      airlinePNR  String?
      ticketNo    String?
      vendorPNR   String?
      vendorType  String?
      createdAt   DateTime @default(now())
      updatedAt   DateTime @updatedAt
    
      user User? @relation(fields: [userId], references: [id])
    
      travellers        Traveller[]
      flightPostBooking FlightPostBooking[]
      @@map(name: "flightBooking")
    }
    Please who knows how I can perform a CROSS JOIN across these two tables with Prisma? searching for a single record with a traveller's
    lastName
    AND
    bookingRef
    OR
    airlinePNR
    or
    vendorPNR
    . The two tables are only joined via
    bookingRef
    r
    • 2
    • 7
  • s

    Salah eddine Ait Balkacem

    08/18/2021, 11:11 AM
    I am using Prisma with nestjs and having a problem seeding to PostgreSQL DB, when I run seed command I get that the seed is done but the db isn't affected, nothing else is logged out
    r
    j
    j
    • 4
    • 10
  • u

    user

    08/18/2021, 11:27 AM
    JS Monthly Lunchtime Meetup #7

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

    Join us for the 7th edition of JS Monthly Lunchtime Meetup! ◭ Making MongoDB Type-Safe with Prisma by Daniel Norman ◭ Type safety is indispensable for developers to be productive and to have strong confidence in their code. While MongoDB is great for developers that need to move quickly, it is not straightforward to access it in a type-safe way. Doing this requires a lot of boilerplate code and manual work to keep database models and application types in sync. In this talk, you’ll learn how Prisma enables developers using MongoDB to model their data with a schema and benefit from a type-safe data access API at a low cost of adoption. ◭ Daniel (@daniel2color) is a software engineer with broad experience across modern web and cloud environments. He’s passionate about open source and modern development tooling and likes bringing ideas from different disciplines to software development. These days, Daniel is a developer advocate at Prisma, focusing on next-generation database access for Node.js and Typescript. Outside the software world, Daniel is interested in woodworking and motorcycling. ◭Peter Perlepes - TBC
  • k

    khareta

    08/18/2021, 12:14 PM
    Is it possible to insert records with CUIDs from mysql, while automatically generating the id?
    r
    • 2
    • 22
  • i

    Irakli Safareli

    08/18/2021, 1:36 PM
    is there something like
    upsertMany
    ?
    r
    • 2
    • 2
  • m

    manuel

    08/18/2021, 2:59 PM
    Hey! quick question: how can I filter in prisma only when the argument is present?
  • m

    manuel

    08/18/2021, 2:59 PM
    so I want that the
    where
    only gets called if a certain argument is present.
  • m

    manuel

    08/18/2021, 3:00 PM
    or do I need to just write to resolvers for that?
    r
    • 2
    • 2
  • u

    user

    08/18/2021, 3:10 PM
    Fullstack App With TypeScript, PostgreSQL, Next.js, Prisma & GraphQL: Data Modeling This article is the first part of a course where we build a fullstack app with Next.js, GraphQL, TypeScript,Prisma and PostgreSQL. In this article, we'll create the data model and explore the different components of Prisma.
  • u

    user

    08/18/2021, 3:16 PM
    Fullstack app using Next.js, GraphQL & Prisma - Course Introduction

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

    Learn more about Prisma: ◭ Website: https://www.prisma.io​​​ ◭ Docs: https://www.prisma.io/docs​​​ ◭ Quickstart: https://www.prisma.io/docs/getting-started/quickstart-typescript
  • g

    Gelo

    08/18/2021, 5:03 PM
    Hi why is this not working when mix with logical operators like AND
    r
    • 2
    • 1
  • h

    Haider Shahid

    08/18/2021, 5:36 PM
    Hey everyone, I have a small issue I have dockerized my node , prisma and postgres project
    r
    • 2
    • 1
  • d

    Dick Fickling

    08/18/2021, 7:19 PM
    is it possible to filter based on the count of a relation? e.g. find users with >50 followers
    Copy code
    prisma.user.findMany({ where: { followers: { _count: { gt: 50 } } } });
    i feel like i must be missing something obvious
    r
    • 2
    • 2
  • g

    Giorgio Delgado

    08/18/2021, 7:31 PM
    Is there a way to specify the text encoding and collation for table schema definitions that prisma generates?
  • g

    Giorgio Delgado

    08/18/2021, 7:31 PM
    I always have to go into these autogenerated migrations and have to manually change the collation 😕
  • g

    Giorgio Delgado

    08/18/2021, 7:32 PM
    and this also means that
    npx prisma db push
    doesn’t work for us whenever we add new models 😢
    r
    • 2
    • 3
  • s

    Salah eddine Ait Balkacem

    08/18/2021, 8:25 PM
    is there a way to get around this ? not sure if I have to override the user model or what?
    g
    r
    • 3
    • 2
  • a

    Anirudh Nimmagadda

    08/18/2021, 11:27 PM
    Hey everyone. I'm encountering some interesting behaviour when using prisma. It is related to prisma's generated types, and I've been skimming the docs trying to find out more, but there doesn't seem to be much info about generated types in there (please correct me if I'm mistaken). Here's the behaviour: Say I have a model with two 1-1 relations (Profile in the example below):
    Copy code
    // prisma.js
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider = "prisma-client-js"
    }
    
    model User {
      id      Int      @id @default(autoincrement())
      name    String
      profile Profile?
    }
    
    model Profile {
      id      Int    @id @default(autoincrement())
      name    String
      userId  Int?
      user    User?  @relation(fields: [userId], references: [id])
      photoId Int?
      photo   Photo? @relation(fields: [photoId], references: [id])
    }
    
    model Photo {
      id      Int      @id @default(autoincrement())
      url     String
      profile Profile?
    }
    The following code works when creating a new profile:
    Copy code
    const user = await prisma.user.create({ data: { name: "TestUser" } });    
    const profile = await prisma.profile.create({
      data: {
        name: "TestProfile",
        user: { connect: { id: user.id } },
        photo: { create: { url: "<http://example.com/img>" } },
      },
    });
    ... but this fails with an error
    Copy code
    const user = await prisma.user.create({ data: { name: "TestUser" } });
    const profile = await prisma.profile.create({
      data: {
        name: "TestProfile",
        userId: user.id,
        photo: { create: { url: "<http://example.com/img>" } },
      },
    });
    The error is:
    Copy code
    Unknown arg `userId` in data.userId for type ProfileCreateInput. Did you mean `user`? Available args:
    type ProfileCreateInput {
      name: String
      user?: UserCreateNestedOneWithoutProfileInput
      photo?: PhotoCreateNestedOneWithoutProfileInput
    }
    Would anyone be able to tell me where to look to learn more about what is happening here?
    r
    • 2
    • 1
  • k

    kkangsan

    08/19/2021, 5:37 AM
    Can findmany include within include? Could you give me an example if possible?
    r
    • 2
    • 2
  • u

    user

    08/19/2021, 6:53 AM
    Course Prerequisites

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

    Blog Post: https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-oklidw1rhw Code: https://github.com/m-abdelwahab/awesome-links Learn more about Prisma: ◭ Website: https://www.prisma.io​​​ ◭ Docs: https://www.prisma.io/docs​​​ ◭ Quickstart: https://www.prisma.io/docs/getting-started/quickstart-typescript
  • a

    Arfath Tade

    08/19/2021, 7:32 AM
    Hello, I want to update different columns of multiple rows having different id's for example I have a model
    Copy code
    model Activities {
      id      String      @id @default(uuid())
      type    String
      minutes String
    }
    with data as
    Copy code
    id   |   type    | minutes
    ---------------------------
    1    | running   | 72
    2    | walking   | 92
    3    | cycling   | 32
    I want to update minutes of id 1 and 2 in one query. This is just a sample there can be multiple columns in the above model. Is there a way to achieve this bulk update through one query?
    r
    • 2
    • 5
  • u

    user

    08/19/2021, 9:00 AM
    Prisma Chat with Alex Johansson from tRPC io

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

    Timestamps: 00:00 - 01:35 Intro 01:36 - 04:55 What is tRPC and why use it? 04:56 - 38:41 A look at the Prisma, Next.js, and tRPC example 38:42 - 42:22 When NOT to use tRPC 42:23 - 53:06 A look at TypeScript Careers website 53:07 - 57:42 Websocets & subscriptions example 57:43 - 59:25 Recap & conclusion Links mentioned in the video: - https://trpc.io/ - https://github.com/KATT/typescript.careers - https://trpc.io/docs/example-apps - https://typescript.careers Alex on Twitter: https://twitter.com/alexdotjs Learn more about Prisma: ◭ Website: https://www.prisma.io​​​ ◭ Docs: https://www.prisma.io/docs​​​ ◭ Quickstart: https://www.prisma.io/docs/getting-started/quickstart-typescript
1...471472473...637Latest