A MySQL wrapper for Node.js that simplifies database connections, queries, transactions, and pooling with a chainable API. Version 1.0.0, based on the popular node-mysql (mysql npm package) and designed for use with the anyTV Express.js boilerplate. Provides features like automatic connection management, retry on specific errors, auto-reconnect, debugging, squel and knex integration, promise support, and transaction rollback. Differentiators include a key-config registry for multiple databases, elegant transaction handling, and automatic rollback on failure. Maintained but with low activity.
npm install anytv-node-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows registering a database, querying with callback, promise-based query, and a simple transaction.
Always chain .end() after query or use .build() + .promise() for promises.
Use mysql.add('db', config, true) to create a pool, or mysql.use('db', true) to switch to pool.Always check for errors in callbacks or catch rejections; do not rely solely on automatic rollback.
Use mysql.build(squelQuery) or mysql.build(knexQuery) directly, not mysql.query(builder).
Switch to mysql2 or use a more modern MySQL client like @mysql/xdevapi.
Use 'import mysql from \'anytv-node-mysql\'' (default import) instead of '{ mysql }' named import.Check that config.host, config.user, config.password, and config.database are correct.
Ensure MySQL server is started and host/port are correct.
Register at least one database configuration using mysql.add() before querying.
Ensure each query chain ends with .end() to release the connection, or use pool connections.