What is Column?

Column is a decorator that adds a column to the database table. You can define a column by adding the @Column decorator to a class property within a schema.

/* ./schemas/photo.ts */
import { Schema, Column, Unique, Default } from 'nexorm/decorators';

@Schema
class PhotoSchema {

@Column
@Unique
static photoId = String;

@Column
static photo = Buffer;

@Column
@Default(new Date())
static date = Date;

};

Click here to see other decorators available with @Column

Last updated