@anchan828/typeorm-decorators
v1.0.100
Published
[TypeORM](https://github.com/typeorm/typeorm) decorators
Downloads
601
Readme
@anchan828/typeorm-decorators
Description
Decorator collection for TypeORM
Installation
$ npm i --save typeorm @anchan828/typeorm-decorators
Quick Start
@Entity()
class UlidColumnTest extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
@UlidColumn()
public ulid!: string;
}
@Entity()
class StaticFileColumnTest extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
@StaticFileColumn({ dirname: "/path/to/" })
public file!: BinaryLike;
}
@Entity()
class EncryptTransformerTest extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
// key is createHash("sha256").update("test").digest("hex")
@EncryptColumn({ key: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" })
public password!: string;
}