Entities
Introduction
Puro REST Framework uses TypeORM for managing database entities.
Make sure to have installed a database driver accordingly with the TypeORM's documentation if you want to use the database entities.
Defining an entity
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { BeforeInsert } from 'typeorm';
@Entity()
export class Book {
@PrimaryGeneratedColumn()
id!: number;
@Column({ length: 128 })
title!: string;
@Column({ length: 256 })
description!: string;
}
Last updated
Was this helpful?