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

    Joey

    06/21/2021, 11:58 AM
    Hey y’all, how I would define an
    enum
    of integers in prisma schema? Say I want to build an NPS score system and part of the data is an
    upvote
    which translates to
    1
    and a
    downvote
    which translates to
    0
    ?
    r
    • 2
    • 4
  • j

    Julien Goux

    06/21/2021, 12:28 PM
    Hello team, am I the only one to have the warn :
    warn Versions of prisma@2.25.0 and @prisma/client@2.20.1 don't match.
    ?
  • j

    Julien Goux

    06/21/2021, 12:29 PM
    even after deleting all my node_modules, and a
    yarn cache clean
  • j

    Julien Goux

    06/21/2021, 12:29 PM
    also I made sure that both my versions are matching in my package.json (both fixed at 2.25.0)
  • j

    Julien Goux

    06/21/2021, 12:33 PM
    I also checked the
    @prisma/client
    ’s package.json installed in my node_modules and it’s
    2.25.0
    as well. This is also
    2.25.0
    in my yarn.lock xD
  • j

    Julien Goux

    06/21/2021, 12:33 PM
    I have no idea where the
    @prisma/client@2.20.1
    is coming from 🤔
    e
    j
    • 3
    • 20
  • a

    Alisia Reveli

    06/21/2021, 1:22 PM
    Hello all, is there a project course, I can learn prisma with mysql database ( not related to documentation)
  • j

    Justin Ellingwood

    06/21/2021, 3:16 PM
    👋 Hey there, just wanted to let you all know that we've started working on MongoDB content for Prisma's Data Guide. The first three articles are up now: Setting up a local MongoDB database Connecting to MongoDB databases How to manage users and authentication in MongoDB
    🦜 3
    🙌 3
  • m

    Michael Stewart

    06/21/2021, 8:11 PM
    Hi everyone! what’s the best way of upgrading from prisma 2.10.2 to the latest version? Should I go through every release notes and make the changes incrementally, or is there a faster way ?
    🤔 1
    j
    r
    • 3
    • 4
  • p

    prisma-chobo

    06/22/2021, 12:57 AM
    how can i use array of enums at prisma2 schema for mysql? if not possible what is the workaround for it? i want something like this: roles Roles[] @default([USER])
    r
    m
    • 3
    • 10
  • p

    prisma-chobo

    06/22/2021, 12:57 AM
    i cant find from google either :( plz help me
  • a

    Arun Kumar

    06/22/2021, 7:08 AM
    Prisma results after find query shows the data for big int field as
    myField: 78n
  • a

    Arun Kumar

    06/22/2021, 7:08 AM
    Any idea what does 78n mean?
    r
    • 2
    • 3
  • a

    Arun Kumar

    06/22/2021, 7:34 AM
    Getting this error though the field has been declared as primary key.
    Copy code
    The following models were enriched with an @@ignore taken from your previous datamodel
    Code 15
    [
      {
        "model": "myModel"
      }
    ]
    ``````
    r
    • 2
    • 1
  • o

    Orkhan Rustamli

    06/22/2021, 7:54 AM
    Hi Everyone, what channel is best for getting help for an error?
    s
    r
    • 3
    • 2
  • n

    Nichita Z

    06/22/2021, 9:22 AM
    Hi all, I got a question regarding m-n-relations in prisma.. let’s say I got this model
    model Test {
    id              Int       @id @default(autoincrement())
    pendingFollowers Test[] @relation(name: "relation")
    pendingFollowing Test[] @relation(name: "relation")
    }
    And I want to check if Test(id 1) has a specific Test(id 10) in its pendingFollowing list:
    const user = await this.prisma.test.findFirst({
    where: {
    id: 0,
    pendingFollowing: {
    some: {
    id: 10
    }
    }
    }
    })
    This is the best way I could find, but it feels.. a bit weird, is this the standard way of doing this?
    r
    • 2
    • 2
  • u

    user

    06/22/2021, 9:36 AM
    Introduzione pratica a Prisma [Invito]: Francesco Pigozzi

    https://www.youtube.com/watch?v=0dOAPw-TQuk▾

    In questo workshop impareremo quali sono le basi di Prisma e le principali differenze da un ORM tradizionale. Esploreremo le operazioni di base e le applicheremo ad API REST con Express e GraphQL con Apollo Server. Al termine del workshop, avremo acquisito le conoscenze necessarie per poter utilizzare Prisma nei nostri progetti. Parleremo, inoltre, di quali sono i prossimi passi per continuare a scoprire questo ecosistema. Prisma.io/Day 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
    🇮🇹 2
  • u

    user

    06/22/2021, 9:47 AM
    Primeiros passos com Prisma e TypeScript [Convite]: Luis Rudge

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

    Sabe aquele trabalho entediante de ficar escrevendo consultas SQL e criando classes para representar suas tabelas do banco de dados? Com o Prisma.io, isso é coisa do passado! Neste workshop, você vai aprender a utilizar o Prisma.io para facilitar o acesso aos dados da sua aplicação. Vamos começar do básico, entendendo seu funcionamento e como você pode começar a utilizar o Prisma.io de maneira simples. Depois de aprender um pouco sobre modelagem e consulta ao banco de dados, vamos criar uma API REST com Express e outra API GraphQL com Apollo GraphQL. Ao final do workshop, você poderá criar suas próprias APIs, REST ou GraphQL, utilizando o Prisma.io como facilitador de acesso aos dados. https://www.prisma.io/day 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
    🇧🇷 2
  • u

    user

    06/22/2021, 9:49 AM
    실용적인 Prisma 예제 소개 [초대]: Hyo Chan Jang

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

    한국에있는다양한스타트업과함께오픈소스커뮤니티를구축하고있습니다.또한,다양한스타트업,기업및학계를위한기술고문업무도병행하고있습니다.PHP개발자로처음프로그래밍을시작했습니다.이후에는모바일개발자로전향하여주로안드로이드위주프로젝트를수행했습니다. 스타트업산업으로커리어를전환후스타트업을위한기술을찾기위해노력했고ReactNative를주로프로젝트에서사용하게되었습니다.다양한스타트업에서CTO로근무하며주로GRAPHQL및서버프로그래밍업무를수행했습니다.현재,제가관심을가진스택으로더좋은코드를작성하는방법을배우고있으며그런과정에서훌륭한도구인Prisma찾고♥️에빠졌습니다.오픈소스공간안에서더훌륭한사람들과만나기를고수하며성장해나가기위해꾸준히노력하고있습니다. https://www.prisma.io​​​/day 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
    🇰🇷 2
  • l

    Luca Nigido

    06/22/2021, 11:37 AM
    Hello Guys! I started using Prisma with apollo server and I do not understand if to use prisma inside resolvers or inside data sources. Apparently prisma has a built in dataloader... so probably that is why I cannot find a dataSource extension like apollo-datasource-mongo or REST...
    e
    d
    • 3
    • 9
  • f

    Felipe Martinelli

    06/22/2021, 12:14 PM
    Hey there! Thanks for invite me @Vladi Stevanovic! 👍
    👋 3
    v
    r
    • 3
    • 3
  • a

    Arun Kumar

    06/22/2021, 12:49 PM
    I declared a field as id and still the create method show that id field is required in the data
  • a

    Arun Kumar

    06/22/2021, 12:50 PM
    Copy code
    +   id: Int
      }
    }
    
    Argument id for data.id is missing.
    r
    • 2
    • 9
  • i

    Ian

    06/22/2021, 1:02 PM
    Does using prisma count query scale? I mean if user has a post relationship.. We know that user can have many post without limit in span of the user lifetime does this has drawback with performance?? Or will it be good if prisma auto handle this case incrementing decrementing post count if post was added or deleted regardless if batch create or delete
  • i

    Ian

    06/22/2021, 1:05 PM
    BTW if somebody here has a saved/bookmark/favorited a talk/conference about prisma i would loved you to reply in this thread with the link of the talk. I feel like I want to marathon a talks tonight haha... Im trying to curate a list so that atleast maybe some other devs find it really important or relavant when developing in prisma
  • j

    J.Paul

    06/22/2021, 1:29 PM
    Heya everyone. New to Prisma and also new to Slack as well 😅. Excited to start working with Prisma in NextJS and also with this community. Thanks for having me 😇
    🙌 3
    👋 2
    n
    r
    • 3
    • 3
  • d

    David Panart

    06/22/2021, 1:41 PM
    Hello everyone 🙂 I know it's still in early stage, but is there somewhere some draft / discussion about Mongo regarding : • handling nested object in
    schema.prisma
    • handling
    enums
    ? • anything else worth knowing regarding the incoming features / possibilities ? 🙂
  • e

    Edmir Suljic

    06/22/2021, 1:41 PM
    Hi guys, I would really appreciate some help. I did a graphql course on udemy that unfortunately used prisma 1. After migrating to prisma 2 (or actually starting a whole new project), I'm having a lot of problems trying to get it to work. Using graphql-yoga and the new PrismaClient(), I keep getting the "cannot return null on non-nullable field", even though I believe I have done everything correctly (well obviously not everything). Anyone have any ideas? This is my index.ts file:
    Copy code
    import { GraphQLServer } from "graphql-yoga";
    import { resolvers } from "./resolvers/index";
    import { PrismaClient } from "@prisma/client";
    import "reflect-metadata";
    
    export interface Context {
      prisma: PrismaClient;
      request: any;
    }
    
    const main = async () => {
      const prisma = new PrismaClient();
    
      const server = new GraphQLServer({
        typeDefs: "./src/schema.graphql",
        resolvers,
        context: ({ request }) => ({ request, prisma } as Context),
      });
    
      server.start({ port: process.env.PORT || 4000 }, () => {
        console.log("The server is up!");
      });
    };
    
    main().catch(console.error);
    r
    n
    n
    • 4
    • 44
  • n

    Nichita Z

    06/22/2021, 2:23 PM
    (Reposting to make things clearer) I seem to have run into a bug related to the ‘selectRelationCount’ preview feature. This line causes the below error, but removing the ‘_count: true’ part makes it work. Anyone got any ideas on what is going on?
    this.prisma.user.findUnique({where: {id: 1}, include: {_count: true}})
    r
    • 2
    • 13
  • d

    dfau

    06/22/2021, 2:50 PM
    Hi there, I'd really appreciate it if someone could give me some pointers. I have a field I'd like to be autogenerated using a custom function. The closest thing I found in the docs is
    Copy code
    id   String  @id @db.Uuid @default(dbgenerated("gen_random_uuid()"))
    is there a way to use a function made by me instead of postgresql default one? For reference, my use case would be something like
    Copy code
    orderNumber BigInt @default(dbgenerated("random_between(99999, 1000000)"))
    r
    • 2
    • 4
1...447448449...637Latest