TypeORM Relations Tutorial - FULL details!

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024

Комментарии • 248

  • @mariusespejo
    @mariusespejo  2 года назад +21

    Note: TypeORM just released v0.3 which has some breaking changes on how you query relations, e.g. instead of an array of strings for find() you now use an object. Make sure to check the release notes and docs! Most of the fundamentals in the video still applies though.

    • @andifaizal6848
      @andifaizal6848 2 года назад

      Can you explain about V0.3 and what is changes in typeorm?

    • @andifaizal6848
      @andifaizal6848 2 года назад

      Thank you

    • @andifaizal6848
      @andifaizal6848 2 года назад

      @UCDpd-qEwAI9wglx4tsEBAtw how about changes creatConnection to dataSource?
      I have a project with install quick start and i can't see change about createConnection to dataSource?
      Can explain with this problem about quick start.

    • @mariusespejo
      @mariusespejo  2 года назад +2

      I suggest reading their release notes in github, it’s a lot to explain in a comment

    • @andifaizal6848
      @andifaizal6848 2 года назад

      @@mariusespejo Okay. Thank you for advice. I'm go to github.
      You're really good to explain. Thank you for that.🙏

  • @gilsonviana4936
    @gilsonviana4936 2 года назад +1

    You've exposed TypeORM with great eloquence and simplicity.

  • @josephsamuel3254
    @josephsamuel3254 Год назад +1

    Your channel is the best source of information on NestJs and TypeOrm , Keep up the good work👍

  • @alexandermarthius5593
    @alexandermarthius5593 3 года назад +6

    another great tutorial, learning Typorm never been so easy before!
    Thanks you so much Marius

  • @James-fe7wd
    @James-fe7wd 3 месяца назад

    Bro, thank you for laying this out in such a clear and concise way. I've been struggling with typeOrm for a while now, and I finally decided to come and seek help. Silly devs like me who don't have the time to go through the documentation still try stabbing in the dark to figure it out which is far more time consuming. But I had no idea I could learn so much so quickly from anyone on the subect. Kudos!

    • @mariusespejo
      @mariusespejo  3 месяца назад +1

      Thanks for the comment! Glad this old video is still helping folks out!

    • @James-fe7wd
      @James-fe7wd 3 месяца назад

      @@mariusespejo In a big way!

  • @alirahimi4746
    @alirahimi4746 7 месяцев назад

    THANK YOU! ❤❤ this is what i needed all these times, a basic in depth tutorial on why and how to use the relationships in typeorm

    • @mariusespejo
      @mariusespejo  7 месяцев назад

      It’s an old video but glad it’s still helpful!

  • @clernis1861
    @clernis1861 Год назад

    Great tutorial, thanks to you i saved a lot of time, without this video i wouldn't be able to finish task that i was signed to. I can’t thank you enough.

  • @rajgohil8610
    @rajgohil8610 2 года назад +2

    Another excellent explanation video...many thanks for sharing your knowledge...you always go above and above and go extremely deep into educating us. I pray that God bless you and that your channel continues to develop at a rapid pace.

  • @muhammedsinan3897
    @muhammedsinan3897 2 года назад

    thank you ..man..it is one of the most beautiful tutorials I ever watched.

  • @iansamz
    @iansamz 3 года назад +2

    Just when I was about to give up on nestjs. You showed up. Thanks alot

  • @ivelinstoyanov4229
    @ivelinstoyanov4229 3 года назад +10

    That's probably the first comment I'm leaving on a youtube video in years but I just wanted to say that you're amazing! Just finished your nestjs graphql video and I don't know what it is about your tutorials but I feel like they're hands down one of the best in the programming field. Thank you again! :)
    PS: Would love to see more NestJS GraphQL videos ^^

    • @mariusespejo
      @mariusespejo  3 года назад +1

      Thanks Ivelin! I appreciate that! 🙏
      Definitely more graphql content in the future!

  • @chijiokeokwuosa4851
    @chijiokeokwuosa4851 2 года назад +1

    Thanks so much for your videos on nest js. I got a new job that requires that i work with Nest Js and your videos have been helpful

    • @mariusespejo
      @mariusespejo  2 года назад +2

      Glad to hear that man, congratulations on the new job!

  • @udev6707
    @udev6707 3 года назад +5

    You deserve millions of subscribers man🙂

    • @mariusespejo
      @mariusespejo  3 года назад +1

      haha thank you, hope you’re one of them!

  • @mysteriousmsn
    @mysteriousmsn Год назад

    Awesome tutorials which covers all the fundamentals to get involve in the typeORM project

  • @DO462
    @DO462 3 года назад +1

    You just can't imagine how helpfull this was. Liked and subscribed!

  • @MaybeBL1TZ
    @MaybeBL1TZ 3 года назад +1

    at this point we need a fully nest api even if the video is 4 hours long the way you teach and explain stuff is just amazing i can't get bored ✌🏻❤️

    • @mariusespejo
      @mariusespejo  3 года назад +1

      Thank you 🙏 definitely a full API project build with all the core concepts put together I think would make an awesome video but it will take some time, will consider it

    • @MaybeBL1TZ
      @MaybeBL1TZ 3 года назад

      @@mariusespejo no problem take all your time and am sure you'll make amazing content

    • @juanvibeats3880
      @juanvibeats3880 2 года назад

      @@mariusespejo Hey Marius, do you provide tutoring services by any chance? I'd love to learn directly from you! Please let me know if you'd consider it!

    • @mariusespejo
      @mariusespejo  2 года назад

      Not at the moment, although I’ll definitely consider it and look into it. What sorts of things would you want to learn from me directly?

  • @shabbirhusain6634
    @shabbirhusain6634 Год назад

    Yours video on left and nest docs on right make my night, Wow

  • @nagarjunapradeepkumar802
    @nagarjunapradeepkumar802 3 года назад

    best ever tutorial, so easy to understand

  • @josephandrade287
    @josephandrade287 Год назад

    dude, you are legit. thank you so much

  • @darknight9185
    @darknight9185 Год назад

    thanks for creating such good tutorial

  • @kushalsb460
    @kushalsb460 10 месяцев назад

    great content.. even useful after 2 years. thanks a lot.

  • @airplaneCrashe
    @airplaneCrashe Год назад

    Good tutorial. thanks

  • @res3064
    @res3064 3 года назад +1

    You always help me with your videos. Thank you man, keep up great content as always ❤️

  • @Dima_Elagin
    @Dima_Elagin 10 месяцев назад

    Thanks man. That's a great tutorial

  • @ceciliaserafini
    @ceciliaserafini 3 года назад

    Hello Marius, Oh! I am very grateful for all the videos about TypeORM and NestJS, so helpfull. Thank you very much for sharing this knowledge in a didactic and clear way, you are the best! ❤

    • @mariusespejo
      @mariusespejo  3 года назад

      Hi Ceci! I’m glad you’re finding the channel useful, thanks for your feedback 🙏

  • @raymondyoo5461
    @raymondyoo5461 2 года назад

    It was a greate introduction to TypeORM relations.
    Thanks a lot 👍👍

  • @smartcoder6586
    @smartcoder6586 Год назад

    Well explained. Thankyou Very much.

  • @innocentmazando3808
    @innocentmazando3808 Год назад

    Thanks a lot @Marius. Youe tutorials are making my NestJS journey so easy.
    Keep up the good work sir :)

    • @mariusespejo
      @mariusespejo  Год назад

      Happy to hear that, thanks for the comment!

  • @mirkahromi
    @mirkahromi 2 года назад

    well-structured and well-designed tutorials.

  • @yunusemreince3692
    @yunusemreince3692 2 года назад

    Hi Marius,
    I just found your channel with this video. I really appreciate the way you explain the things in simple.
    Thanks a lot 👍

    • @mariusespejo
      @mariusespejo  2 года назад

      Glad you’re finding the content useful!

  • @bartoszpierdolny6978
    @bartoszpierdolny6978 3 года назад

    I feel like a girl in a fashion boutique on your channel, the only difference is that she don't have enough money to buy everything and I don't have enough time to watch, like and comment every video :D

  • @mehinhuseynova1426
    @mehinhuseynova1426 3 года назад

    Awesome, every single detail is well explained.

    • @mariusespejo
      @mariusespejo  3 года назад +1

      glad it’s not confusing, thanks for your feedback 😄

  • @artleitch
    @artleitch 2 года назад +1

    Thanks for this video. Really well paced, everything is well explained, incredibly helpful. Subscribed and looking forward to more videos :)

  • @HenBarLevi
    @HenBarLevi Год назад

    awesome explanation thank you

  • @sjnprjl
    @sjnprjl 2 года назад

    You are awesome, man!!!!

  • @michaelantoni8323
    @michaelantoni8323 2 года назад

    Thank you for this TypeOrm Tutorial

  • @BigBahss
    @BigBahss Год назад

    AMAZING tutorial. You've definitely earned a sub, and I'll be checking out your other tutorials

  • @P4trickSensei
    @P4trickSensei 2 года назад

    Very well put together. Thank you!

  • @SameeraSenarathna
    @SameeraSenarathna 3 года назад

    Extremely useful. Thank you Marius.

  • @hwangmg5581
    @hwangmg5581 2 года назад

    This is what i finally need it 🙌 thanks 😊

  • @pratiknaik261
    @pratiknaik261 2 года назад

    Amazing explanation on the stuff,Nicely done!!

  • @MartinPerez-mi1ty
    @MartinPerez-mi1ty 3 года назад

    So helpful, i really enjoy your videos, greetings from Peru, keep it up!

    • @mariusespejo
      @mariusespejo  3 года назад +1

      awesome to know I'm reaching Peru! thank you!

  • @mastercode7851
    @mastercode7851 3 года назад

    thanks a lot this was the best explanation ever

  • @thongtech1984
    @thongtech1984 2 года назад

    absolutely beautiful vid

  • @mostafaelgazar8512
    @mostafaelgazar8512 2 года назад

    you are doing great ,thanks

  • @ganjargingintahyudin9774
    @ganjargingintahyudin9774 2 года назад

    Oh man.. thanks for this tutorial

  • @berenjor
    @berenjor 5 месяцев назад

    Greta tutorial! Also, what is the markdown editor you're using throughout the video? It looks great

    • @mariusespejo
      @mariusespejo  5 месяцев назад +1

      That’s the bear app, if you want something clean and simple it’s great. But nowadays I’d probably use Obsidian

  • @javierpons50
    @javierpons50 2 года назад

    Excellent video thank you!

  • @yuriiboiko679
    @yuriiboiko679 2 года назад

    Thanks a lot - useful tuttorial for people who modef from another language into nodejs (nestJs)

  • @hanzheng173
    @hanzheng173 3 года назад

    Very appreciate for this amazing video. Keep going!

  • @ayoubbenbrahim1891
    @ayoubbenbrahim1891 2 года назад

    Thank you man i find this soo helpful keep the good work

  • @bcdbcdyedek
    @bcdbcdyedek Год назад

    Amazing content!! It really helps a lot ! Keep it up

  • @leekimah
    @leekimah 2 года назад

    Thank you sir! This helped.

  • @rohitdasu
    @rohitdasu 3 года назад

    Excellent! Thanks

  • @kurtestacion6113
    @kurtestacion6113 3 года назад

    Appreciate this man! Keep it up! ❤

  • @Varuag89b
    @Varuag89b 3 года назад

    Great content Marius👍, as always :)

  • @ahoussimea7164
    @ahoussimea7164 2 года назад

    Great one. Keep it up

  • @peroforrr7663
    @peroforrr7663 2 года назад

    You really help me thank you so much

  • @vasilevictordurlesteanu2435
    @vasilevictordurlesteanu2435 Год назад

    God bless you Marius

  • @scottgasparick3753
    @scottgasparick3753 2 года назад

    First off, all of your NestJS and TypeORM are top-notch. Great pacing and flow. Many times you will expand the details in regards to a particular method or decorator (such as at 19:19 when explaining the @JoinTable options). How are you pulling that up?

    • @mariusespejo
      @mariusespejo  2 года назад

      Thanks Scott, I appreciate your feedback! Regarding your question, that is a feature in most editors/IDEs for typed languages, where you can do (on mac) CMD + Click to “drill into” the underlying type or definition.. on windows I think it’s CTRL + Click

  • @reisap1
    @reisap1 3 года назад

    thanks for this video..this help me a alot...you are awesome.

  • @deepakpadliya2714
    @deepakpadliya2714 2 года назад

    HI Marius Espejo,
    Thanks for the Grate explanation
    1. Can you give an example for Many to Many relationship like user and Friends.
    2. Can you give an example of find with many to many relationship with where clause

    • @mariusespejo
      @mariusespejo  2 года назад

      Did you watch the entire video? I thought I did cover Many to Many

  • @programmingwithnit5308
    @programmingwithnit5308 Год назад

    Thank you so much

  • @роматарасов-о8л
    @роматарасов-о8л 3 года назад

    very usefull, thanks for videos!

  • @frankli7035
    @frankli7035 3 года назад +1

    Hi man, this is amazing. Could you share more deeper like how to define the relationship inside the entities service and resolvers rather than seeding the data into the database?

    • @mariusespejo
      @mariusespejo  3 года назад +1

      That’s exactly what I did in this video. I did show a method named seed but the point was to show how you’d do inserts in the service.. To make that more real you’d instead have some kind of create method which accepts a DTO to have the data as input and perform the same exact operations to insert and relate

    • @frankli7035
      @frankli7035 3 года назад

      @@mariusespejo Thanks for the response, really helpful, I'll try this later, really appreciate it...... great channel, has referred to all my friends...

    • @frankli7035
      @frankli7035 3 года назад

      @@mariusespejo hi man,any way to reach out to you? Discord or email?

    • @frankli7035
      @frankli7035 3 года назад

      @@mariusespejo , I kind of get what's your point, but the problem is how to implement with the input and the service, like what should I defined in the tasks.input to get the right employee id as the foreign key,and in the service do I need to inject all the related Repositories or just it's self's Repository? Maybe for you just a one minute set up but for a rookie like me can't find it anywhere ,so pls help to make a simple guide? Tks,really appreciate

    • @mariusespejo
      @mariusespejo  3 года назад +1

      Have you seen the typeorm fundamentals vid in my channel? Might help

  • @vannakdy4974
    @vannakdy4974 Год назад

    Thank so much

  • @sasg87962
    @sasg87962 2 года назад

    remind me of symfony and doctrine ❤❤❤❤

  • @yaktd5704
    @yaktd5704 3 года назад +1

    Thanks man! Sadly NestJS doesn't have a strong community as Expressjs.

    • @mariusespejo
      @mariusespejo  3 года назад

      well it uses Express under the hood by default so you could argue that it’s utilizing that same community and ecosystem 😄

  • @prasadbaraskar2569
    @prasadbaraskar2569 2 года назад

    It was a very helpful tutorial. Thank you. Can you please explain how we can use update query for relational table.

    • @mariusespejo
      @mariusespejo  2 года назад +1

      There’s another typeorm fundamentals video in my channel that I would recommend watching, this is sort of part 2 to that covering relations specifically

  • @stylesg7818
    @stylesg7818 3 года назад

    Thanks again.

  • @SpiderMan-wk4gk
    @SpiderMan-wk4gk 2 года назад

    i hope you upload video for tutorial ORM ManyToMany, OneToMany, ManyToOne... with Api and CRUD this problem. Thank so much !!!

    • @mariusespejo
      @mariusespejo  2 года назад

      isn’t that pretty much what this video was? What’s important to takeaway from this is how to do represent and query those relations. Which you can use in services, which you can then use in controllers to fully build out your API end to end

  • @theshroomlife
    @theshroomlife 2 года назад

    thank you!

  • @maximus4510
    @maximus4510 3 года назад +1

    41:27 shows a raw query in the terminal, are you using a special extension for that?

    • @mariusespejo
      @mariusespejo  3 года назад +1

      notice at 2:43 that you can configure logging in the connection options

    • @maximus4510
      @maximus4510 3 года назад

      @@mariusespejo this is AWESOME thank you!!

    • @mariusespejo
      @mariusespejo  3 года назад

      no problem!

  • @chans9055
    @chans9055 Год назад

    Thank you for the great tutorial Marius. I was playing with the code you wrote on the tutorial and I wonder if it's also possible to limit the number of tasks when you select employee by id? for example if the employee has too many tasks and don't need to show all of them but few of the latest ones. Is it possible to achieve this? or am I trying to do something impossible?

    • @mariusespejo
      @mariusespejo  Год назад +1

      If I understand what you’re asking, of simply limiting the number of results, yes most relational DBs support adding a limit. For example you can query sorted by a date column (latest) and only limit to the first few results

  • @ms0615122
    @ms0615122 3 года назад

    Thank you

  • @joraz8575
    @joraz8575 Год назад

    Good tutorial and great thanks !Can you please make a tutorial for html to pdf using templating ejs in Nestjs ?

  • @ashishkumari-yg4gn
    @ashishkumari-yg4gn Год назад

    TypeError: Cannot read properties of undefined (reading '_id')
    The meeting is getting saved but still this error is coming and further which the code is not working ( manager is not getting saved)
    I

  • @fernandomartinez4304
    @fernandomartinez4304 2 года назад

    Hi Marius, thanks for ur content. I have a question, if the user is in fact a manager, he needs to set manager field to null, right? We put manager field @ManytoOne(...{..., nullable:true}) ???

    • @mariusespejo
      @mariusespejo  2 года назад

      Yeah generally one way to represent a parent in a parent/child relationship is to set the the parent’s field as null. However in an employee database I would imagine everyone except the CEO would have a manager

  • @pareshmaniyar8273
    @pareshmaniyar8273 2 года назад +1

    Hey, I have started building an app for School, where there are two tables, teachers and students.
    There is a contactInfo table I want to use in both of them. So I placed a contactInfo id at teachers and students.
    How to have a one to one relation with contact info and teachers as well as students table? Also cascading should work

    • @mariusespejo
      @mariusespejo  2 года назад

      I covered one-to-one, did you watch the whole thing? Or was it not clear?

  • @quangle3515
    @quangle3515 2 года назад

    which is auto snippet code you are using? Thank

  • @jhumerapus1881
    @jhumerapus1881 2 года назад

    why is there no employeeId on task? it was on ER diagram

  • @hongsonnguyen9620
    @hongsonnguyen9620 7 месяцев назад

    Nice

  • @ashishkumari-yg4gn
    @ashishkumari-yg4gn Год назад

    Thank you sir for the video.
    Please make a video of relations with TypeORM mongodb as many to many bi-directional relation is giving error - TypeError: Cannot read properties of undefined (reading '_id')
    The meeting is getting saved but still this error is coming and further which the code is not working ( manager is not getting saved)

  • @SameerG2387
    @SameerG2387 2 года назад

    Well explained @marius. Just have a question on the lazy load case. I prefer lazy load for the fact that I can choose what relations are required for me at the service layer, instead of defining all the relations with find at the Data Layer. Using lazy load I can fetch data at my service layer when and where required. Will like to have your thoughts on this use case.

    • @mariusespejo
      @mariusespejo  2 года назад

      Yup, I don’t think either way is better, it’s really all preference

    • @SameerG2387
      @SameerG2387 2 года назад

      @@mariusespejo Agree Thanks for replying back.

  • @igbokwelaurence5882
    @igbokwelaurence5882 3 года назад

    Hi Marius, your videos have been super helpful. I have a scenario where a User has many assessments, and one assessment has many questions, each lye on seperate tables, how can i join so when i query a user, I see all his assessments and the questions for each of those assessment

    • @mariusespejo
      @mariusespejo  3 года назад

      Using the .find() api will let you do nested/sub relations, you can try something like: this.usersRepository.find( { relations: [ ‘assessments’, ‘assessments.questions’ ] } );

    • @mariusespejo
      @mariusespejo  3 года назад

      Or just use the query builder which should let you do basically anything you can normally do with sql, meaning using multiple joins to achieve the same result, that should be also covered in this video I believe

  • @ekkirizkiramadhan3553
    @ekkirizkiramadhan3553 2 года назад

    can we have 2 or 4 relationship? how to recreated it? thx

  • @igorigor806
    @igorigor806 2 года назад

    Hi, thanks for the video! I have a question about skip and take for the “children” of the relations, so basically pagination. Is it possible to set limit and offset for (for example) the tasks of an employee during the DB query or I should do it programmatically after I get everything from the DB?

    • @mariusespejo
      @mariusespejo  2 года назад

      You have to think about it from a SQL perspective, if you can write a sql query with limit and offset then you likely can also do it from typeorm. Although probably not with pulling relations with the find() API you’ll likely want to do your example using the query builder, do a join, and set the limit and offset there

  • @muratasarslan2359
    @muratasarslan2359 3 года назад +1

    Very helpful, thank you :-)
    I saw different code samples about CRUD operations with TypeORM. Some uses Repositories, some not. Such as;
    const userRepo = getConnection("defalt").getRepository(User);
    const user = await userRepo
    .create({
    email,
    firstName,
    lastName,
    password: hashedPassword,
    })
    .save();
    and without repository;
    const user = await User.create({
    email,
    firstName,
    lastName,
    password: hashedPassword,
    }).save();
    they do the same job. When or why to use repository?
    Thanks

    • @mariusespejo
      @mariusespejo  3 года назад +1

      I would suggest reading about Active Record vs Data Mapper patterns, there are pros and cons to both and it’s ultimately up to your preference. In nestjs specifically it will work best with the repositories

  • @christianangelomsulit3759
    @christianangelomsulit3759 3 года назад

    Size limitation for directReports? what is the best way to query that property when a manager has 100+ employees?

    • @mariusespejo
      @mariusespejo  3 года назад +1

      you can implement a form of pagination
      and/or perhaps use a separate direct api call for it like
      /employees?manager=managerId&limit=10
      typeorm has support for querying with limit/take and offset

  • @debostrazza3928
    @debostrazza3928 Год назад

    @mariusespejo I love this video, I saw it every time I need help. But this time I have a question: I have two entities whit manyToMany relationship and I did a queryBuilder to filter the info by an input. The thing is that I have a leftJoinAndSelect and then in a where clause I have a sentence whit LIKE operator. How can I do to filter a property to the entity that is given whit the relationship? (I don't know if it's understanding)

    • @mariusespejo
      @mariusespejo  Год назад

      If I understand, you’re trying to filter based on a value on the related table? e.g. let’s say you have entities Photo and User with a many to many relationship. You want to find all the users tagged on a photo, where there name starts with “Mar” for example. Then you might have a query like this, using query builder. Basically make sure you’re utilizing the alias that you create with your join
      this.photosRepository.createQueryBuilder(“photo”).leftJoinAndSelect(“photo.users”, “user”).where(“user.name LIKE :name”, { name: “Mar%” }).getMany();

  • @stvnreis
    @stvnreis Год назад

    Am I the only one wondering which app he used for that to-do list?

    • @mariusespejo
      @mariusespejo  Год назад

      That was the Bear app I think, it’s actually for markdown notes, not necessarily a todo app

  • @nilokillian
    @nilokillian 3 года назад

    Was looking for TypeORM stuff and come across your channel. It's quite good actually . Hit subscribe btn

  • @LemarinelNet
    @LemarinelNet 3 года назад

    Hey, I'm trying to dive into NestJS with TypeORM, but coming from Laravel, I'm having a hard time using data mappers instead of active record pattern...
    Would you make a tutorial for NestJS with TypeORM using activeRecord pattern (or even Sequelize ?)
    Thanks anyway !

    • @mariusespejo
      @mariusespejo  3 года назад

      The typeorm integration with nest specifically uses the data mapper with repositories. That’s because entities aren’t “injectable” they’re just representing the data. It’s not really that big of a shift, you simply instead either use services or custom repositories for your query methods

  • @vithusas4024
    @vithusas4024 3 года назад

    Is it possible to use NestJS without type orm with mysql? What if I want to write plain sql statements instead of type orm? you can do a video using only sql statements?

    • @mariusespejo
      @mariusespejo  3 года назад

      I’m sure you can but it’s not very practical to use the mysql driver directly like that. Typeorm can also do raw queries if you really wanted to. Or you can use knexjs

  • @yadimansinurat3674
    @yadimansinurat3674 2 года назад

    i always get this :
    [Nest] 6684 - 11/16/2021, 11:51:29 ERROR [ExceptionHandler] Nest can't resolve dependencies of the AppService (?, ContactInfoRepository, MeetingRepository, TaskRepository). Please make sure that the argument EmployeeRepository at index [0] is available in the AppModule context.
    please help me : (

    • @mariusespejo
      @mariusespejo  2 года назад

      If it can’t inject the repository that means you like didn’t do TypeormModule.forFeature for that employee entity

  • @nepalcodetv6298
    @nepalcodetv6298 3 года назад

    how to filter with relations with array likes tasks name ?, great content

    • @mariusespejo
      @mariusespejo  3 года назад

      Generally for more complex queries you’re better off using the query builder and do an actual join, then add in your where clauses to filter

    • @nepalcodetv6298
      @nepalcodetv6298 3 года назад

      @@mariusespejo Thank You, so much, Needed to Implement Complex Filter for Products, Query Builder worked Perfectly Resolved my issues even for nested ones. God Bless You.

    • @mariusespejo
      @mariusespejo  3 года назад

      Awesome glad you figured it out!

  • @emmanuelaustine680
    @emmanuelaustine680 3 года назад

    thanks marius

  • @thetaks9404
    @thetaks9404 7 месяцев назад

    can you please help, one to one cascade delete doesn't work typeorm? because I tried all the methods, after searching on the Internet I saw that many people encountered this problem

    • @mariusespejo
      @mariusespejo  7 месяцев назад

      Cascade deletion is database responsibility not your ORM’s. Make sure you actually have the foreign key in place with Cascade delete setting on your column schema. Then you delete from the referencing side.

  • @vzlomer1000
    @vzlomer1000 5 месяцев назад

    thnks

  • @luqmanusman70
    @luqmanusman70 5 месяцев назад

    hi, is it possible to create a single view for join query instead of multiple data subsets. Say I need a customer name from customer table with every order, my order data should be look like this:
    {
    order: 1
    orderdate: 2023-04-20
    customername: abc
    }
    not like showing
    customer[] as a separate object.
    Please advise.

    • @mariusespejo
      @mariusespejo  5 месяцев назад

      Are you asking if typeorm supports views? Yes you can create view entities and query them like normal tables
      typeorm.io/view-entities

    • @luqmanusman70
      @luqmanusman70 5 месяцев назад

      @@mariusespejo Yes bro, I exactly needed the same option, thanks a lot and take care.