Manage a group of SQL tables with parent-child relations as a document/entity (NoSQL-style). Current stable version 7.2.0. Release cadence is irregular. Key differentiator: define entity schemas using JSON Schema and automatically create relational tables with CRUD operations. Requires a CR layer driver like pg-cr-layer or mssql-cr-layer. Not to be confused with JSON Schema validation libraries.
npm install json-schema-entityNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an entity class for 'customer' with hasMany relation to 'orders', then creates tables, inserts data, and saves.
Ensure createTables() resolves before syncTables() and update schema definitions to conform to JSON Schema draft-04.
Install either pg-cr-layer or mssql-cr-layer as a peer dependency.
Use const jse = require('json-schema-entity') or import jse from 'json-schema-entity'.Ensure autoIncrement properties are integers and have primaryKey: true.
npm install pg-cr-layer
const MyClass = jse('name', schema); // no newEnsure schema has valid properties and types.