mikro-orm

type annotations

One of the benefits that I like more and more over time is mikro-orm’s integration with ts-morph which results in less type annotations on entity properties, for example:

// typeorm
@Column({ nullable: true })
myProperty?: string;

// mikro-orm
@Property()
myProperty?: string;

This is more pronounced where the native capability of the database is not surfaced intuitively in typeorm - for example, both of the following result in a postgres native array:

// typeorm
@Column({ array: true, default: {} })
myArray: string[];

// mikro-orm
@Property()
myArray: string[];