ModularORM (v0.3.51) is a lightweight, fully object-oriented ORM for TypeScript and MySQL. It uses a class-based, decorator-driven API to define tables, columns, and relationships, and supports DTO mapping with validation/transforms. Key differentiators: repository pattern out of the box, in-memory caching, typed information schema access, and auto or file-based migrations. Released as weekly updates, it targets developers who want a type-safe, minimal-overhead alternative to heavier ORMs like TypeORM or Sequelize. Note: only MySQL is currently supported, and the package is pre-1.0 (breaking changes possible).
npm install modular-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MySQL, defines a Users table with decorators, creates a DTO for mapping, queries all rows with repository pattern, and outputs results.
Pin exact version in package.json (e.g., "modular-orm": "0.3.51") and run integration tests on upgrade.
Add 'connectionType: 'pool'' to start() options, or upgrade to v0.3.0+
Ensure all table classes extend Module (imported from 'modular-orm').
Pass { validationErrors: true } to start() options.Use a different ORM if you need multi-dialect support.
Run `npm install modular-orm` and ensure tsconfig.json has `"moduleResolution": "node"` with `"module": "ES2020"` or use `--esModuleInterop`.
Replace `const orm = new ModularORM();` with `const orm = ModularORM.getInstance();`.
Always pass an object, e.g., `repo.find({})` for all rows.Ensure @Column() decorator matches DB schema, or run auto-migrations with `checkTablesExists: true` in start().