typeorm-sequence
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Typeorm-sequence

Typeorm-sequence is a library that enables you to use a db sequence in a column (it works only on postgres yet, I'm implementing with others DB's).

Install via NPM

  npm i typeorm-sequence

Usage

import { Entity, Column, PrimaryColumn } from 'typeorm'
import { NextVal, EntityWithSequence } from 'typeorm-sequence'

@Entity({ name: 'client_table' })
export class Client extends EntityWithSequence {

  @NextVal('seq_client')
  @PrimaryColumn({ name: 'client_id' })
  id: number

  @Column({ name: 'client_name' })
  name: string
  constructor() {
    super()
  }
}

Package Sidebar

Install

npm i typeorm-sequence

Weekly Downloads

279

Version

1.1.3

License

ISC

Unpacked Size

8.25 kB

Total Files

11

Last publish

Collaborators

  • ianprogrammer