xorm is a Node.js ORM wrapper around Objection.js (v0.7.6) that adds conventions like automatic table naming (model class name), managed timestamps (createdAt/updatedAt), and soft delete support with methods like withTrashed/forceDelete. It requires knex (>=0.19.0 <1.0) as the SQL query builder and sm-utils. It is maintained by Smartprix, with moderate release cadence. Key differentiators vs. Objection: less boilerplate, built-in timestamp/soft-delete lifecycle hooks.
npm install xormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup with knex, automatic timestamps, and soft delete feature. Creates a User model, inserts, soft deletes, and queries trashed.
Pin Objection to ^1.6.9 and knex to >=0.19.0 <1.0 as per peer deps. Check compatibility when upgrading.
Define static get tableName() { return 'actual_table_name'; } in your model.Set static timestamps = false; or map column names via timestamps = {createdAt: 'my_created', updatedAt: 'my_updated'}.Ensure model has static softDelete = true; and schema includes 'deletedAt' column (or custom column name).
Run npm install sm-utils@^2.14.5
Call Model.knex(knex) with a valid knex instance; ensure knex is installed and imported.
Disable timestamps (static timestamps = false) or add the column in migration.
Ensure static softDelete = true; if still missing, upgrade xorm to >=0.7.0.