Skip to content

Backend Development ‐ TypeORM

afwilcox edited this page Sep 25, 2025 · 2 revisions

Generating entity classes from database

npm i -g typeorm-model-generator

npx typeorm-model-generator -h localhost -u postgres -x default -d postgres -e postgres

Scenario: You want to generate new CRUD classes?

Solution: use the nest cli

nest g resource {resource_name}

Still doesn't work? Try installing nest cli:

sudo npm install -g @nestjs/cli

Scenario: You want to generate the api spec via swagger

Solution: go to localhost:3001/api-json

Clone this wiki locally