Tspace MySQL is a promise-based ORM for Node.js with full TypeScript support, providing type safety, model-based CRUD, schema migrations, relationships, soft deletes, caching, and a job queue. Current stable version is 1.9.1. It supports MySQL, MariaDB, Postgres, SQLite, and MongoDB (experimental). Key differentiators include built-in validation, a CLI for migrations and model generation, decorators for clean code, and support for nested relations. Releases follow a regular cadence with TypeScript peer dependency >=5.6.2. Compared to Sequelize or TypeORM, it offers a more opinionated repository pattern and includes caching (in-memory and Redis) and a queue out of the box.
npm install tspace-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a TspaceMysql connection, defines a User model with a decorator, syncs schema, creates a record, and logs it.
Use import syntax or upgrade TypeScript module resolution to Node16+.
Use `db.migrate()` or CLI `tspace-mysql migrate` instead.
Set `experimentalDecorators: true` in tsconfig.json.
Use only MySQL/MariaDB/Postgres for production.
Run `npm install tspace-mysql` and ensure import path is correct.
Use `import { TspaceMysql } from 'tspace-mysql'` instead.Add `"experimentalDecorators": true` to tsconfig.json.