A thin wrapper around node-mysql (the mysql npm package) that provides a set of convenience methods for common database operations such as execute, executeScalar, executeFirstRow, executeNonQuery, insert, update, and exist. Version 0.3.2 is the latest release. The library automatically manages connection closing when methods prefixed with '$' are used, and auto-closes on errors. It is designed for use with CoffeeScript callbacks and does not support Promises or async/await. It was last updated in 2018 and is considered stable but in maintenance mode. Compared to modern libraries like knex or typeorm, it lacks query builders, ORM features, and TypeScript support.
npm install mysql-dbhelperNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MySQL using 'mysql-dbhelper', executes a parameterized query to fetch the name of a user by ID, and logs the result. The connection is auto-closed due to the '$' prefix.
Use '$' prefix methods to auto-close, or ensure conn.end() is called in the callback for non-prefixed methods.
Do not reuse a connection after an error. Always create a new connection or handle errors appropriately.
Use 'mysql2' package instead and switch to a library that supports it, or configure MySQL to use mysql_native_password.
Always wrap parameters in an array: [value]. Omit the argument entirely if there are no parameters.
Use const dbHelper = require('mysql-dbhelper')(options);First call dbHelper.createConnection() to get a connection, then call methods on that connection.
Alter MySQL user: ALTER USER 'user'@'host' IDENTIFIED WITH mysql_native_password BY 'password'; or use a different library.