A TypeScript abstract class for creating PostgreSQL model classes that provides a structured base for database operations. Current stable version is 0.2.3, but development appears minimal with no recent updates. It offers a lightweight ORM-like abstraction with TypeScript type safety, but compared to mature alternatives like TypeORM or Sequelize, it lacks features, documentation, and community support. Suitable only for early-stage prototyping.
npm install ts-postgres-modelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This shows how to extend the Model class, define a custom static method, and use it.
Consider using a more mature ORM like TypeORM or Prisma.
Read the source code or use a better-documented library.
Pass an existing pool instance; ensure pool.end() is called.
Use this.constructor.query() or define query as static.
Run npm install ts-postgres-model and check import statement.
Define interface for row type and pass to Model<RowType>.