typeorm entity example
Example 1: typeorm
npm install typeorm -g
typeorm init --name MyProject --database mysql
Example 2: typeorm embedded entity
import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
export class Name {
@Column()
first: string;
@Column()
last: string;
}
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: string;
@Column(type => Name)
name: Name;
}