Atlas MySQL is a type-safe MySQL ORM for Node.js built on top of mysql2. Current stable version is 2.1.0, released with monthly maintenance updates. It provides a fluent query builder, transaction support, schema introspection, and structured logging. Unlike raw mysql2, Atlas enforces TypeScript types at compile time, reducing runtime errors. It supports connection pooling, prepared statements, and migrations. The library ships TypeScript declarations and works with ESM and CJS runtimes. It is designed for developers who want type safety without sacrificing performance or flexibility.
npm install atlas-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a client, connects, creates a table, inserts and selects data using query builder, and runs a transaction.
Call client.reconnect() or create a new instance.
Update mysql2 to v3: npm install mysql2@^3.0.0
Replace useRaw with client.sql()`...`
Define enum columns with type: 'enum' and values as an array
Use single transaction for atomic operations; rollback in parent on child failure manually
npm install mysql2@^3.0.0
Use import atlas from 'atlas-mysql' then invoke atlas(config) to get client
Verify DB_USER and DB_PASS environment variables; grant privileges