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

    Moonchild Everlasting

    04/04/2022, 1:26 PM
    hi
  • m

    Moonchild Everlasting

    04/04/2022, 1:27 PM
    im trying to setup a prisma -nx through tutorial but it uses 2.0 and not 3.0 can anyone help?
    a
    j
    • 3
    • 2
  • g

    genedy

    04/04/2022, 3:42 PM
    Is there a away for initialize prisma with a table before start my application in production mode ?
    n
    • 2
    • 1
  • m

    Márcio Martins

    04/04/2022, 3:43 PM
    Hi guys, is there a way to debug what the CLI is doing? like a --verbose?
    n
    j
    • 3
    • 3
  • t

    Todor Majstorovic

    04/04/2022, 4:54 PM
    Hey, does anyone know if this is the default prisma work or not, basically it looks like it internally resolves select * in (array) as multiple array.length findUniques ? This is causing us issues since on some queries there are a lot of id's in array, and our DB gets 100% CPU overload
    n
    • 2
    • 3
  • t

    Todor Majstorovic

    04/04/2022, 4:54 PM
  • h

    Hector Grecco

    04/04/2022, 10:34 PM
    Hi!
    👋 1
  • h

    Hector Grecco

    04/04/2022, 10:34 PM
    Has anyone worked with encryption in Prisma or built one from scratch using middlewares?
    n
    j
    • 3
    • 3
  • k

    Kid Coder

    04/05/2022, 5:44 AM
    Hey! I was wondering what an idiomatic way to query a DB using regex is! (If there even is one, and if there isn't how to effectively emulate the functionality)
    n
    • 2
    • 2
  • f

    Frankie Dox

    04/05/2022, 5:46 AM
    Hey everyone! I was wondering if anyone knew if Prisma has any libraries or tools to support U2F, FIDO, and Yubikey. If so, please direct to me the resource. Thank you and have a great day!
    n
    j
    • 3
    • 9
  • a

    Alihan aydın

    04/05/2022, 10:04 AM
    hi I got this error
    property) email_?:_ string _|_
    undefined
    Type 'string | null | undefined' is not assignable to type 'string | undefined'.
    Type 'null' is not assignable to type 'string | undefined'.ts(2322)
    in this code
    _if_ (session) {
    const result = await prisma.post.create({
    data: {
    title: title,
    content: content,
    author: { connect: { email: session?.user?.email } }
    }
    })
    how can i fix this? my schema prisma models:
    model
    _Post_ {
    id        Int       _@id_
    _@default_(autoincrement())
    title     String
    content   String_?_
    published Boolean   _@default_(_false_)
    author    _User_
    _@relation_(fields: [authorId], references: [id])
    authorId  Int
    comments  _Comment[]_
    Tags      _Tag[]_
    _@relation_("TagToPost")
    tagId     Int_?_
    }
    model
    _User_ {
    id            Int       _@id_
    _@default_(autoincrement())
    name          String_?_
    email         String    _@unique_
    _@default_("no email")
    emailVerified DateTime_?_
    _@map_("email_verified")
    image         String_?_
    createdAt     DateTime  _@default_(now()) _@map_(name: "created_at")
    updatedAt     DateTime  _@updatedAt_
    _@map_(name: "updated_at")
    posts         _Post[]_
    accounts      _Account[]_
    sessions      _Session[]_
    Comment       _Comment[]_
    _@@map_(name: "users")
    }
    n
    i
    • 3
    • 2
  • u

    user

    04/05/2022, 2:00 PM
    Prisma Adds Support for MongoDB — Join Our Launch Week Celebrations 🎉 We are excited to share that today's Prisma ORM release adds stable and production-ready support for MongoDB! Join our celebrations during the launch week April 25-29.
    prisma rainbow 2
    🍃 1
    ❤️ 3
  • s

    Saaharjit Singh

    04/05/2022, 4:24 PM
    Hi, is there a doc on how to integrate Prisma deploy with Harness CI/CD pipeline? I am not an expert on Harness, it would make our setup process alot easier if there’s already a doc out there on how to integrate prisma with Harness
    n
    • 2
    • 1
  • m

    Merlin G

    04/05/2022, 4:33 PM
    Is there a known issue with the docs? https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-aws-lambda
    Copy code
    Internal Server Error - Request ID: 01FZX93WCYBX4G5AY19NDJJ9BN
    n
    • 2
    • 2
  • g

    Glaucia Lemos

    04/06/2022, 1:14 AM
    cc: @Alex Ruheni @nikolasburk @janpio Hi, everyone! I had some issues when I decided to update to version 3.12.0 to build my application using Azure Functions with GitHub Actions. So, to fix this issue, I had to downgrade to 3.11.0 as you can see here: https://github.com/glaucia86/azuresql-prisma-talk/blob/main/.github/workflows/azure-static-web-apps-mango-sky-0a5cbaf1e.yml#L36 And here the commits with changes https://github.com/glaucia86/azuresql-prisma-talk/commit/cb514e1e01ff1ee060932c231e5fba828828cbc8 https://github.com/glaucia86/azuresql-prisma-talk/commit/03b86980eead1b2f8ec5e55d5a643348af765554 Any ideia what it should be?
    a
    j
    • 3
    • 21
  • a

    Alex Cavazos

    04/06/2022, 3:09 AM
    Does someone know if it is possible to make a
    where
    clause that only returns rows where a specific column is
    null
    ?
    ✅ 1
    j
    • 2
    • 2
  • s

    Slackbot

    04/06/2022, 3:16 AM
    This message was deleted.
    v
    • 2
    • 1
  • v

    Vignesh T.V.

    04/06/2022, 7:01 AM
    Hi. Just a quick question. I have been working with fullTextSearch with prisma and postgres and things were working well till I noticed this case. This is the string I am searching for from the table: "Select the SOAP header that does not exist in API 29.0 and earlier versions up to 14.0 and might not be seen in WSDL" This is the search term I am using: "API+29.0" And it does not return any record. But 29.0 returns and API returns. For some reason alpha numeric search does not seem to work in
    fullTextSearch
    Any idea why?
    n
    j
    h
    • 4
    • 6
  • h

    haider shahid

    04/06/2022, 12:45 PM
    Hello I am having a small problem I have a schema with type Json in it . When I try to insert data without query variables works but when I try to parameterise it. it fails. mutation updatePropertyReport( $mlsListingObject: Json, $mlsID: String){ updatePropertyReport( data:{ mlsListingObject: $mlsListingObject }, where{mlsID $mlsID} ){ id mlsID mlsListingObject } } query variables { "mlsID": "14691538", "mlsListingObject":"{\"_id\":\"14691538\"}" } The following works the above doesn't with mutation updatePropertyReport( $mlsID: String){ updatePropertyReport( data:{ mlsListingObject: "{\"_id\":\"14691538\"}" }, where{mlsID $mlsID} ){ id mlsID mlsListingObject } }
    j
    • 2
    • 6
  • u

    user

    04/06/2022, 1:00 PM
    Fullstack App With TypeScript, PostgreSQL, Next.js, Prisma & GraphQL: Deployment This article is the final part of the course where you build a fullstack app with Next.js, GraphQL, TypeScript, Prisma, and PostgreSQL. In this article, you will learn how to deploy your app to Vercel.
    fast parrot 3
  • m

    Moishi Netzer

    04/06/2022, 1:49 PM
    Heya! I have a question, I have to make a todo app where users get the same tasks to do each day, what would be the best way to structure this in my prisma schema? Would love some opinions/ideas on this thanks!
    n
    • 2
    • 1
  • m

    Matias Vallone

    04/06/2022, 2:52 PM
    hi, is it possible to parameterize the
    include
    field of a query and still retain the Typescript types? eg:
    Copy code
    export const findById = async (id: number, include: Prisma.ClaimInclude | undefined = undefined) => {
        return dbClient.claim.findUnique({
            where: {
                id,
            },
            include,
        })
    }
    and use it like this:
    const claim = await findById(claimId , { assignedTo: true, })
    currently I cannot access
    claim.assignedTo
    Property 'assignedTo' does not exist on type 'Claim & {}'. Did you mean 'assignedToId'? ts(2551)
    thanks
    t
    • 2
    • 5
  • t

    trompx

    04/06/2022, 3:07 PM
    Hello, when interacting with DB, I prefer to avoid ORM and write raw queries (I can easily use another tool if I want to switch or if it is not maintained anymore). I was about to use something like slonik/zapatos/postgres.js/pgtyped instead of prisma but I saw you have typesafe raw queries (https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access). 1. Does prisma does the same thing as the aforementioned libraries do? Or there is an additional abstraction layer resulting in poorer performance compared to those libraries? 2. In the case prisma is slower, is it possible to use of one those library jointly with prisma based on the types generated by prisma (like leverage prisma for basic crud and one of those tools for more complex queries)? It would also allow to use some field type (like ltree) which are still not supported by prisma even in a raw query. Also I saw there is a huge list of issues with prisma raw queries so I am a bit hesitant (https://github.com/prisma/prisma/issues/12367). Thanks in advance
    a
    j
    • 3
    • 10
  • a

    Aaron Waller

    04/06/2022, 5:32 PM
    Is it possible in Prisma to give the client the choice on what data Prisma should query? I’m using Prisma with Apollo and I want to give my user the option to filter the content however he likes. The problem is I cannot write thousands of query resolvers for every possible combination the user selects in his filters. For example I want to give the user the option to query all users with age > 20, profile picture = yes, location = Germany etc. And another user queries for the same but additionally where isActive = true. In this case as far as I understood it correctly I have to write two queries: example 1:
    query1: (parent, args) => {
    return prisma.users.findMany({
    where: {
    age: {
    gte: 20
    },
    profilepicture: true,
    location: 'Germany'
    }
    })
    }
    and because the second user wants the same query but also wants to know if the person is active I have to create a complete new query for this case? example2:
    query2: (parent, args) => {
    return prisma.users.findMany({
    where: {
    age: {
    gte: 20
    },
    profilepicture: true,
    location: 'Germany',
    isActive: true
    }
    })
    },
    h
    • 2
    • 4
  • k

    Kharann

    04/06/2022, 5:53 PM
    Anyone who have implemented prisma as a package in a monorepo? I have an
    apps/
    and a
    packages/
    folder. In
    apps/core-api
    , I'm using
    packages/db
    , which includes an index file that does
    export * from "@prisma/client@
    . I'm however having trouble if important this re-export of prisma client. I get
    the requested module does not export a module named  PrismaClient
    or
    no default exports from @prisma/client
    when trying to use default import. I'm running a monorepo with yarn workspace 3 and I do think that there might be a problem of finding the types? I'm not sure what to do. Would love an example. I'm also running full esm with
    nodemon --exec 'node --loader ts-node/esm --experimental-specifier-resolution=node src/index.ts'
    as my run command.
    n
    • 2
    • 3
  • a

    Arthur Cachero

    04/06/2022, 9:03 PM
    I am loving building my first DB with Prisma! Thank you so much for this amazing tool! The customer support is also top notch!
    🙌 3
    n
    • 2
    • 1
  • h

    Hebilicious

    04/07/2022, 2:40 AM
    Has anyone been able to use Supabase and Data Proxy successfully ? I keep getting this error message when trying to connect to the db (connection pool being disabled on supabase end)
    n
    • 2
    • 1
  • j

    Justin Ellingwood

    04/07/2022, 10:04 AM
    Hey there 👋 We just published a new article on the Data Guide on setting up PostgreSQL databases in RDS: https://www.prisma.io/dataguide/postgresql/setting-up-postgresql-on-rds
    🙌 4
  • m

    Med

    04/07/2022, 10:56 AM
    Hey Everyone so we have been using prisma fora while. I had a relation on one of the models and it had the
    @unique
    tag on that relation. I have removed the unique tag because we changed the structure of the DB however
    prisma migrate
    does not see the change and says the schema is in sync with the DB but it is not as my db still has the unique foreign key constraint. Anyway I can get the
    migrate
    system to pick up this change to for the change of the constraint?
    a
    j
    • 3
    • 7
  • l

    Levi

    04/07/2022, 1:25 PM
    Copy code
    error - ../../packages/prisma/node_modules/@prisma/client/runtime/index.js:27652:0
    Module not found: Can't resolve '_http_common'
    j
    • 2
    • 1
1...560561562...637Latest