ts-pg-orm is a TypeScript-first PostgreSQL ORM that provides fully type-enforced queries for CRUD operations, relations, and custom SQL. Current stable version is 5.1.7, released with moderate cadence. It differentiates by offering zero guess-work TypeScript inference, recursive relation queries, and automatic store provisioning. Built entirely in TypeScript with no runtime peer dependencies, it supports ESM and CJS. The library is actively maintained with CI/CD and coverage reporting.
npm install ts-pg-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup, connection, provisioning, and a simple create operation with ts-pg-orm.
Update connection calls to use an options object: `ORM.connect({ host, port, database, user, password })`.Add `await orm.provisionStores()` after `ORM.connect()`.
Replace `Operator.EQUALS` with `'='`, `Operator.NOT_EQUALS` with `'!='`, etc.
Use `[userDF] as const` when calling `createTsPgOrm` and define relations using `as const`.
Set `store: { name: 'user' }` to create a table named `users`.Ensure every `createDataFormat` call includes `store: { name: 'yourName' }`.Add `await ORM.connect({...})` before accessing `orm.stores`.Upgrade to v5 and add `await orm.provisionStores()` after connect.
Use `createTsPgOrm([userDF] as const)` to infer exact literal types.
No dependency data recorded yet.