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

    Daniel Norman

    07/29/2021, 2:56 PM
    @Mahmoud and I will discuss the latest 2.28.0 release and other news from the Prisma ecosystem in a 

    livestream on YouTube▾

     starting in 5 minutes! 📺
    prisma rainbow 2
  • o

    Oluwasetemi Ojo

    07/29/2021, 3:48 PM
    got this error which trying to insert data into the db
    Copy code
    prisma.price.create()` invocation:\n\n\n  Error occurred during query execution:\nConnectorError(ConnectorError { user_facing_error: None, kind: RawError { code: \"263\", message: \"Cannot create namespace groovy_db.Price in multi-document transaction.\" } })
  • o

    Oluwasetemi Ojo

    07/29/2021, 3:48 PM
    I just added a replicaSet to my local uri
  • o

    Oluwasetemi Ojo

    07/29/2021, 3:49 PM
    Copy code
    DATABASE_URL="<mongodb://localhost:27017/groovy_db?replicaSet=rs0>"
  • o

    Oluwasetemi Ojo

    07/29/2021, 3:54 PM
    I had created some data in my db without using the replicaSet
  • c

    Chip Clark

    07/29/2021, 3:59 PM
    SOLUTION IN THE REPLIES I'm trying to get a subset of records back filtering on a array within the array of records. license = 3
    Copy code
    const whereClause = {
            {
              License: {
                every: {
                  LicenseTypeID: license
                }
              }
            }
        };
    Regardless of whether I user every: or some: it pulls all the records. There is no filtering going on.
    Copy code
    return Promise.all([
          this.prisma.person.findMany({
            take: perPage,
            skip,
            where: whereClause,
            include: defaultIncludeQuery
          })
    r
    • 2
    • 12
  • k

    khareta

    07/29/2021, 4:43 PM
    Is it possible to use the relation count with filter? if not, is there any available workaround? for example: I want to get items(with some filtering) and their counts(using _count or similar), but the count has to be based on the filter.
    r
    • 2
    • 1
  • v

    Val Neekman

    07/29/2021, 10:39 PM
    Folks - Anyone else is seeing this? Apple M1 /16Gig RAM. When I run the prisma studio, next morning, the mac freezes and a hard reboot is the only cure. Anyone?
  • d

    Dregond

    07/30/2021, 3:49 AM
    Hey all
  • d

    Dregond

    07/30/2021, 3:49 AM
    Anyone getting this error? prisma:error PANIC in query-engine\core\src\response_ir\internal.rs:334:86 called
    Option::unwrap()
    on a
    None
    value
    r
    • 2
    • 1
  • g

    Gelo

    07/30/2021, 5:54 AM
    Does prisma support webstorm ide for intellisense?
    r
    • 2
    • 1
  • a

    Arun Kumar

    07/30/2021, 8:18 AM
    Hi All, I'm getting the below error when trying to run the
    npx prisma migrate dev
    command.
    Copy code
    Error: P3006
    
    Migration `20210729200626_changing_the_id_and_id_referral_to_int` failed to apply cleanly to the shadow database. 
    Error:
    Database error
    Error querying the database: db error: ERROR: syntax error at or near ","
       0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
                 at migration-engine\connectors\sql-migration-connector\src\flavour\<http://postgres.rs:367|postgres.rs:367>
       1: sql_migration_connector::validate_migrations
                 at migration-engine\connectors\sql-migration-connector\src\<http://lib.rs:322|lib.rs:322>
       2: migration_core::api::DevDiagnostic
                 at migration-engine\core\src\<http://api.rs:89|api.rs:89>
    r
    • 2
    • 12
  • u

    user

    07/30/2021, 8:18 AM
    How to create a PostgreSQL Database with Prisma's Data Platform

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

    ◭ Version 2.28.0 Release notes: https://github.com/prisma/prisma/releases/tag/2.28.0 Prisma's 2.28.0 release includes some super convenient improvements to the project creation flow in the Prisma Data Platform. This allows you to provision a new PostgreSQL Database with Heroku, choose a template schema for common types of projects, and populate your Database with realistic example data, while creating a new project. In this video, Jon Meyers walks through creating a Spotify clone as a new Data Platform project. He sets up a Postgres DB, example schema and seed data, and also demonstrates how to add users to the project - sharing an instance of the Data Browser to collaborate on populating data. ◭ Data Platform docs: https://www.prisma.io/docs/concepts/components/prisma-data-platform ◭ Data Browser article: https://www.prisma.io/blog/prisma-online-data-browser-ejgg5c8p3u4x ◭ Launching the Prisma Data Platform:

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

    ◭ Announcing Early Access for Prisma's Online Data Browser:

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

    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
    prisma rainbow 1
  • p

    Patrick

    07/30/2021, 2:39 PM
    I get a `TypeError: this.prisma.user.findFirst is not a function`in my unit tests with this function:
    Copy code
    async getUserByMail(email: string): Promise<User | null> {
        // return this.prisma.user.findUnique({ where: { email } }); // <- this works
    
        // this fails in unit tests:
        return this.prisma.user.findFirst({
          where: {
            email: {
              equals: email,
              mode: 'insensitive',
            },
          },
        });
      }
    Anybody knows what the issue could be?
    findUnique
    works fine, but I need to find the mail case insensitive and
    findUnique
    doesnt seem to support this.
    r
    • 2
    • 5
  • c

    Christoph Dietrich

    07/30/2021, 3:14 PM
    Regarding to your prisma July Newsletter and Semantic Versioning … only “Major” Version Changes are allowed to have breaking changes. And not as some versions from Prisma with Minor changes in between 😉
    m
    • 2
    • 3
  • o

    Oluwasetemi Ojo

    07/30/2021, 3:17 PM
    In the newsletter there is a broken link - https://github.com/Ovyerus/prismaliser%20
    m
    • 2
    • 2
  • h

    Halvor

    07/30/2021, 3:35 PM
    Are multi column unique constraints not supported by prisma on postgresql? Trying this on the table with no result when looking at it in pgAdmin.
    Copy code
    @@unique(fields: [arbitratedId, userId])
    r
    • 2
    • 3
  • c

    Charles Dimino

    07/30/2021, 6:02 PM
    hey qq is there a way to check for the existence of a field on the model, e.g. I want to see if my “foobar” object has the “banana” field?
  • h

    hayes

    07/30/2021, 11:49 PM
    Hey! I've been working on something that makes building more efficient and type-safe GraphQL APIs with prisma much easier. I just released the first public preview version. If anyone is interested in checking it out, would love to hear any feedback https://giraphql.com/plugins/prisma
    💯 2
  • a

    alisalimli

    07/31/2021, 6:52 AM
    I am getting following error while running 'npx prisma migrate deploy' in docker image :
  • a

    alisalimli

    07/31/2021, 6:52 AM
    [13/14] RUN npx prisma migrate deploy:
    #18 5.127 Prisma schema loaded from prisma/schema.prisma #18 5.278 Error: Get config: /abb/node_modules/prisma/node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory ------ executor failed running [/bin/sh -c npx prisma migrate deploy]: exit code: 1
  • m

    Mohammed Alrea

    07/31/2021, 7:18 AM
    when I try to run my script I face this problem "generate-pal": "pal g", any hint that can help
    r
    a
    • 3
    • 2
  • j

    jasci

    07/31/2021, 10:01 AM
    Hello everybody, can you please tell what is the default behaviour regarding referentialActions for implicit n-n relations ?
    r
    • 2
    • 1
  • p

    Phil Bookst

    07/31/2021, 10:54 AM
    hey guys, how do you handle the heroku postgres credential rotation when deploying to vercel for example? i'm new to prisma and following this guide https://vercel.com/guides/nextjs-prisma-postgres but there is no section about the automatic rotation by heroku and how to deal with it
    m
    • 2
    • 1
  • k

    Kiên Trần

    07/31/2021, 12:17 PM
    Hello guys, I am wondering how prisma service can survive after my prisma container server restarted? My prisma service is supposed to be deleted with the container when I remove and start container again, right? But after I restarted the container which is my prisma server, I try to deploy again but it said the service is already exists.
  • h

    Halvor

    07/31/2021, 6:31 PM
    Are multi column unique constraints not supported by prisma on postgresql? Trying this on the table with no result when looking at it in pgAdmin.
    Copy code
    @@unique(fields: [arbitratedId, userId])
    r
    • 2
    • 1
  • a

    A DSJ

    08/01/2021, 2:37 PM
    Hi everyone, I need some help on my data modelisation, what i'm trying to do is : • Reference a group ID in User model. A user can only be in one group, this is what i've done below • Reference in Group Model all users that are inside a group. This is what I need help with.
    Copy code
    model User {
      id         String   @id @default(uuid())
      email      String   @unique
      role       Role     @default(USER)
      group      Group?   @relation(fields: [group_id], references: [id], onDelete: SetNull) 
      group_id   String   
      created_at DateTime @default(now())
      updated_at DateTime @updatedAt
    
      @@map("user")
    }
    
    model Group {
      id         String   @id @default(uuid())
      name       String
      users      User[]
      created_at DateTime @default(now())
      updated_at DateTime @updatedAt
      deleted    Boolean  @default(false)
    
      @@map("group")
    }
    How can I make this list of User when I already have users User[] for the relation in User model ? (BTW i've read the doc but i'm totally lost...) Thanks a lot !
    r
    • 2
    • 8
  • j

    John Benton

    08/02/2021, 1:14 PM
    Hey guys, loving Prisma so far! Im a bit of an SQL newbie though, and feeling a bit lost at the moment:
    Copy code
    model Match {
       id String @id
       team1 User[]
       team2 User[] 
     }
    
     model User {
       id String @id
       matches Match[]
     }
    r
    • 2
    • 5
  • j

    John Benton

    08/02/2021, 1:14 PM
    Obviously this doesn't work but I was wondering if what I'm trying to do is possible?
  • j

    John Benton

    08/02/2021, 1:16 PM
    Woops I'll ask this on github instead, sorry for spamming 😉
1...465466467...637Latest