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

    user

    09/07/2021, 6:25 PM
    Modernizing a 10-year-old SQL Server project using Prisma | Interview | Luís Rudge & Daniel Norman

    https://www.youtube.com/watch?v=IhM-9sydXko▾

    In this video, Daniel Norman from the Prisma team interviews Luís Rudge about his experience using Prisma to modernize a 10-old project written in .NET and Microsoft SQL Server. They discuss the following questions: - How Luís you use Prisma these days? - What technology stack did Luís use to build the project 10 years ago? - How was Luís' experience modernizing a 10-year-old project with Prisma? What role did introspection have? - Since Luís has already used Prisma with other databases in other projects, how Luís compares Prisma in greenfield (new) vs. brownfield (existing) projects? Timestamps: 01:00 How Luís uses Prisma these days? 02:00 What technology stack did Luís use to build the project 10 years ago? 05:45 What is introspection and how did Luís use it to adopt Prisma in an existing project 10:00 Modernizing the project and coupling between the frontend and backend. 12:00 Comparing Prisma experience in a green field vs brown field project 14:45 Adopting a new, modern naming convention 17:06 Working with different databases using Prisma ------------------------ More about Luís Rudge: Luís Rudge has been a father and developer for years. He currently works remotely as a Frontend developer for Browze.com, a Canadian company. He is also a professor at Platzi, where he creates courses for those who want to learn more about the main development technologies. Co-founder of the company DePoster - Som no Quadro, focused on bringing innovations to the residential decoration market. Twitter: https://twitter.com/luisrudge LinkedIn: https://www.linkedin.com/in/luisrudge/ ------------------------ 📚 Resources: ✅ Subscribe to Prisma: https://www.youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w?sub_confirmation=1 ✅ Get help from the Prisma Community: https://slack.prisma.io/ ✅ Learn more about Prisma: ◭ Website: https://www.prisma.io ◭ Docs: https://www.prisma.io/docs ◭ Quickstart: https://pris.ly/qstart ------------------------ 💬 Connect with Prisma: Twitter: https://twitter.com/prisma Instagram: https://www.instagram.com/prisma.io/ TikTok: https://www.tiktok.com/@prismadata Facebook: https://www.facebook.com/prisma.io LinkedIn: https://www.linkedin.com/company/prisma-io ------------------------ Prisma sponsors human-reviewed, professional closed captions for ANY video valuable to our community (for example, about: Node.js, TypeScript & Type Safety, Prisma, databases, etc). Get your FREE captions here: https://pris.ly/closedcaptions
  • n

    Nathaniel Babalola

    09/07/2021, 7:10 PM
    Hi please does anyone know how to use Prisma with Heroku Postgres? It just doesn't seem to be working.
    prisma migrate dev
    doesn't work
    m
    r
    • 3
    • 11
  • c

    Chip Clark

    09/07/2021, 9:43 PM
    Getting an error upgrading to 3.0 error: Error parsing attribute "@relation": When any of the records in models
    HRDepartment
    ,
    JobTitle
    ,
    JobType
    ,
    LegalDepartment
    ,
    OfficeLocation
    ,
    Person
    ,
    Photo
    are updated or deleted, the referential actions on the relations cascade to model
    PersonRelationship
    through multiple paths. Please break one of these paths by setting the
    onUpdate
    and
    onDelete
    to
    NoAction
    . (Implicit default `onUpdate`:
    Cascade
    ) Read more at https://pris.ly/d/cyclic-referential-actions --> schema.prisma:602 | 601 | ValidToDate DateTime 602 | RelatedPerson Person @relation(name: "RelatedPerson", fields: [RelatedPersonID], references: [PKPersonID]) 603 | SupportedPerson Person @relation(name: "SupportedPerson", fields: [RelatedPersonID], references: [PKPersonID])
    Copy code
    model PersonRelationship {
      PersonRelationshipID Int              @id @default(autoincrement())
      PKPersonID           Int
      RelationshipTypeID   Int
      RelatedPersonID      Int
      Description          String?          @db.VarChar(Max)
      Active               Boolean
      ActiveFromDate       DateTime         @db.Date
      ModifiedDate         DateTime         @db.DateTime
      ModifiedBy           String           @db.VarChar(30)
      ValidFromDate        DateTime
      ValidToDate          DateTime
      RelatedPerson        Person          @relation(name: "RelatedPerson", fields: [RelatedPersonID], references: [PKPersonID], onDelete: NoAction, onUpdate: NoAction)
      SupportedPerson      Person          @relation(name: "SupportedPerson", fields: [RelatedPersonID], references: [PKPersonID], onDelete: NoAction, onUpdate: NoAction)
      Person               Person          @relation(name: "PrimaryPerson", fields: [PKPersonID], references: [PKPersonID], onDelete: NoAction, onUpdate: NoAction)
    
      RelationshipType     RelationshipType @relation(fields: [RelationshipTypeID], references: [RelationshipTypeID])
      
      @@unique([PKPersonID, RelatedPersonID, RelationshipTypeID], name: "nclunq_PersonRelationship_PKPersonID_RelatedPersonID_RelationshipTypeID")
    }
    t
    j
    • 3
    • 18
  • k

    kkangsan

    09/08/2021, 6:56 AM
    Is it possible to set prisma file to ts file? I want to set the db url to the config library. (If you know the example code, please let me know.) config lib : https://www.npmjs.com/package/config
    r
    • 2
    • 3
  • d

    Dev__

    09/08/2021, 9:53 AM
    currently I am using prisma v2.30. In the
    schema.prisma
    file my editor is showing that
    orderByRelation
    and
    referentialActions
    are deprecated as preview features. But as far as I understood these are non-preview feature in the latest v3 of prisma. isnt this misleading, what If I removed those feature, it then would break my application because I havent upgraded to v3?
    r
    • 2
    • 1
  • h

    Harsha MV

    09/08/2021, 10:12 AM
    hey everyone
    👋 2
    r
    d
    • 3
    • 3
  • p

    Phil Bookst

    09/08/2021, 11:47 AM
    hey i'm using prisma and supabase for my vercel deployment but cannot get the ssl cert for my db to work... i've inspected this issue https://github.com/prisma/prisma/issues/1673 but was of no use - locally it works but in my production deployment i always get an io error that the file is missing has anybody solved this in their vercel deployment?
  • a

    Ash B

    09/08/2021, 1:12 PM
    Hi, I am enjoying prisma a lot, thanks for making it so easy to use. I was wondering what the best approach is to sum a column in a table, but have the sums grouped by a distinct relation. For example, imagine you had a table of stockTrades, and each stockTrade row had a relation to a user who made the trade. Another column is the profit/loss for that trade. What is the most efficient way to grab each distinct user, and sum their total profit/loss? The only way I could think of was to grab each distinct user in one query, and then loop through each user and count each profit/loss, but that would create 1 query per user in the table which wouldn't scale well. Thanks for any help!
    r
    • 2
    • 2
  • h

    Harsha MV

    09/08/2021, 1:55 PM
    When i have relation like.. Project hasMany Categories.. but some times i dont wanna change the Categories
  • h

    Harsha MV

    09/08/2021, 1:55 PM
    how can i allow it to be null
  • h

    Harsha MV

    09/08/2021, 1:56 PM
    i have removed the ? againt the ID but still it does not add the record
  • h

    Harsha MV

    09/08/2021, 1:56 PM
    even when i try from Prisma studio
  • h

    Harsha MV

    09/08/2021, 1:56 PM
    projectCategoryId String
    r
    • 2
    • 1
  • h

    Harsha MV

    09/08/2021, 1:57 PM
    thats my schema in prisma model
  • k

    Kent C. Dodds

    09/08/2021, 1:58 PM
    I need Prisma stickers. Lots of them. Where can I get some?
    prisma rainbow 5
    💚 3
    v
    • 2
    • 2
  • h

    Harsha MV

    09/08/2021, 2:33 PM
    anyway to debug.. why data doesnt get add via seed file?
    r
    • 2
    • 5
  • a

    Andrés Rodríguez

    09/08/2021, 3:36 PM
    Hello 👋 I’m setting up Prisma and working on the integration test setup. I have a “reset” step to clear up my DB and using the
    TRUNCATE
    command (postgres). However, the example here doesn’t work. Throws the following error:
    Copy code
    PrismaClientValidationError: `$queryRaw` is a tag function, please use it like the following:
    
    const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'<mailto:user@email.com|user@email.com>'};`
    Now, if I make this change:
    Copy code
    await prisma.$queryRaw`TRUNCATE TABLE "public"."${tablename}" CASCADE;`;
    I get the following error:
    Copy code
    Invalid `prisma.queryRaw()` invocation:
            
            
    Your raw query had an incorrect number of parameters. Expected: `0`, actual: `1`.
    I know the other option would be using many
    deleteMany()
    but I want to try using
    TRUNCATE
    before I get into the weeds there. I’m using the latest versions (3.0.1)
    d
    m
    • 3
    • 9
  • t

    Tyler Clendenin

    09/08/2021, 7:18 PM
    I want to find out if it is possible or request a few features related to disconnecting relations. I didn't see anything when searching the Issues, but I cannot imagine that these feature requests haven't been made before. 1. Exclusively update relation - The idea is that if I pass in 2 records that I want to have related to a model and i know that no other records should be related, it should automatically run the query to disconnect any other records that don't match. 2. Connect/Disconnect via where - Instead of having to declare each record to connect/disconnect, the relation could include the ability to add a where clause independent of the unique constraints. ex. If I want to disconnect all Posts from users who are marked as deleted, or connect a Post to all tags created in the last 10 days (these are kinda stupid use cases, but off the top of my head)
    d
    r
    • 3
    • 9
  • f

    Francisco

    09/08/2021, 10:49 PM
    hey!
  • f

    Francisco

    09/08/2021, 10:50 PM
    Is it possible to run only the tests on a sqlite?
    r
    • 2
    • 1
  • p

    Pierre Ortega

    09/08/2021, 11:43 PM
    if it was, how confident would that make you that your code works if you are deploying on a postgresql?
  • g

    Gelo

    09/09/2021, 12:22 AM
    email: {endsWith: [some domains]} is this possible?
    r
    • 2
    • 1
  • g

    Gelo

    09/09/2021, 12:22 AM
    or any other approach
  • a

    Ahmed Adly

    09/09/2021, 12:59 AM
    Hello everyone, any idea about mongodb General availability?
    j
    • 2
    • 2
  • g

    Gelo

    09/09/2021, 3:03 AM
    Do I have to run prisma generate on production build or just migrate deploy?
    r
    • 2
    • 1
  • v

    Venu

    09/09/2021, 7:53 AM
    how do i access the User fields from the Prisma return type?
    Copy code
    @Injectable()
    export class AuthService {
      constructor(
        private readonly userService: UserService,
        private readonly jwtService: JwtService,
      ) {}
    
      validate(userCreds: Prisma.UserWhereUniqueInput, password: string): UserModel | null {
        
        const user = this.userService.getUserByEmail(userCreds);
    
        if (!user) {
          return null;
        }
    
        let returnedUserPassword = user.
    r
    • 2
    • 4
  • d

    Daniel Norman

    09/09/2021, 2:50 PM
    https://twitter.com/daniel2color/status/1435975143340261381
    prisma rainbow 2
    🙌 3
    fast parrot 4
  • j

    Jürgen

    09/09/2021, 5:26 PM
    hi there, i am new to prisma and i am using v2. we are just getting started. and i have an issue which does not make sense to me. I want to create a new item which has a relation to an entity called brand. When i do want to create an item i get the following error message:
    Copy code
    Unknown arg `brand_id` in data.brand_id for type ....CreateInput. Did you mean `brands`?
    while my schema and my model clearly has the member
    brand_id
    . I know there is an alternative method with using
    connect
    though i actually don’t want to use it. als the TS typing shows an XOR between these two variants. Any clues?
    • 1
    • 1
  • h

    Harsha MV

    09/09/2021, 8:17 PM
    PrismaClient is unable to be run in the browser.
    Am getting this error when I try to create a record from a component.
    *Do I need to send it back to pages/<file> to run the
    <http://prima.cr|prima.cr>*eate
    function
    r
    • 2
    • 1
  • h

    Harjaap Singh Makkar

    09/09/2021, 8:55 PM
    Hello! I'm getting a strange error today out of nowhere when trying to read or write data {"error":"\nInvalid
    prisma.listing.create()
    invocation:\n\n\n read ECONNRESET"}. Any help would be awesome, thank you!
    j
    • 2
    • 4
1...479480481...637Latest