/typeorm-upload-challenge-gostack

🪓 Ax-grinding | TypeOrm image upload challenge from GoStack course by RocketSeat

Primary LanguageTypeScript

🪓 Ax-grinding series | ⚛️ NodeJS + TypeORM + Postgres + Upload and import csv files

GitHub package.json version Custom badge

🚀 GoStack exercise by Adão Lima

Course by Rocketseat

Install database trough nodeJS

docker run --name gostack_desafio06 -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres

Install dependencies

Yarn

Run migrations

Yarn typeorm migration:run

Run app

Yarn dev:server

Test app

Yarn test

⚡️💡 Insights

  • Bulk import is the correct to avoid stress database processment, in import datas form files text;
  • Decorators from TypeORM, help set types relations to database models;
  • Use models decorateds, in repositories, as way typed to handle datas;
  • When imported repository, you can acess methods to handle database;
  • After use the method create(), from a repository, to create a new entity, you will need to use save() method, to register or update datas on database;