Typeorm-sequence is a lightweight library (v1.1.3) that adds DB sequence support to TypeORM entity columns, currently limited to PostgreSQL. It provides decorators and a base entity to automatically generate next values from named sequences. Development is active but slow, with niche utility for those needing sequence-based IDs instead of auto-increment. The library is minimal, with no external dependencies beyond TypeORM and a PostgreSQL driver. It lacks support for other databases and has not been updated recently.
npm install typeorm-sequenceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define an entity with a sequence-based primary key using @NextVal decorator and EntityWithSequence base class.
Use PostgreSQL or consider alternative libraries like 'typeorm-sequencing'.
Ensure your entity class extends EntityWithSequence from the library.
Manually create the sequence (e.g., CREATE SEQUENCE seq_client) or use TypeORM migrations.
Consider forking or using a more active alternative.
Run 'npm install typeorm-sequence' and ensure import uses named exports: import { NextVal } from 'typeorm-sequence'.Execute 'CREATE SEQUENCE seq_client' in your PostgreSQL database.
Verify import: import { EntityWithSequence } from 'typeorm-sequence' and ensure class extends it.