Slide 9
Slide 9 text
ORM (SEQUELIZE) を利用
src/app.module.ts
imports: [
SequelizeModule.forRoot({
database: 'sample',
dialect: 'sqlite',
storage: 'database/database.sqlite3',
models: [User],
}),
UsersModule,
],
9
src/users/entities/user.entity.ts
import { Column, Model, Table } from 'sequelize-
typescript';
@Table
export class User extends Model {
@Column
firstName: string;
@Column
lastName: string;
@Column({ defaultValue: true })
isActive: boolean;
}
$ nest g res users
? What transport layer do you use? REST API
? Would you like to generate CRUD entry points? Yes