A library for storing structured JSON documents with versioning, etag/last-modified tracking, and zero-downtime migration support in PostgreSQL. Current stable version is 1.1.3, under initial development. Designed as a replacement for Azure Entities, it targets Node.js >=10 and focuses on redeployability, data visibility, and reliable optimistic concurrency via automatic etag and last-modified columns. Key differentiators include a human-readable storage format, table-level stored procedures for atomic updates, and built-in migration flow supporting multiple schema versions.
npm install postgres-entitiesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define an entity schema, ensure the table exists, and create an entity.
Upgrade Node.js to version 10 or later.
Use lowercase table names in defineEntity.
Do not directly update etag or last_modified columns; use library methods.
Always include a version property in the entity definition.
Define a migration function when bumping the version.
Run `npm install postgres-entities` from the project root.
Use `import { defineEntity } from 'postgres-entities'`.Call `await MyEntity.ensureTable(pool)` before CRUD operations.