NestJs and TypeORM basics—create CRUD API [part. 2.]

preview_player
Показать описание
In the second part of nestJs tutorial, I will show you how to use real database instead of in memory store. In this lesson, we will use the postgres database together with the typeORM. I will teach you how to run a local instance of postgres using docker-compose, how to connect to it from nestJs app and finally, we will learn all the implementation of CRUD operations in typeORM.

0:00 Introduction
0:31 How to run postgres on local machine
03:08 How to install typeorm in nestJs project
03:47 How to set typeorm config
06:06 How to create typeorm entity
09:48 How to create one-to-many relation in typeorm
13:09 How to use typeorm repository in nestJs app
14:46 How to implement CRUD operations in typeorm

Рекомендации по теме
Комментарии
Автор

another excellent video. These deserve tens of thousands of views. Your explanation really simplifies things that would be challenging to a beginner. I have made many tables with various relationships, and i still learned a lot from this tutorial.

AliAliOxenFree
Автор

wow thunder client is spectacular! the amount of time wasted per day/week/year alt-tabbing to postman or swagger or whatever.. and neither of those display the database queries. Thank you so much i am only on the second video and i have learned SO much

AliAliOxenFree
Автор

I am really have trouble with the database connection

Getting the error below

[Nest] 87748 - ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)...
error: role "postgres" does not exist

DevZyzer
Автор

Hi Piotr. I have a similar setup like your One-To-Many relationship between Recipe and Ingedients. How would you go about updating the ingedients of the Recipe? Is there an easy way to do with now that the cascade: true is set? I get the following error whenever i try to update the ingedients: ""ERROR [ExceptionsHandler] Cannot query across one-to-many for property tags""

thomaschristensen
join shbcf.ru