A JavaScript ORM for PostgreSQL that provides a declarative schema definition, automatic query building, and relation handling including one-to-one, one-to-many, and join relationships. Version 1.3.1 is the last release under the 5no-pg-model package; it has been renamed to @5no/pg-model. The library supports Node 8+ and uses @5no/pg-builder for query generation and @5no/schema for schema validation. It offers auto-filling fields for created/updated timestamps, cascade operations on relations, and a Manager for CRUD operations. Differentiates from heavier ORMs like Sequelize by being lightweight and focused on PostgreSQL only, with a minimal API surface.
npm install 5no-pg-modelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to PostgreSQL, defines a User model with auto-timestamp columns, creates a new user, and outputs its JSON representation.
Change require('5no-pg-model') to require('@5no/pg-model').Migrate to @5no/pg-model.
Use require() instead of import.
Set DATABASE_URL or pass options to Manager.init() if available.
npm install @5no/pg-model and require('@5no/pg-model')Manager.build(User).builder() instead of Manager.build(User.builder())