Synchronous ORM for Node.js that loads the entire MySQL database into memory at startup, providing direct JavaScript object access and in-memory manipulation with transactional writes. Version 0.1.54 (last updated ~2016, no recent releases), mostly maintenance status. Key differentiators: synchronous operations (no callbacks/promises), full in-memory caching, one-to-many relations via object linking. Not suitable for large datasets due to memory constraints.
npm install syncormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a database connection, defines a 'Person' table with fields and a calculated age field, then loads data synchronously.
Design the application to load once at startup; avoid loading during request handling.
Consider migrating to an up-to-date ORM like Sequelize, TypeORM, or Prisma.
Avoid modifying records inside triggers. Keep trigger logic minimal and side-effect free.
Use for small datasets only (<100k records). For larger data, use a streaming ORM instead.
Instantiate only one Database object per process. For multiple databases, create separate instances.
Start the MySQL service or update the Database config with the correct connection parameters.
Run 'npm install syncorm'
Ensure all access to db.<table> happens inside the callback to db.load()
Verify that the 'id' and 'fields' keys in define() match the exact column names in your MySQL table.