A simple ORM for MySQL on Node.js, providing easy object-relational mapping and raw query execution. Current stable version is 0.2.9, last updated in 2014. The library wraps the mysql package and offers model definitions, CRUD operations, transaction support, and connection pooling. It is written in pure JavaScript and supports Node.js >=0.10.0. Differentiators include a straightforward API for defining models with type mappings, automatic table creation, and helper methods like `queryNumber`. However, it is largely unmaintained and lacks modern features like Promise support and TypeScript definitions.
npm install mysql-warpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This example shows how to create a warp instance, define a model, perform CRUD operations, and execute raw SQL queries using mysql-warp.
Consider using an actively maintained ORM like Sequelize, TypeORM, or Knex.
Ensure your MySQL server's charset matches or set charset explicitly in the configuration.
Define tables outside of high-traffic code paths or use raw queries for table creation.
Wrap calls in Promises or use a library like 'util.promisify'.
Use raw queries for complex conditions.
Implement soft delete manually using an additional column.
Set pool options like 'connectionLimit' in the initial configuration.
Use require('mysql-warp') instead of import.Use a newer MySQL driver or set default_authentication_plugin=mysql_native_password on the server.
Ensure the table exists (use defineTable) and the warp configuration is correct.
Include an 'id' field in the model definition with type 'Number' and let the library create it with auto_increment.
Check that MySQL is running and the host/port/user/password are correct.