Skip to content

kei711-sandbox/nestjs-typeorm

Repository files navigation

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Command history

nest new nestjs-typeorm
yarn add @nestjs/typeorm typeorm pg

mkdir -p docker/db/init
touch docker/db/init/.gitkeep

# typeorm
yarn typeorm init --database postgres
git checkout .gitignore tsconfig.json

# define schema
# yarn typeorm entity:create -n User
yarn typeorm migration:generate -n CreateUserTable
yarn typeorm entity:create -n Message
yarn typeorm migration:generate -n CreateMessageTable

# migration
yarn typeorm migration:show
yarn typeorm migration:run
yarn typeorm migration:show
yarn typeorm query "select * from Message"

nest g module user
nest g service user
nest g controller user

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published