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

    adashi

    03/22/2021, 5:17 PM
    Turned out that I was using an old node version(v11.9.0). Updated to
    v12.15.0
    and everything works now. Would suggest that you add checks for node version numbers
    💯 1
    r
    • 2
    • 2
  • j

    Jaye

    03/22/2021, 6:29 PM
    any news on the "prisma not running on netlify" issue? or a funky workaround? i was hoping to do a demo for my company in a few days showing the end to end but it's failing at the last hurdle 😞 here's a repo to reproduce the problem and the issue i opened with next.js on the off-chance it's with them found this in netlify's forums, which doesn't look like it was ever resolved
  • w

    Warren Day

    03/22/2021, 9:06 PM
    When creating compound index's is it possible to findUnique on that index? For example I create an index on firstName and lastName, I know the combination would be unique within a table. I'm pretty sure the prisma client used to do this but the types are not generated in the latest version.
  • w

    Warren Day

    03/22/2021, 9:11 PM
    Got it, needed
    @@unique over @@index
    💯 1
  • v

    Vladi Stevanovic

    03/23/2021, 3:39 PM
    Hello everyone! At the upcoming Prisma Enterprise Event, Pete Hunt, Software Engineer at Twitter will join Søren Bramer Schmidt, CEO of Prisma to explore the evolution of application data platforms at Facebook and Twitter and shed light on the architectural foundations that enable such companies to appease the need for scalability, productivity, and security. I highly recommend checking it out! You can still register here.
    Invitation-07-02-Pete Hunt.mp4
    fast parrot 4
    prisma green 3
    🚀 3
  • m

    Michael Adlai Arnold

    03/23/2021, 5:36 PM
    Hey folks--I have a typescript repo that fails on tsc compilation with type errors. When I run
    sls package
    with your typescript plugin, however, it just logs those errors, but continues on its merry way. How do I configure the plugin to fail
    sls package
    on typescript compilation errors/warnings?
    j
    • 2
    • 1
  • t

    Trevor Radcliffe

    03/23/2021, 6:34 PM
    Hey all, not sure if this is the place to post this, as it's about the nexus-prisma plugin, but I'm having trouble getting the
    root
    object passed into my Nexus resolvers to contain my relation fields from Prisma. ie, imagine this as a resolver for
    tableA
    Copy code
    t.field('tableBFoo', {
          type: 'DateTime',
          async resolve(root, _args, { prisma }) {
            const valueB = prisma.tableB.findUnique({
              select: {
                foo: true,
          },
          where: {
            objectId: root.tableB.objectId,
          },
        })
        return valueB.foo
      },
    })
    root.tableA
    comes up null in this example. Not sure if this translates exactly, haven't tried it out, but the model for the above, if done the same way that we have it, should look like this:
    Copy code
    model TableA {
      objectId    String @id
      tableBId    String @map("tableB")
      tableB      TableB? @relation(fields: [tableBId], references: [objectId])
      
    }
    
    model TableB {
      objectId    String @id
      foo         String
    }
    I know what we're doing there is pretty weird, i.e., using the name we want for the relational field for the ID in our database...We're working with (and trying to replace) a legacy system, but we would prefer to use the names as expected. Is there a way to achieve this?
  • m

    Mitchell

    03/23/2021, 7:41 PM
    I’ve worked though the entire React + Apollo Tutorial. I’m having a few issues around subscriptions. I notice on the page Realtime Updates with GraphQL Subscriptions in the second code block there is a variable
    link
    that is defined but never used? Did I miss something earlier or is something missing here? https://www.howtographql.com/react-apollo/8-subscriptions/
    r
    • 2
    • 2
  • a

    ali

    03/23/2021, 9:54 PM
    Hi...looking for some guidance here. Based on https://www.prisma.io/docs/guides/general-guides/database-workflows/sql-views-postgres#5-manually-add-the-draft-view-to-the-prisma-schema I added my view as a model in the Prisma schema. In the future if I add another table in my schema, I want to continue using
    migrate
    to be able to create the table. Is it possible to skip creation of certain models through
    migrate
    because then
    migrate
    will try to create a table with the name of the view that I created.
    ➕ 1
    r
    t
    • 3
    • 2
  • m

    manuel

    03/24/2021, 1:37 PM
    Hey, I would need 2 minutes help please. How would I adjust this schema to have a family with Users[] and a familyOwnerId with the User?!?
    r
    • 2
    • 3
  • s

    Shane

    03/24/2021, 2:59 PM
    Hi, I am trying to start using
    prisma migrate
    with an existing DB (without resetting/losing my data), and finding the docs quite confusing -> https://www.prisma.io/docs/guides/application-lifecycle/add-prisma-migrate-to-a-project#baseline-your-production-environment It suggests using
    prisma migrate dev
    to establish a new migration history, but this tries to run a migration -- and fails, saying it's out of sync. Anyone able to show me the way? 🙏
    ✔️ 1
    r
    • 2
    • 9
  • s

    Shane

    03/24/2021, 5:26 PM
    Hello, what is the best way to overcome
    text
    column length limits? Prisma seems to set it to 191, without any way to specify in the schema, and I need much longer for some columns.
    e
    • 2
    • 2
  • s

    Shane

    03/24/2021, 5:27 PM
    If I extend the length directly (with MySQL) -- then next migration it says the schema has drifted, so I feel it may not be the best thing to do
  • e

    Ethan Zoller

    03/25/2021, 2:02 AM
    If I’m using Prisma in two services, same schema same db, what do I do if I don’t want to build a monorepo?
    j
    r
    • 3
    • 4
  • e

    Ethan Zoller

    03/25/2021, 2:03 AM
    Do I just copy and paste schema/migrations each time I make a change?
  • h

    hart

    03/25/2021, 6:35 AM
    I've been trying to figure out why the datasource isn't working for a couple of hours now. I changed from sqlite to postgres, and even though I lost all the data, prisma is now storing new records inserted by prisma studio somewhere. But it's not storing them in the postgres db
  • h

    hart

    03/25/2021, 6:39 AM
    I've regenerated the client, run db push, done a bunch of stuff already. I run this script:
    Copy code
    const { PrismaClient } = require('@prisma/client');
    const prisma = new PrismaClient();
    async function main() {
      const result = await prisma.mymodel.findMany({})
    }
    And I get the data that I inserted through prisma studio, but it's not the data in my postgres db, and it's not coming from the old sqlite one either as I've removed it
  • h

    hart

    03/25/2021, 6:41 AM
    My schema is
    Copy code
    datasource db {
      provider = "postgresql"
      url      = "<postgresql://postgres@localhost/mydb>
    }
  • h

    hart

    03/25/2021, 6:50 AM
    turning debug logging also gives me:
    Copy code
    prisma:info Started http server on <http://127.0.0.1:59079>
    prisma:info Fetched a connection from the pool
    I have no idea what this server is supposed to be
  • h

    hart

    03/25/2021, 6:52 AM
    The generated query:
    prisma:query SELECT "public"."MyModel"."id", "public"."MyModel"."name" FROM "public"."MyModel" WHERE 1=1 OFFSET $1
  • h

    hart

    03/25/2021, 6:52 AM
    what is this
    public.
    prefix
  • h

    hart

    03/25/2021, 7:09 AM
    gah.. figured it out. The table names are case-sensitive, and I had actually migrated my data from an old sqlite database; the prisma client was seeing new data I had inserted through studio, but I was seeing the migrated data from the psql client because I wasn't double-quoting the table names
    💯 2
  • j

    Joey

    03/25/2021, 9:13 AM
    Has anyone managed to setup
    prettier-plugin-prisma
    ? https://github.com/umidbekk/prettier-plugin-prisma
  • j

    Joey

    03/25/2021, 9:14 AM
    After doing
    yarn add -D prettier-plugin-prisma
    any other step/configuration needed?
  • n

    Nino Vrijman

    03/25/2021, 10:52 AM
    Will the talks at the Prisma Enterprise Event of today be recorded and published? 😄
    v
    • 2
    • 3
  • v

    Vladi Stevanovic

    03/25/2021, 12:59 PM
    We're just about to start the *Prisma* *Enterprise Event*! 🎉 If you want to share in the fun, you can answer the questions we're asking the audience (and see the answers) here: http://sli.do/prisma
    prisma green 2
    💯 1
    fast parrot 2
    💥 1
    💚 1
    z
    • 2
    • 4
  • p

    pizzafox

    03/25/2021, 5:40 PM
    prisma.io is currently down due to a Netlify outage (https://www.netlifystatus.com/incidents/r2nqshvznvyj) As a workaround visiting www.prisma.io works Prisma staff with access to the DNS should update the
    A
    record following the advice in that incident report
    v
    • 2
    • 1
  • s

    Sun Satel

    03/26/2021, 7:03 PM
    Prisma is being used as a main ORM tool for new stunning boiler plate "Bedrock"
    💯 1
    🚀 2
    fast parrot 2
  • s

    Sun Satel

    03/26/2021, 7:05 PM
    https://bedrock.mxstbr.com/tools/prisma/
  • e

    Ethan Zoller

    03/27/2021, 4:47 AM
    Are there any examples of someone building a shared Prisma client. To have a single schema be the source of all truth but be used through multiple repositories. Such as a private package that exports a Prisma client connected to the schema?
    r
    • 2
    • 1
1...424425426...637Latest