# typeorm-unique-on-database

> Decorator TypeORM for Unique Data on Database

Latest version **1.0.0** (published 2022-05-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install typeorm-unique-on-database
pnpm add typeorm-unique-on-database
yarn add typeorm-unique-on-database
bun add typeorm-unique-on-database
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-11 |
| First published | 2022-05-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 100.2 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hallison |
| Maintainers | bunker.dev |
| Keywords | typeorm, unique, node, ts, database |

## Links

- npm: https://www.npmjs.com/package/typeorm-unique-on-database
- Repository: https://github.com/hallss93/typeorm-unique-on-database
- Homepage: https://github.com/hallss93/typeorm-unique-on-database#readme
- Issues: https://github.com/hallss93/typeorm-unique-on-database/issues
- npm.io page: https://npm.io/package/typeorm-unique-on-database

## Dependencies (3)

- [typeorm](https://npm.io/package/typeorm.md) ^0.2.38
- [@nestjs/typeorm](https://npm.io/package/@nestjs/typeorm.md) ^8.0.2
- [class-validator](https://npm.io/package/class-validator.md) ^0.13.1

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-05-11

## README

# TyepORM Unique on Database
Validation to avoid duplicate entries in the entity.

## Installation

```
npm i --save typeorm-unique-on-database
```

## Usage

To use it, just import it into your application and use the decorator

```typescript
import { UniqueOnDatabase } from 'typeorm-unique-on-database'; // import

...

@Entity()
export class Company extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ nullable: false })
  @ApiProperty()
  @MinLength(3)
  @UniqueOnDatabase(Company) // pass the entity
  name: string;
  
  ...

}

```

---
_Source: https://npm.io/package/typeorm-unique-on-database · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
