Тёмный

NestJS + TypeORM Tutorial | Repositories, Relations, Migrations & More 

Michael Guay
Подписаться 18 тыс.
Просмотров 54 тыс.
50% 1

In this video, we do a deep dive into setting up NestJS with TypeORM. We look at repositories, relations, transactions, subscriptions, migrations & unit testing.
GitHub Repo: github.com/mguay22/nestjs-typ...
Docker Desktop: www.docker.com/products/docke...
MySQL Workbench: www.mysql.com/products/workbe...
TypeORM subscribers: typeorm.io/listeners-and-subs...
Timestamps:
00:00:00 Introduction
00:00:58 Repositories
00:26:15 Relations
00:46:25 Transactions
00:50:53 Subscribers
00:54:17 Migrations
01:02:15 Testing
Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/

Наука

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 58   
@mguay
@mguay Год назад
Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
@ofuochi
@ofuochi Год назад
Been waiting for this for so long!! Thank you
@nucleus8706
@nucleus8706 Год назад
Been waiting for a comprehensive typeorm 0.3x migrations tutorial with env variables for very long. I am greatful, thank you so much. Looking forward to more NestJs content.
@badrinath8958
@badrinath8958 11 месяцев назад
Hi Michel, very useful great videos from NesJS tutorials. Looking forward to more NestJs content.
@leonardoebert9057
@leonardoebert9057 6 месяцев назад
This is the best content after a lot of search, thanks man for sharing your knowledge with others.
@SamipShresthajava
@SamipShresthajava 7 месяцев назад
Wow, this helped me to understand the basic concept of backend and the course even shows how to setup basic test. This course was really helpful building the base knowledge for starting backend programming. Thanks
@user-qp8cr4kd4w
@user-qp8cr4kd4w 11 месяцев назад
Man, I discovered nestjs a year ago, wasn't able to find a channel which provides Nestjs quality code. Then there you are ! Thank you so much
@bekturmuratov7853
@bekturmuratov7853 Год назад
Thank you for this video tutorial I hope there will be more video tutorials in the future on Nest JS
@abharani9265
@abharani9265 7 месяцев назад
Great content thank you for explaining everything so clearly.
@yashkhd1100
@yashkhd1100 Год назад
Great Content Michael..!! I'm experienced enterprise app dev and mostly worked on well designed Java/.Net systems where proper design is very important as system should be extensible and maintained for long term. Recently I have been looking around NodeJS ecosystem for my side projects. I settled for NestJS for it's well thought out extensible architecture. The best thing about your videos is unlike many other videos explaining how to implement something ur videos also explain how to implement something "properly" in well throughout manner. You definitely deserve lot more subscribers..!!
@devorer77
@devorer77 9 месяцев назад
I've bought your course and I have to say - it's amazing. And now I want to deeply dive into typeORM.
@mguay
@mguay 9 месяцев назад
Thanks so much
@user-jm1nw6ib3u
@user-jm1nw6ib3u 8 месяцев назад
Thank you this was amazing keep going with more awsome videos
@mr_ehmed
@mr_ehmed 11 месяцев назад
keep uploading nest js advance videos ..best content
@robertoaqueveque2048
@robertoaqueveque2048 4 месяца назад
Great job! I love how you explained subscribers! I really need it! T.Y.
@setmax1991
@setmax1991 Год назад
Thank you, very grateful to see your NestJS videos. Would you ever think about a video tutorial of creating a polyrepo microservices project with NestJS and also a common library as a submodule in it?
@husammaher
@husammaher Год назад
you are great man !! thanks for \ your awesome videos , we would want more videos about monorepo project and how to deploy it
@josbexerr5166
@josbexerr5166 20 дней назад
Muchas gracias mister michael, por el excelente tutorial....
@RomanBorowinski
@RomanBorowinski Год назад
Thanks! Another great video! Would you ever consider making video on Keycloak integration with NestJS and front-end?
@mguay
@mguay Год назад
Sure!
@user-cy9tg6ys3n
@user-cy9tg6ys3n 5 месяцев назад
thx for video
@vannakdy4974
@vannakdy4974 10 месяцев назад
Thank
@user-wl3lk4hy9h
@user-wl3lk4hy9h 10 месяцев назад
Mind blowing tutorial,btw migration can add seeding fake data like Laravel?
@irhasm.a.4932
@irhasm.a.4932 Год назад
💙💙💙💙
@olusegun1486
@olusegun1486 5 месяцев назад
Please could you do tutorials explaining concepts like concurrency (locking) mechanisms i.e pessimistic & optimistic locking
@anandhukraju9382
@anandhukraju9382 Год назад
Would you consider using new stack like drizzle orm and zod in nestjs?👀
@Nabulio85
@Nabulio85 2 месяца назад
Hi, Thx for this video. I have a question. Why do you use async keyword when you don’t have await keyword inside the body of your function ? Thx
@EstebanHelgueroCardiff
@EstebanHelgueroCardiff 2 месяца назад
Hi! How do you manage migrations in production? Do you have a pipeline that executes It and then run the deploy?
@nabinsaud4688
@nabinsaud4688 Год назад
Will you make graphql and role based authentication on nestjs
@zekmaker8318
@zekmaker8318 4 часа назад
nice =))))
@JohnMcclaned
@JohnMcclaned Год назад
Can you please make a video using the ts-rest library? It looks awesome but there is no content on it! Thanks :)
@herre8323
@herre8323 6 месяцев назад
No hablo inglés pero entendí perfectamente gracias
@hamzahahmad1670
@hamzahahmad1670 Год назад
Hey Michael, is there a specific reason to use Entity Managers to save instead of repositories? For example, using the ItemRepository to create and save an item at 19:20 instead of the Entity Manager. And if the former (ItemRepository) approach works, can we then remove the constructor we created in the Item Entity? Thank you btw for the comprehensive video. I already purchased the MicroServices course since it was on discount but I'm trying to improve my fundamentals before diving in the course
@mguay
@mguay Год назад
You can use either, but the former provides us with a bit more type safety.
@hamzahahmad1670
@hamzahahmad1670 Год назад
@@mguay Thanks for the response
@destocot1729
@destocot1729 3 месяца назад
@@mguayhad the same question, but a follow up how does entityManager work with multiple entities like how does it know entityManager.save(item), entityManager.save(user), feels weird that would be more type safe than using the repository for the respective entity besides that great video learned some cool techniques like the constructor in the entity and creating the abstract entity, just started learning nestjs 2 days been a hardcore express fan for a while
@andresvodopivec5950
@andresvodopivec5950 10 месяцев назад
Has anyone got the problem that when the restApi is rerun (npm run start:dev) only the columns with string values from the databases are emptied? Just the strings and not the number. If someone have had that issue, please help me how you solved it.
@alaarammu1678
@alaarammu1678 3 месяца назад
Great tutorial! Only advice would be to go a little slower haha - but thank you so much!
@saviourumoeka4385
@saviourumoeka4385 Год назад
Thank you so much, I tried Migrations with MSSQL but it does work, please if you can provide any assistance I will appreciate. It asks for a config.server property
@md.redwanhossain6288
@md.redwanhossain6288 10 месяцев назад
Isn't typeorm has slow perfonmance in relational queries? How about some Query builders like kysely or perfonmant ORM like Drizzle?
@devorer77
@devorer77 9 месяцев назад
Michal, have you investigated the possibility of creating tables with TypeORM in runtime?
@104antony
@104antony 7 месяцев назад
Hello, great content. There is only one thing that I don't understand. In what situations should we employ the migration? For example, in your video you set all items as non public. But it can also be done with the API Request? Or is that wrong?
@SamipShresthajava
@SamipShresthajava 7 месяцев назад
Migration are helpful when you want to seed the db with fresh data for the first time or when you migrate to new DB without losing critical data.. This should be done without the use of API as API are used for single transaction in most of the cases whereas migration will help you inject multiple custom SQL query directly to the db.
@sadhakbj
@sadhakbj Год назад
Wow, i thought you would update the microservice course but instead added here.
@mguay
@mguay Год назад
That’s next!
@sadhakbj
@sadhakbj Год назад
@@mguay Wow, amazing, happy to hear that, enjoying the series and love the way you teach. I got chance to learn new aspects of TypeScript which was impossible to find in other places.
@maxkosh4839
@maxkosh4839 8 месяцев назад
41:41
@michaelyao9389
@michaelyao9389 Год назад
Hi Michael. I like your videos but I found there aren't many jobs for nestjs...sad for it.
@user-tv5vg5yb4g
@user-tv5vg5yb4g 2 месяца назад
Great video nicely explained, but I hate nest.js
@mguay
@mguay 2 месяца назад
How come? That’s a first for me :)
@knowa130
@knowa130 Год назад
Merci !
@mguay
@mguay Год назад
Thank you so much for the support!
@knowa130
@knowa130 Год назад
@@mguay No problem :) I appreciate the video. I'm dreaming of working with NestJS and after this tutorial my understanding of things just got so much better :)
@kamalkamals
@kamalkamals 10 месяцев назад
for best practice dto should be an interface not a class
@usericvusrqluu
@usericvusrqluu 10 месяцев назад
the best practice is to make a dto an actual class and no doubt about it, otherwise how are you going to document your api using the most popular tool, which is swagger, which literally allows you to pass only class-based types? also, how are you going to validate upcoming request body while interface is not a value and does not exist during runtime? there literally exist npm packages named CLASS-VALIDATOR and CLASS-TRANSFORMER for validating dto schema; but these are only helpers that make your code cleaner, what is actually more important is that you are trying to disrupt dto pattern because there are solid rules behind this principle that should be untouched and unchanged if any concerns, go and check out how it's done in other programming languages, preferably Java because NestJS was strongly inspired by Angular which was strongly inspired by Java but it's just an example, you can go for C#, Python, or whatever else
@NullisNaN
@NullisNaN 9 месяцев назад
Great, up to date instruction. If you're following along and get an error during testing "cannot find module" I had to add a line to the jest section in package.json "moduleNameMapper": { "^src/(.*)$": "/$1"
@javierrenteria3195
@javierrenteria3195 10 месяцев назад
Hey, question. Are you sure that, you have to import all entities and add them one by one? Can you not just do it how you did for migrations?not sure if I explained myself correctly. Beside that, great content!
@oyinlolaolasunkanmi
@oyinlolaolasunkanmi 11 месяцев назад
Great content. However, you cannot continue to create migration by yourself as your entities grow with complex relationships. The typeorm generate command, gives error. Cannot open file, referring to the data source folder. Here’s my generate migration command npm run build && typeorm migration:generate -d ./src/typeorm.config.ts migrations/test anyone has the right command or facing similar issue ? @mguay
Далее
NestJS gRPC Microservices Tutorial
55:04
Просмотров 33 тыс.
Осторожно селеба идет 😂
00:16
Просмотров 308 тыс.
NestJS, MySQL, TypeORM Crash Course
1:17:38
Просмотров 91 тыс.
ChatGPT4 Guide for developing your first code
7:41
Просмотров 10 тыс.
Prisma Vs. TypeORM Vs. Sequelize | Which is Better?
12:44
Drizzle ORM in 100 Seconds
2:54
Просмотров 443 тыс.
Learn Nest.js from Scratch by building an API
1:09:06
Просмотров 538 тыс.
ДОМОФОН НА КОМПЬЮТЕР
0:17
Просмотров 599 тыс.