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

    Dhwanik Panchal

    05/23/2022, 5:52 PM
    Hey everyone! I am working on a project and we are currently using Sequelize (MySQL) with TypeScript. Today, I suggested my tech lead to use Prisma instead of Sequelize because the latter one doesn't had a good TypeScript support. She's almost convinces but she has a couple of questions/concerns regarding Prisma over Sequelize: 1. As we all know, Prisma uses only one
    prisma.schema
    file for data modelling. Let's suppose. the application grows and so do the number of database tables. Since all the models will be in one schema file does it impact performance in any way? 2. Related to previous question, can we separate models in
    prisma.schema
    file across multiple "schemas"? Thanks!
    s
    n
    • 3
    • 2
  • m

    Mathie

    05/23/2022, 9:44 PM
    Hello, I would like to create an entry, which is related to a parent. How to create the child if the parent does not exist? Upsert doesn't allow me to do it...
    n
    • 2
    • 1
  • n

    Nilay Kothari

    05/24/2022, 2:20 AM
    Hey, After updating prisma version to 3.14.0, my active connection count for postgres stick to around 100 even if no one is using or no query being executed. Before updating it was releasing active connections. Anyone has any idea about this?
    n
    • 2
    • 3
  • b

    Blair

    05/24/2022, 4:02 AM
    Hi all, I have a fairly complex authorisation requirement which I'm hoping prisma can help me solve: A basic data model:
    users: N patients: N referrals: N referral_notes
    • User has many patient records • Patient records have many referrals • Referrals have many referral_notes I need to enforce rules similar to these: • A
    user
    may be granted access to a
    referral
    through their
    patient
    record. • A
    user
    may be granted access to a
    referral
    explicitly via a record in another table (
    permissions
    table) • Whenever a user has access to a
    referral
    , they automatically have access to view
    referral_notes
    I have tried to use
    graphql-guard
    with prisma as a POC, but not sure if this is the correct combination of tools for this use case. Any help would be hugely appreciated. 🙏
    n
    a
    • 3
    • 5
  • b

    Brothak

    05/24/2022, 6:05 AM
    Anyone from the prisma team has an idea about https://prisma.slack.com/archives/CA491RJH0/p1653296873618179. Seems like error coming from Prisma engine. At least I would be curious if I can get more debug information about what value / column is causing the issue. It’s hard to debug this.
    n
    • 2
    • 5
  • n

    Nima

    05/24/2022, 9:46 AM
    Hi @janpio / @Ruheni Alex / @Nurul it seems the cloud prisma data browser stopped working for us this morning
    n
    r
    • 3
    • 8
  • m

    Mark Hovsepyan

    05/24/2022, 12:44 PM
    Hello, I think this might be a known thing but I struggle to find any solution. So I am using prisma and prisma client 3.14.0 as of now, and I wish to sort by relation like the following: const posts = await prisma.post.findMany({ orderBy: { author: { email: 'asc', }, }, }) Above is the documentation example, and I am struggling to implement this on my own schema. Where in the following query: let nodes = await prisma.node.findMany({ orderBy: { transactions: { time: 'desc', } }, }) prisma throws an error stating that `Unknown arg
    time
    in orderBy.transactions.time`
    n
    • 2
    • 5
  • m

    Mark Hovsepyan

    05/24/2022, 12:45 PM
    is there a solution for ordering by relation attribute?
  • j

    Jason Kleinberg

    05/24/2022, 12:51 PM
    I am having trouble connecting to AWS RDS (MySQL) over ssl. I haven’t been able to figure out the ssl settings. Has anyone here connected successfully this way?
    n
    • 2
    • 2
  • s

    Slackbot

    05/24/2022, 1:32 PM
    This message was deleted.
    h
    • 2
    • 1
  • u

    user

    05/24/2022, 1:40 PM
    Prisma Support for CockroachDB Is Production Ready 🪳 On May 10th, we were thrilled to release version 3.14.0 of Prisma ORM, which brought CockroachDB support to GA! This production-ready feature allows developers to make use of a scalable and resilient database.
    prisma rainbow 3
    🪳 2
  • b

    Berian Chaiwa

    05/24/2022, 2:11 PM
    I want to add these four fields to all my models. Is there a DRY PRISMA way to do this?:
    Copy code
    // Timestamps
      created_at       DateTime @default(now()) @db.Timestamptz()
      created_by       String
      last_modified_at DateTime @updatedAt @db.Timestamptz()
      last_modified_by String
    n
    • 2
    • 3
  • m

    Moaaz

    05/24/2022, 2:16 PM
    Hey folks – we’ve continuously been running into max connections issues when using Prisma on a Node Typescript server, with a GCP Cloud Storage Postgres db with pgbouncer. connection limit string on the Prisma db url connection is set to
    500
    pgbouncer
    defaultPoolSize
    is
    700
    , with
    maxClientConn
    set to
    10000
    Trying to understand, what order of connections seems to be normal for a medium scale use of the Prisma API. We have on the order of 1000s of users making requests at the same time.
    n
    • 2
    • 3
  • t

    Tharshan

    05/24/2022, 2:49 PM
    Does anyone use a platform or service that can take a Prisma schema and generate automatic CRUD UI for it? I also want to be able to extend for custom operations. I like the Prisma Studio and it’s great for simple things - but in general it’s slow and find it too cumbersome when you have highly relational data.
    o
    j
    +2
    • 5
    • 5
  • b

    Berian Chaiwa

    05/24/2022, 4:01 PM
    Hello here. This error is driving me crazy. I have re-installed @prisma/client but no luck. Any hints?
    Copy code
    Error: Could not resolve @prisma/client despite the installation that we just tried.
    Please try to install it by hand with yarn add @prisma/client and rerun yarn prisma generate 🙏.
    j
    n
    • 3
    • 12
  • r

    Rahul Taing

    05/24/2022, 5:34 PM
    I have a node module (call it foo) that has its own schema/tables. This node module is getting imported into a service that has its own schema/tables. Service accesses its own and foo's tables using api's exposed via foo. how do I migrate this to prisma? I can have foo generate a prisma client and use it in the service, but service would need a client that knows about its tables as well? Basically I would have 2 schema.prisma one from the dependency (foo) and one from the service. Any suggestions?
    j
    r
    n
    • 4
    • 10
  • j

    Jason Kleinberg

    05/24/2022, 6:53 PM
    Can anyone think of a reason why the prisma cli can connect to our database, but Prisma itself can’t when the connection string is the same? Same environment too.
    😕 1
    r
    • 2
    • 8
  • r

    Richard Ward

    05/24/2022, 7:11 PM
    I finally got a typescript based AWS SAM Lambda working with 1 layer containing the prisma client and another layer with "business logic" libraries.. I'll do a blog post ..
    🙌 2
    prisma rainbow 1
    n
    • 2
    • 1
  • s

    Steven Kuck

    05/24/2022, 8:17 PM
    I'm trying to use Prisma to connect to an AWS RDS instance with no public IP (only available on the VPC) and requires SSL. When we do a
    prisma db pull --schema <our schema file with connection string>
    it connects and sees the database tables and works. When we try to start up the app (which runs fine against local copies of the database) with the same connection string we get error logs of
    Copy code
    UnhandledPromiseRejectionWarning: Error: Can't reach database server at `<our.rds.instance>.<http://rds.amazonaws.com|rds.amazonaws.com>`:`3600`
    This is the format of our connection string.
    Copy code
    mysql://<user>:<pass>@<our.rds.instance>.<http://rds.amazonaws.com:3306/<database>?pool_timeout=10&connect_timeout=10&sslcert=<ourcert.pem|rds.amazonaws.com:3306/<database>?pool_timeout=10&connect_timeout=10&sslcert=<ourcert.pem>>
    Could not having a public IP be causing a connection issue in the Rust code? It's not even getting to the "Authentication failed" which is what happens if I leave off the sslcert when doing a db pull.
    j
    n
    • 3
    • 10
  • k

    Kelly Copley

    05/25/2022, 1:47 AM
    Is it possible to create relationships between one model, and several other models. Something like Posts, Photos, etc. all have comments where all comments live in the comment table?
    ✅ 1
    r
    n
    • 3
    • 8
  • m

    Matt O

    05/25/2022, 2:47 AM
    hello all, can anyone point to a "full stack" starter repo that includes: • prisma • gql • react • synced types (and autogenerated react hooks if possible) • ** everything in typescript
    r
    t
    n
    • 4
    • 4
  • b

    Brothak

    05/25/2022, 8:20 AM
    How do you cancel all running prisma queries for a request? I want to do it when a request is taking longer than 30s.
    n
    • 2
    • 3
  • b

    Brothak

    05/25/2022, 8:24 AM
    Actually I am not the first one to ask this. https://prisma.slack.com/archives/CA491RJH0/p1643914926477619. Was there any update since then?
  • b

    Brothak

    05/25/2022, 8:24 AM
    cc @Ryan Delaney
  • b

    Brothak

    05/25/2022, 8:26 AM
    Issue with calling $disconnect seems to be that in cancel all queries across all clients / requests
  • m

    Mathie

    05/25/2022, 9:50 AM
    Hello ! Is it possible to update the Date field of my Table to NOW(), every time I update the row? Without doing it in my code
    i
    n
    • 3
    • 3
  • a

    Andrea

    05/25/2022, 11:33 AM
    Hi to all! I'm trying to get a project done with Fastify and Prism moved inside Docker that will then need to run inside Kubernetes. My doubt originates from the output generated by command
    prisma migrate
    . The command has as output "`Generated Prisma Client (3.14.0 | library) to ./node_modules/@prisma/client in ....`". My question is the following: does prisma migrate, update only the db or also the filesystem? If it also updates the filesystem, are the changes negligible or at the start of each container do I have to migrate first so that it updates the filesystem?
    j
    • 2
    • 3
  • a

    Austin Zentz

    05/25/2022, 1:34 PM
    Has anyone experienced issues where Prisma takes up a good bit of memory compared to other ORMs, especially after retrieving larger data sets? I notice this in Heroku, where the starter apps have just 512MB of RAM.
    n
    • 2
    • 3
  • c

    Colin OBrien

    05/25/2022, 2:54 PM
    Any issues/plans for Cassandra support?
    n
    • 2
    • 3
  • c

    Colin OBrien

    05/25/2022, 2:55 PM
    oh nice, roadmap https://www.notion.so/Prisma-Roadmap-50766227b779464ab98899accb98295f love a good roadmap
    🙌 4
1...578579580...637Latest